/* ============================================
   LIGHTBOX STYLES
   Beautiful Image Viewer with Navigation
   ============================================ */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

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

/* Close Button */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 10001;
}

.lightbox-close svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-white);
}

.lightbox-close:hover {
  background: var(--color-accent-orange);
  border-color: var(--color-accent-orange);
  transform: rotate(90deg);
}

/* Navigation Buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 10001;
}

.lightbox-nav svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-white);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav:hover {
  background: var(--color-accent-orange);
  border-color: var(--color-accent-orange);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-nav:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

/* Content Container */
.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

/* Image */
.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease-in-out;
}

/* Caption */
.lightbox-caption {
  text-align: center;
  color: var(--color-white);
  max-width: 600px;
}

.lightbox-caption h3 {
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-white);
}

.lightbox-caption p {
  font-size: var(--font-size-body);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-md);
}

/* Counter */
.lightbox-counter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
}

.lightbox-counter span {
  color: var(--color-accent-orange);
}

/* Loading Spinner */
.lightbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-loading .spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-accent-orange);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

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

/* Tablet */
@media (max-width: 991px) {
  .lightbox-content {
    max-width: 95%;
  }

  .lightbox-content img {
    max-height: 70vh;
  }

  .lightbox-nav {
    width: 50px;
    height: 50px;
  }

  .lightbox-nav svg {
    width: 24px;
    height: 24px;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }

  .lightbox-close svg {
    width: 20px;
    height: 20px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
    bottom: 20px;
    top: auto;
    transform: none;
  }

  .lightbox-nav svg {
    width: 20px;
    height: 20px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-nav:hover {
    transform: scale(1.1);
  }

  .lightbox-content {
    max-width: 100%;
    padding: 0 var(--space-md);
  }

  .lightbox-content img {
    max-height: 60vh;
    border-radius: var(--border-radius-md);
  }

  .lightbox-caption {
    padding: 0 var(--space-md);
  }

  .lightbox-caption h3 {
    font-size: var(--font-size-h5);
  }

  .lightbox-caption p {
    font-size: var(--font-size-body-small);
  }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
  .lightbox-content img {
    max-height: 50vh;
  }
}

/* ===== ANIMATION KEYFRAMES ===== */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== ACCESSIBILITY ===== */
.lightbox:focus-visible {
  outline: 2px solid var(--color-accent-orange);
  outline-offset: 2px;
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}
