/* =========================================================
   GALLERY SPECIFIC STYLES
   Brand Colors - Indra Ganesan Institutions
   ========================================================= */

/* CSS Variables */
:root {
  --ig-primary: #8a1c6e;
  --ig-secondary: #6f1a59;
  --ig-light: #f7eff4;
  --ig-dark: #2a1a24;
  --ig-accent: #c43a92;
  --ig-gradient: linear-gradient(135deg, #8a1c6e 0%, #6f1a59 100%);
  --ig-gradient-light: linear-gradient(135deg, #c43a92 0%, #8a1c6e 100%);

  --shadow-sm: 0 2px 8px rgba(138, 28, 110, 0.1);
  --shadow-md: 0 4px 16px rgba(138, 28, 110, 0.15);
  --shadow-lg: 0 8px 32px rgba(138, 28, 110, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Fix for sticky internal navigation overlapping */
html {
  scroll-padding-top: 150px;
}

/* Gallery Header */
.gallery-header {
  background: var(--ig-gradient);
  color: white;
  padding: 60px 0 40px;
  text-align: center;
  margin-top: 0;
  position: relative;
  overflow: hidden;
}

.gallery-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.05"><path d="M0,70 Q250,10 500,70 T1000,70 L1000,100 L0,100 Z"/></svg>');
  background-size: cover;
  pointer-events: none;
}

.gallery-header h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.gallery-header .lead {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Internal Navigation */
.internal-nav-section {
  background: white;
  border-bottom: 2px solid var(--ig-light);
  position: sticky;
  top: 80px;
  z-index: 999;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.internal-nav {
  padding: 1rem 0;
}

.internal-nav .navbar-nav {
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.internal-nav .nav-item {
  list-style: none;
}

.internal-nav .nav-link {
  color: var(--ig-dark);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
}

.internal-nav .nav-link:hover {
  background: var(--ig-light);
  color: var(--ig-primary);
  transform: translateY(-2px);
}

.internal-nav .nav-link.active {
  background: var(--ig-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(138, 28, 110, 0.3);
}

.internal-nav .nav-link i {
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  position: relative;
}

/* Section Category */
.section-category {
  margin-bottom: 4rem;
}

/* Controls Section */
.controls-section {
  background: var(--ig-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
}

.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: var(--ig-dark);
  margin-bottom: 0.5rem;
}

.controls-grid .form-select {
  border: 2px solid #e9ecef;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.controls-grid .form-select:focus {
  border-color: var(--ig-primary);
  box-shadow: 0 0 0 0.25rem rgba(138, 28, 110, 0.25);
}

/* Album Cards */
.album-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9ecef;
}

.album-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.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: var(--ig-primary);
  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(138, 28, 110, 0.85);
  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: white;
  color: var(--ig-primary);
  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: var(--ig-accent);
  color: white;
  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: var(--ig-dark);
  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;
  color: var(--ig-primary);
}

.album-content .view-album-btn {
  background: transparent;
  color: var(--ig-primary);
  border: 2px solid var(--ig-primary);
  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: var(--ig-gradient);
  color: white;
  border-color: transparent;
}

/* Photo Grid View */
.back-to-albums {
  color: var(--ig-primary);
  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: var(--ig-accent);
  transform: translateX(-5px);
}

.album-header-detail {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--ig-primary);
}

.album-title-detail {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  color: var(--ig-dark);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.album-meta-detail {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  color: #6c757d;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.album-meta-detail span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.album-meta-detail i {
  color: var(--ig-primary);
}

.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: var(--radius-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  height: 250px;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.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(138, 28, 110, 0.75);
  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.95);
  color: var(--ig-primary);
  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);
  color: var(--ig-accent);
}

/* 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(138, 28, 110, 0.5);
  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: var(--ig-primary);
  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(138, 28, 110, 0.5);
  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: var(--ig-primary);
  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 var(--ig-light);
  border-top: 5px solid var(--ig-primary);
  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: var(--ig-light);
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  color: var(--ig-dark);
  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: var(--shadow-md);
  background: var(--ig-gradient);
  border: none;
  color: white;
}

#backToTop:hover {
  background: var(--ig-gradient-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 140px;
  }

  .gallery-header h1 {
    font-size: 2.5rem;
  }

  .gallery-header .lead {
    font-size: 1.1rem;
  }

  .internal-nav-section {
    top: 70px;
  }

  .internal-nav .navbar-nav {
    gap: 0.5rem;
  }

  .internal-nav .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .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: 40px 0 30px;
  }

  .gallery-header h1 {
    font-size: 2rem;
  }

  .internal-nav-section {
    top: 60px;
  }

  .internal-nav .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .album-title-detail {
    font-size: 1.5rem;
  }

  .album-meta-detail {
    gap: 1rem;
    flex-direction: column;
  }
}

/* Print Styles */
@media print {
  .internal-nav-section,
  #backToTop,
  .controls-section,
  .album-overlay,
  .photo-overlay,
  .lightbox-nav-btn,
  .lightbox-close {
    display: none !important;
  }

  .gallery-header {
    background: white !important;
    color: black !important;
    padding: 1rem 0 !important;
  }

  .album-card,
  .section-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
}