/* ========================================
   LIGHTBOX / CARROUSEL
   ======================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  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.active {
  opacity: 1;
  visibility: visible;
}

/* Backdrop */
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Container */
.lightbox__container {
  position: relative;
  z-index: 2;
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active .lightbox__container {
  transform: scale(1) translateY(0);
}

/* Close Button */
.lightbox__close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox__close svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-width: 2;
}

/* Image Wrapper */
.lightbox__image-wrapper {
  position: relative;
  width: 100%;
  height: calc(100% - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox__image.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Loading Spinner */
.lightbox__loader {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary, #0ea5e9);
  border-radius: 50%;
  animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}

/* Navigation Arrows */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-50%) scale(1.1);
}

.lightbox__nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox__nav--prev {
  left: -80px;
}

.lightbox__nav--next {
  right: -80px;
}

.lightbox__nav svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-width: 2;
}

/* Caption */
.lightbox__caption {
  margin-top: 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.lightbox.active .lightbox__caption {
  opacity: 1;
  transform: translateY(0);
}

.lightbox__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin: 0 0 4px 0;
}

.lightbox__subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Dots / Counter */
.lightbox__counter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.lightbox__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.lightbox__dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.lightbox__dot.active {
  background: var(--accent-primary, #0ea5e9);
  transform: scale(1.2);
}

/* Counter Text */
.lightbox__count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* Body Lock */
body.lightbox-open {
  overflow: hidden;
}

/* ========================================
   PHOTO GALLERY - Enhanced hover
   ======================================== */

.photo-gallery__item {
  cursor: pointer;
}

.photo-gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(14, 165, 233, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

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

/* Zoom icon on hover */
.photo-gallery__item .photo-gallery__overlay::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
}

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

/* ========================================
   GALLERY ITEMS - Same lightbox support
   ======================================== */

.gallery__item {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg, 12px);
}

.gallery__item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.gallery__item:hover::before {
  background: rgba(0, 0, 0, 0.3);
}

/* Zoom icon on hover for gallery items */
.gallery__item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px;
}

.gallery__item:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
  .lightbox__nav--prev {
    left: 20px;
  }
  
  .lightbox__nav--next {
    right: 20px;
  }
}

@media (max-width: 768px) {
  .lightbox__container {
    width: 95vw;
    height: 80vh;
  }
  
  .lightbox__close {
    top: -60px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
  
  .lightbox__nav {
    width: 44px;
    height: 44px;
  }
  
  .lightbox__nav--prev {
    left: 10px;
  }
  
  .lightbox__nav--next {
    right: 10px;
  }
  
  .lightbox__title {
    font-size: 1.1rem;
  }
  
  .lightbox__subtitle {
    font-size: 0.85rem;
  }
  
  .lightbox__counter {
    gap: 6px;
  }
  
  .lightbox__dot {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 480px) {
  .lightbox__container {
    height: 75vh;
  }
  
  .lightbox__image-wrapper {
    height: calc(100% - 80px);
  }
  
  .lightbox__caption {
    margin-top: 16px;
  }
  
  .lightbox__title {
    font-size: 1rem;
  }
}
