/* Gallery Navigation Styles */

.gallery-navigator {
  padding: 2rem 0 4rem 0;
}

.gallery-navigator h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  letter-spacing: 0.1em;
}

/* Category Grid */
.gallery-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Individual Category Card */
.category-card {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  background: rgba(20, 20, 20, 0.8);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Coming Soon styling */
.category-card.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.category-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

/* Thumbnail Stack (behind the overlay) */
.thumbnail-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

/* Individual thumbnail images in the stack */
.thumbnail-stack img {
  position: absolute;
  width: 40%;
  height: 40%;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.3;
  filter: blur(0.5px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: float 15s ease-in-out infinite;
  /* Positioning is now handled dynamically in JavaScript */
}

/* Floating animation - subtle drift */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(10px, -10px) rotate(2deg) scale(1.05);
  }
  50% {
    transform: translate(-5px, 5px) rotate(-1deg) scale(0.95);
  }
  75% {
    transform: translate(-10px, -5px) rotate(1deg) scale(1.02);
  }
}

/* Show thumbnails more prominently on hover */
.category-card:not(.coming-soon):hover .thumbnail-stack img {
  opacity: 0.7;
  filter: blur(0px);
  animation-duration: 10s;
}

/* Frosted glass overlay */
.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.category-card:not(.coming-soon):hover .category-overlay {
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

/* Category content */
.category-content {
  text-align: center;
  padding: 2rem;
  transition: transform 0.4s ease;
}

.category-card:hover .category-content {
  transform: scale(1.05);
}

.category-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #fff;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

/* Dark text on hover for better visibility */
.category-card:not(.coming-soon):hover .category-content h3 {
  color: #1a1a1a;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.category-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

/* Dark text on hover for better visibility */
.category-card:not(.coming-soon):hover .category-count {
  color: #2a2a2a;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

.category-button {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.category-card:not(.coming-soon):hover .category-button {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 1);
  color: #1a1a1a;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.category-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state for thumbnails */
.thumbnail-stack.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .gallery-categories {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-navigator h2 {
    font-size: 1.6rem;
    margin-bottom: 2rem;
  }
  
  .gallery-categories {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .category-card {
    aspect-ratio: 16/10;
  }
  
  .category-content h3 {
    font-size: 1.5rem;
  }
  
  /* On mobile, show thumbnails by default at reduced opacity */
  .thumbnail-stack img {
    opacity: 0.25;
    animation-duration: 20s;
  }
  
  .category-card:not(.coming-soon):hover .thumbnail-stack img,
  .category-card:not(.coming-soon):active .thumbnail-stack img {
    opacity: 0.6;
    animation-duration: 12s;
  }
  
  /* Reduce overlay blur on mobile for better visibility */
  .category-overlay {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  
  .category-card:not(.coming-soon):hover .category-overlay,
  .category-card:not(.coming-soon):active .category-overlay {
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0.5px);
  }
}

/* Accessibility - reduce motion */
@media (prefers-reduced-motion: reduce) {
  .category-card,
  .thumbnail-stack img,
  .category-overlay,
  .category-content,
  .category-button {
    transition: none;
    animation: none;
  }
  
  .category-card:hover {
    transform: none;
  }
}
