/* ===== PREMIUM GALLERY STYLES ===== */

/* Gallery Hero Section */
.gallery-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e392f 0%, #2a4a3f 100%);
  overflow: hidden;
  padding-top: var(--header-height);
}

.gallery-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(218, 165, 32, 0.08) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

.gallery-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 57, 47, 0.3);
  z-index: 1;
}

.gallery-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
  animation: fadeInUp 1s ease-out;
}

.gallery-hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4.5rem;
  font-weight: 600;
  color: var(--off-white-cream);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--off-white-cream);
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Gallery Section */
.gallery-section {
  background: linear-gradient(180deg, #ffffff 0%, #fdfdf5 100%);
  padding: 6rem 0;
  position: relative;
}

.gallery-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
}

/* Premium Filter Tabs */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: #ffffff;
  color: var(--deep-green-text);
  border: 2px solid rgba(30, 57, 47, 0.15);
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--muted-gold), var(--gold-accent));
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

.filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.filter-btn:hover {
  color: var(--deep-green-text);
  border-color: var(--muted-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(218, 165, 32, 0.2);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--muted-gold), var(--gold-accent));
  color: var(--deep-green-text);
  border-color: var(--gold-accent);
  box-shadow: 0 8px 24px rgba(218, 165, 32, 0.3);
  transform: translateY(-2px);
}

/* Premium Gallery Grid - 4 Items Per Row */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  animation: fadeIn 0.8s ease-out;
}

/* Gallery Item */
.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: scale(1);
  cursor: pointer;
}

.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.gallery-item-inner {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.image-container,
.video-thumbnail,
.youtube-thumbnail {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}

/* Premium Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(30, 57, 47, 0) 0%,
    rgba(30, 57, 47, 0.7) 60%,
    rgba(30, 57, 47, 0.95) 100%
  );
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-info {
  transform: translateY(0);
}

.gallery-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.gallery-description {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Premium View Button */
.gallery-view-btn {
  background: linear-gradient(135deg, var(--muted-gold), var(--gold-accent));
  color: var(--deep-green-text);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(218, 165, 32, 0.4);
}

.gallery-view-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 24px rgba(218, 165, 32, 0.6);
}

.gallery-view-btn svg {
  width: 24px;
  height: 24px;
}

