/* --- GALLERY MODAL --- */
.gallery-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal);
  padding: 1.5rem;
}

.gallery-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: translateY(30px) scale(0.95);
  transition: transform var(--duration-normal) var(--ease-out-expo);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.gallery-modal-overlay.active .gallery-modal {
  transform: translateY(0) scale(1);
}

.gallery-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: background 0.2s ease;
}

.gallery-modal__close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.gallery-modal__header {
  padding: 1.5rem 3rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

#gallery-modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.gallery-tabs {
  display: flex;
  gap: 1rem;
}

.gallery-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all var(--duration-fast);
}

.gallery-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.gallery-tab.active {
  background: var(--accent-primary);
  color: white;
}

.gallery-modal__content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

.gallery-content-view {
  display: none;
  width: 100%;
}

.gallery-content-view.active {
  display: block;
}

/* Image Carousel */
.gallery-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
}

.gallery-carousel-btn {
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(255,255,255,0.1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--duration-fast);
  flex-shrink: 0;
}

.gallery-carousel-btn:hover {
  background: var(--accent-primary);
}

.gallery-image-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
}

#gallery-image-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scrollbar-width: none;
  margin-bottom: 1.5rem;
}
#gallery-image-track::-webkit-scrollbar {
  display: none;
}
.gallery-slide-img {
  flex: 0 0 100%;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  scroll-snap-align: center;
  cursor: zoom-in;
}


.gallery-image-info {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.gallery-counter {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.gallery-desc {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .gallery-carousel {
    flex-direction: column;
    position: relative;
  }
  .gallery-carousel-btn {
    display: flex;
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    z-index: 10;
  }
  #gallery-btn-prev {
    left: 0;
  }
  #gallery-btn-next {
    right: 0;
  }
  .gallery-image-container {
    padding-bottom: 2rem;
    width: 100%;
  }
  .gallery-modal {
    max-height: 95vh;
  }
  .gallery-modal__header {
    padding: 1.5rem 3.5rem 1rem 1rem;
  }
  .gallery-modal__content {
    padding: 1rem;
  }
  #gallery-image-display {
    max-height: 50vh;
  }
}

/* Solution Card Hover Image (Fallback for No Video) */
.solution-card:hover .solution-hover-image {
  opacity: 1 !important;
}

/* If the card has no video, show the image permanently and hide the placeholder */
.solution-card[data-video-src=""] .solution-hover-image {
  opacity: 1 !important;
}

.solution-card[data-video-src=""] .solution-video-placeholder,
.solution-card[data-video-src=""] .play-overlay {
  display: none !important;
}

@media (max-width: 768px) {
  .solution-hover-image {
    opacity: 1 !important;
  }
}

.solution-card:hover .solution-hover-image ~ .solution-video-placeholder,
.solution-card:hover .solution-hover-image + .solution-video + .play-overlay + .solution-video-placeholder {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  .solution-hover-image ~ .solution-video-placeholder,
  .solution-hover-image + .solution-video + .play-overlay + .solution-video-placeholder {
    opacity: 0;
  }
}
