/* GALLERY SPECIFIC STYLES */

/* Fix for sticky internal navigation overlapping */
html {
  scroll-padding-top: 150px; /* Adjust based on combined header heights */
}

/* Gallery Header */
.gallery-header {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: white;
  padding: 30px 0 30px;
  text-align: center;
  margin-top: 0; /* Ensure no extra margin */
}

.gallery-header h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.gallery-header .lead {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
}

/* Internal Navigation - FIXED */
.internal-nav-section {
  background: white;
  border-bottom: 2px solid #e9ecef;
  position: sticky;
  top: 80px; /* Adjusted to sit below main header (assuming main header is ~80px) */
  z-index: 999; /* Reduced from 1000 to be below main header */
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.internal-nav {
  padding: 1rem 0;
}

.internal-nav .navbar-nav {
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.internal-nav .nav-link {
  color: #495057;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.internal-nav .nav-link:hover {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  transform: translateY(-2px);
}

.internal-nav .nav-link.active {
  background: #0d6efd;
  color: white;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.internal-nav .nav-link i {
  font-size: 1.1rem;
}

/* Add spacing for main content to account for fixed headers */
.main-content {
  position: relative;
}

/* Section Category */
.section-category {
  margin-bottom: 4rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  color: #212529;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: #6c757d;
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Controls Section */
.controls-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: end;
}

.controls-grid .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.controls-grid .form-select {
  border: 2px solid #dee2e6;
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.controls-grid .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Album Cards */
.album-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

.album-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.album-thumbnail {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.album-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.album-card:hover .album-thumbnail img {
  transform: scale(1.05);
}

.album-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #0d6efd;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.album-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.album-card:hover .album-overlay {
  opacity: 1;
}

.album-overlay .view-album-btn {
  background: #0d6efd;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.album-overlay .view-album-btn:hover {
  background: #0b5ed7;
  transform: scale(1.05);
}

.album-content {
  padding: 1.5rem;
}

.album-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: #212529;
  line-height: 1.3;
}

.album-description {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.album-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #6c757d;
}

.album-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.album-meta i {
  font-size: 1rem;
}

.album-content .view-album-btn {
  background: transparent;
  color: #0d6efd;
  border: 2px solid #0d6efd;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.album-content .view-album-btn:hover {
  background: #0d6efd;
  color: white;
}

/* Photo Grid View */
.back-to-albums {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.back-to-albums:hover {
  color: #0b5ed7;
  transform: translateX(-5px);
}

.album-header-detail {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.album-title-detail {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  color: #212529;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.album-meta-detail {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  color: #6c757d;
  font-size: 0.95rem;
}

.album-meta-detail span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.album-description-detail {
  color: #495057;
  font-size: 1.1rem;
  line-height: 1.6;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.photo-item {
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 250px;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.photo-thumbnail {
  position: relative;
  height: 100%;
  cursor: pointer;
}

.photo-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo-item:hover .photo-thumbnail img {
  transform: scale(1.1);
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.view-photo-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #212529;
  border: none;
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.view-photo-btn:hover {
  background: white;
  transform: scale(1.05);
}

/* Lightbox */
.lightbox-container {
  position: relative;
  height: 100vh;
  background: #000;
}

.lightbox-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    transparent 100%
  );
  z-index: 10;
}

.lightbox-title {
  color: white;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
}

.lightbox-body {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-body img {
  max-height: 85vh;
  max-width: 90vw;
  object-fit: contain;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  z-index: 10;
}

#lightboxImageInfo {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 20;
  backdrop-filter: blur(5px);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  min-height: 300px;
}

.loading::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  color: #6c757d;
  margin-bottom: 1rem;
}

.empty-state p {
  color: #adb5bd;
  max-width: 400px;
  margin: 0 auto;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Adjust scroll padding for mobile */
  html {
    scroll-padding-top: 140px; /* Slightly less for mobile */
  }

  .gallery-header h1 {
    font-size: 2.5rem;
  }

  .gallery-header .lead {
    font-size: 1.1rem;
  }

  .internal-nav-section {
    top: 70px; /* Adjust for smaller mobile header */
  }

  .internal-nav .navbar-nav {
    gap: 0.5rem;
  }

  .internal-nav .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .album-thumbnail {
    height: 200px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .photo-item {
    height: 200px;
  }

  .lightbox-nav-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }
}

@media (max-width: 576px) {
  .gallery-header {
    padding: 60px 0 30px;
  }

  .gallery-header h1 {
    font-size: 2rem;
  }

  .internal-nav-section {
    top: 60px; /* Further adjust for very small screens */
  }

  .internal-nav .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}