/* Premium Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: lightboxZoom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
}

.lightbox-close:hover {
  background: rgba(218, 165, 32, 0.9);
  border-color: var(--gold-accent);
  transform: rotate(90deg) scale(1.1);
}

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes lightboxZoom {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes heroGlow {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  
  .gallery-container {
    padding: 0 2rem;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    height: 30vh;
    min-height: 280px;
  }
  
  .gallery-hero-content {
    padding: 0 1.5rem;
  }
  
  .gallery-hero-title {
    font-size: 3rem;
    margin-bottom: 0.25rem;
    margin-top: 0;
  }
  
  .gallery-hero-subtitle {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 0;
  }
  
  .gallery-section {
    padding: 4rem 0;
  }
  
  .gallery-container {
    padding: 0 1.5rem;
  }
  
  .gallery-filters {
    gap: 0.75rem;
    margin-bottom: 3rem;
  }
  
  .filter-btn {
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .gallery-overlay {
    padding: 1.5rem;
  }
  
  .gallery-title {
    font-size: 1.3rem;
  }
  
  .gallery-description {
    font-size: 0.95rem;
  }
  
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .gallery-hero {
    height: 28vh;
    min-height: 250px;
  }
  
  .gallery-hero-content {
    padding: 0 1rem;
  }
  
  .gallery-hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.1rem;
    margin-top: 0;
  }
  
  .gallery-hero-subtitle {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0;
  }
  
  .gallery-filters {
    gap: 0.5rem;
  }
  
  .filter-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.85rem;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .gallery-overlay {
    padding: 1rem;
  }
  
  .gallery-title {
    font-size: 1.2rem;
  }
  
  .gallery-description {
    font-size: 0.9rem;
  }
  
  .gallery-view-btn {
    width: 40px;
    height: 40px;
  }
  
  .gallery-view-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-image,
  .gallery-overlay,
  .gallery-info,
  .filter-btn,
  .lightbox-modal {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
.filter-btn:focus,
.gallery-view-btn:focus,
.lightbox-close:focus {
  outline: 2px solid var(--muted-gold);
  outline-offset: 2px;
}

/* Video Thumbnail Styles */
.video-thumbnail {
  position: relative;
  display: inline-block;
  width: 100%;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.gallery-item:hover .video-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* YouTube Specific Styles */
.youtube-thumbnail {
  position: relative;
}

.youtube-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.youtube-play-icon svg {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.gallery-item:hover .youtube-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 0, 0, 0.9);
  color: white;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover .youtube-badge {
  opacity: 1;
}

.youtube-badge svg {
  width: 16px;
  height: 12px;
}

/* YouTube thumbnail fallback */
.youtube-thumbnail img {
  background: #f0f0f0;
  min-height: 200px;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzLjQ5OCA2LjE4NmEzLjAxNiAzLjAxNiAwIDAgMC0yLjEyMi0yLjEzNkMxOS41MDUgMy41NDUgMTIgMy41NDUgMTIgMy41NDVzLTcuNTA1IDAtOS4zNzcuNTA1QTMuMDE3IDMuMDE3IDAgMCAwIC41MDIgNi4xODZDMCA4LjA3IDAgMTIgMCAxMnMwIDMuOTMuNTAyIDUuODE0YTMuMDE2IDMuMDE2IDAgMCAwIDIuMTIyIDIuMTM2YzEuODcxLjUwNSA5LjM3Ni41MDUgOS4zNzYuNTA1czcuNTA1IDAgOS4zNzctLjUwNWEzLjAxNSAzLjAxNSAwIDAgMCAyLjEyMi0yLjEzNkMyNCAxNS45MyAyNCAxMiAyNCAxMnMwLTMuOTMtLjUwMi01LjgxNHpNOS41NDUgMTUuNTY4VjguNDMyTDE1LjgxOCAxMmwtNi4yNzMgMy41Njh6IiBmaWxsPSIjRkYwMDAwIi8+Cjwvc3ZnPgo=');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 48px 48px;
}

.youtube-thumbnail img[src*="youtube.com"] {
  object-fit: cover;
}

/* Show placeholder when image fails to load */
.youtube-thumbnail img[src*="youtube.com"]:not([src=""]) {
  background-image: none;
}

/* Ensure gallery items are clickable */
.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item:active {
  transform: translateY(-4px);
}

/* Lightbox Video Styles */
.lightbox-video {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
}

/* Lightbox YouTube Styles */
.lightbox-youtube-container {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-youtube {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .lightbox-youtube-container {
    width: 95vw;
    padding-bottom: 56.25%;
  }
}

/* No Items Message */
.no-items-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
  font-size: 1.2rem;
}

.no-items-message p {
  margin: 0;
  font-style: italic;
}

/* Enhanced Gallery Item Styles */
.gallery-item[data-type="video"] .gallery-image {
  position: relative;
}

.gallery-item[data-type="video"]::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  z-index: 3;
}

.gallery-item[data-type="video"]::before {
  content: '▶';
  position: absolute;
  top: 14px;
  right: 16px;
  color: white;
  font-size: 12px;
  z-index: 4;
}

/* Filter Button Enhancements */
.filter-btn {
  position: relative;
  overflow: hidden;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.filter-btn.active::after,
.filter-btn:hover::after {
  width: 100%;
}

/* Gallery Grid Responsive Enhancements */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .gallery-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .filter-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
  
  .video-play-icon svg {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-hero-title {
    font-size: 3rem;
  }
  
  .gallery-hero-subtitle {
    font-size: 1.1rem;
  }
}

/* Loading Animation for Gallery Items */
.gallery-item:not(.hidden) {
  animation: fadeInUp 0.6s ease-out forwards;
}

.gallery-item:not(.hidden):nth-child(1) { animation-delay: 0.1s; }
.gallery-item:not(.hidden):nth-child(2) { animation-delay: 0.2s; }
.gallery-item:not(.hidden):nth-child(3) { animation-delay: 0.3s; }
.gallery-item:not(.hidden):nth-child(4) { animation-delay: 0.4s; }
.gallery-item:not(.hidden):nth-child(5) { animation-delay: 0.5s; }
.gallery-item:not(.hidden):nth-child(6) { animation-delay: 0.6s; }
.gallery-item:not(.hidden):nth-child(7) { animation-delay: 0.7s; }
.gallery-item:not(.hidden):nth-child(8) { animation-delay: 0.8s; }

/* Enhanced Hover Effects */
.gallery-item-inner {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover .gallery-item-inner {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Category Badge */
.gallery-item::before {
  content: attr(data-category);
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(218, 165, 32, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::before {
  opacity: 1;
}