/**
 * Lightbox Styles
 * Based on the clean, minimal design from the provided screenshot
 */

/* Lightbox Container */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox--active {
  opacity: 1;
  visibility: visible;
}

/* Overlay */
.lightbox__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
}

/* Content Container */
.lightbox__content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Card wrapper for image */
.lightbox__main {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  max-height: 900px;
}

/* Header */
.lightbox__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.lightbox__counter {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: #666;
}

.lightbox__counter-text {
  color: #666;
}

/* Close Button */
.lightbox__close {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
  border-radius: 50%;
}

.lightbox__close:hover {
  color: #333;
  transform: scale(1.05);
}

.lightbox__close:focus {
  outline: none;
}

.lightbox__close:focus-visible {
  color: #333;
  transform: scale(1.05);
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

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

/* Media Container */
.lightbox__media-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* Image */
.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  opacity: 1;
  transition: opacity 0.25s ease-in-out;
}

/* Video Container */
.lightbox__video-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__video {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

/* Navigation Container */
.lightbox__nav-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Navigation Buttons */
.lightbox__nav {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  cursor: pointer;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
  flex-shrink: 0;
}

.lightbox__nav:hover {
  background: var(--color-blue-sky);
  border-color: var(--color-blue-sky);
  color: white;
  transform: scale(1.05);
}

.lightbox__nav:focus {
  outline: none;
}

.lightbox__nav:focus-visible {
  background: var(--color-blue-sky);
  color: white;
  outline: 2px solid var(--color-blue-sky);
  outline-offset: 2px;
  transform: scale(1.05);
}

.lightbox__nav:active {
  transform: scale(0.98);
}

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

/* Loader */
.lightbox__loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 10;
}

.lightbox__loader--active {
  display: block;
}

.lightbox__loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 102, 204, 0.2);
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .lightbox__content {
    padding: 1rem;
  }

  .lightbox__main {
    padding: 1.5rem;
    border-radius: 8px;
    gap: 1rem;
    width: 95vw;
    height: 80vh;
  }

  .lightbox__counter {
    font-size: 0.875rem;
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
    border-width: 1.5px;
  }

  .lightbox__nav svg {
    width: 20px;
    height: 20px;
  }

  .lightbox__nav-container {
    gap: 0.5rem;
  }

  .lightbox__video-container {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .lightbox__content {
    padding: 0.5rem;
  }

  .lightbox__main {
    padding: 1rem;
    gap: 0.75rem;
    width: 98vw;
    height: 75vh;
  }

  .lightbox__counter {
    font-size: 0.8rem;
  }

  .lightbox__close svg {
    width: 18px;
    height: 18px;
  }

  .lightbox__nav {
    width: 36px;
    height: 36px;
  }

  .lightbox__nav svg {
    width: 18px;
    height: 18px;
  }

  .lightbox__nav-container {
    gap: 0.4rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  .lightbox,
  .lightbox__image,
  .lightbox__nav,
  .lightbox__close {
    transition: none;
    animation: none;
  }

  .lightbox__loader-spinner {
    animation: none;
    border-top-color: transparent;
    border-right-color: #0066cc;
  }
}

/* Note: Focus-visible styles are defined inline above for each element */

/* Prevent text selection while navigating */
.lightbox {
  user-select: none;
  -webkit-user-select: none;
}