/* Gallery Page Styles */
.gallery-container {
  padding: calc(var(--nav-offset) + var(--countdown-offset) + 2rem) 0 4rem;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 1rem;
}

.gallery-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.gallery-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 0 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.gallery-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fullscreen Modal */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-modal.active {
  display: flex;
  opacity: 1;
}

.gallery-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.gallery-modal-img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: var(--shadow-2xl);
}

.gallery-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 10001;
}

.gallery-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 10001; /* Ensure arrows are above the image */
  /* Add shadow for better visibility */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-modal-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-modal-prev {
  left: 1rem;
}

.gallery-modal-next {
  right: 1rem;
}

/* Swipe indicator for mobile */
.gallery-modal-swipe-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  display: none;
  z-index: 10001;
  backdrop-filter: blur(5px);
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Loading Spinner */
.gallery-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-light);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-container {
    padding-top: calc(var(--nav-offset) + 1rem);
  }
  
  .gallery-header h1 {
    font-size: 2rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .gallery-modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .gallery-header {
    margin-bottom: 2rem;
  }
  
  .gallery-modal-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  /* Show swipe indicator on mobile */
  .gallery-modal-swipe-indicator {
    display: block;
  }
  
  /* Ensure navigation arrows are visible on mobile */
  .gallery-modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    display: flex !important; /* Force display on mobile */
    opacity: 1 !important; /* Ensure visibility */
    /* Enhance visibility on mobile */
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
  }
  
  .gallery-modal-nav:hover {
    background: rgba(255, 255, 255, 0.4);
  }
  
  .gallery-modal-prev {
    left: 0.5rem;
  }
  
  .gallery-modal-next {
    right: 0.5rem;
  }
  
  /* Adjust positioning for smaller screens */
  .gallery-modal-nav {
    top: 50%;
    transform: translateY(-50%);
  }
}