/* ================================
   Modern Premium Gallery CSS
   ================================ */

:root {
  --primary: #e63946;
  --primary-dark: #c42532;
  --accent: #1d3557;
  --accent-light: #457b9d;
  --dark: #0a0e27;
  --light: #f8f9fa;
  --white: #ffffff;
  --muted: #6b7280;
  --gradient-primary: linear-gradient(135deg, #e63946 0%, #c42532 100%);
  --gradient-dark: linear-gradient(135deg, #1d3557 0%, #0a0e27 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 0 40px rgba(230, 57, 70, 0.3);
  --gap: 2rem;
  --radius: 24px;
}

body {
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

/* Gallery Controls - Inside Albums Grid Section */
.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
  margin-bottom: 3rem;
  padding: 1rem 0;
}

.search-box {
  position: relative;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.search-box::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: var(--gradient-primary);
  border-radius: 18px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  filter: blur(10px);
}

.search-box:focus-within::before {
  opacity: 0.3;
}

.search-box svg {
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
  transition: all 0.3s ease;
}

.search-box:focus-within svg {
  color: var(--primary);
  transform: translateY(-50%) scale(1.15);
}

.search-box input {
  position: relative;
  width: 100%;
  padding: 1.35rem 1.75rem 1.35rem 4.5rem;
  border: 2px solid rgba(230, 57, 70, 0.15);
  border-radius: 16px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--accent);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(230, 57, 70, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.search-box input:hover {
  border-color: rgba(230, 57, 70, 0.25);
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(230, 57, 70, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  background: var(--white);
  transform: translateY(-2px);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 
    0 0 0 4px rgba(230, 57, 70, 0.15),
    0 8px 32px rgba(230, 57, 70, 0.2),
    0 4px 16px rgba(230, 57, 70, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  background: var(--white);
  transform: translateY(-3px) scale(1.01);
}

.search-box input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-results-count {
  position: absolute;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 3;
  background: rgba(230, 57, 70, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
}

.search-results-count.show {
  opacity: 1;
}

/* ===== Albums Grid Section ===== */
.albums-grid {
  background: linear-gradient(180deg, var(--white) 0%, var(--light) 100%);
  position: relative;
  padding: 6rem 0;
  min-height: 400px;
}

.albums-grid .grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  width: 100%;
}

/* ===== Album Card Premium ===== */
.album-card {
  display: block;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  border: 1px solid rgba(230, 57, 70, 0.1);
}

.album-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  z-index: 10;
}

.album-card:hover::before {
  transform: scaleX(1);
}

.album-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.album-cover {
  position: relative;
  overflow: hidden;
  background: var(--dark);
}

.album-cover img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, filter 0.4s ease;
}

.album-card:hover .album-cover img {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.album-meta {
  padding: 1.5rem;
}

.album-meta h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
}

.album-card:hover .album-meta h3 {
  color: var(--primary);
}

.album-meta p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.album-meta .desc {
  margin-top: 0.75rem;
  color: #555;
}

/* Photo count badge */
.album-meta .muted {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(230, 57, 70, 0.1);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== Album Detail Hero ===== */
.album-hero {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.album-hero .album-cover {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.album-hero .album-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(230, 57, 70, 0.2),
    transparent 50%
  );
  z-index: 1;
  pointer-events: none;
}

.album-hero .album-cover img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.album-hero .album-info {
  position: relative;
  z-index: 10;
}

.album-hero .album-info h1 {
  text-align: left;
  margin-bottom: 1.5rem;
}

.album-hero .album-info p {
  text-align: left;
  margin: 0;
}

@media (max-width: 900px) {
  .album-hero {
    grid-template-columns: 1fr;
    padding: 4rem 1rem;
  }
  
  .album-hero .album-cover img {
    height: 300px;
  }
  
  .album-hero .album-info h1 {
    text-align: center;
  }
  
  .album-hero .album-info p {
    text-align: center;
  }
}

/* ===== Photos Grid Section ===== */
.photos-grid {
  background: linear-gradient(180deg, var(--white) 0%, var(--light) 100%);
  position: relative;
  padding: 6rem 0;
}

.photos-grid .grid.photos {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  width: 100%;
}

/* ===== Photo Card ===== */
.photo-card {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.photo-card::before {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 3rem;
  z-index: 10;
  opacity: 0;
  transition: all 0.4s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.photo-card:hover::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.photo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.photo-card:hover::after {
  opacity: 1;
}

.photo-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.photo-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  background: var(--light);
  transition: transform 0.6s ease;
}

.photo-card:hover img {
  transform: scale(1.1);
}

/* ===== Lightbox Modern ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  display: flex;
  opacity: 1;
  animation: lightboxFade 0.3s ease;
}

@keyframes lightboxFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: lightboxSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lightboxSlide {
  from {
    transform: scale(0.9) translateY(30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

#lb-img {
  max-width: 85vw;
  max-height: 65vh;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--white);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  line-height: 48px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-weight: 700;
}

.lb-close:hover {
  background: var(--primary);
  color: var(--white);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4);
}

.lb-caption {
  color: var(--white);
  max-width: 85vw;
  margin-top: 1.5rem;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.lb-caption strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .albums-grid .grid,
  .photos-grid .grid.photos {
    grid-template-columns: 1fr;
  }
  
  .gallery-controls {
    margin-bottom: 2rem;
    padding: 0.75rem 0;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .search-box input {
    padding: 1.15rem 1.5rem 1.15rem 3.75rem;
    font-size: 1rem;
  }
  
  .search-box svg {
    left: 1.5rem;
    width: 20px;
    height: 20px;
  }
  
  .search-results-count {
    right: 1.5rem;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
  }
  
  .albums-grid {
    padding: 4rem 0;
  }
  
  .photos-grid {
    padding: 4rem 0;
  }
  
  .album-cover img {
    height: 200px !important;
  }
  
  .photo-card img {
    height: 220px;
  }
  
  .lightbox-inner {
    padding: 1rem;
  }
  
  #lb-img {
    max-width: 90vw;
    max-height: 70vh;
  }
  
  .lb-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 40px;
  }
}

/* ===== Animations ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.album-card {
  opacity: 0;
  animation: slideIn 0.6s ease-out forwards;
}

.album-card:nth-child(1) { animation-delay: 0.1s; }
.album-card:nth-child(2) { animation-delay: 0.2s; }
.album-card:nth-child(3) { animation-delay: 0.3s; }
.album-card:nth-child(4) { animation-delay: 0.4s; }
.album-card:nth-child(5) { animation-delay: 0.5s; }
.album-card:nth-child(6) { animation-delay: 0.6s; }
.album-card:nth-child(n+7) { animation-delay: 0.7s; }

.photo-card {
  animation: slideIn 0.5s ease-out;
  animation-fill-mode: both;
}

.photo-card:nth-child(1) { animation-delay: 0.05s; }
.photo-card:nth-child(2) { animation-delay: 0.1s; }
.photo-card:nth-child(3) { animation-delay: 0.15s; }
.photo-card:nth-child(4) { animation-delay: 0.2s; }
.photo-card:nth-child(5) { animation-delay: 0.25s; }
.photo-card:nth-child(6) { animation-delay: 0.3s; }
.photo-card:nth-child(7) { animation-delay: 0.35s; }
.photo-card:nth-child(8) { animation-delay: 0.4s; }

/* ===== Empty State ===== */
.albums-grid .muted.center,
.photos-grid .muted.center {
  padding: 4rem 2rem;
  font-size: 1.2rem;
  color: var(--muted);
  text-align: center;
}

/* Ensure proper spacing for section-header */
.albums-grid .section-header {
  margin-bottom: 3rem;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  margin: 2rem 0;
}

.empty-state svg {
  width: 120px;
  height: 120px;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.empty-state p {
  color: var(--muted);
  font-size: 1rem;
}