/* Lightbox Styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.lightbox.active {
  opacity: 1;
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lightbox-image.loaded {
  opacity: 1;
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 1rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox.active .lightbox-caption {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 30px;
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.7;
  z-index: 10;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

/* Loading Indicator */
.lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  z-index: 5;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Counter */
.lightbox-counter {
  position: absolute;
  bottom: -30px;
  left: 0;
  color: white;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Fullscreen button */
.lightbox-fullscreen {
  position: absolute;
  top: -40px;
  right: 50px;
  color: white;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.lightbox-fullscreen:hover {
  opacity: 1;
}

/* Download button */
.lightbox-download {
  position: absolute;
  top: -40px;
  right: 100px;
  color: white;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.lightbox-download:hover {
  opacity: 1;
}

/* Video container */
.lightbox-video {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: none;
}

.lightbox-video.active {
  display: block;
}

.lightbox-video iframe {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
}

/* Thumbnails navigation */
.lightbox-thumbnails {
  position: absolute;
  bottom: -80px;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 0;
}

.lightbox-thumbnail {
  width: 60px;
  height: 40px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.lightbox-thumbnail:hover {
  opacity: 1;
}

.lightbox-thumbnail.active {
  border-color: var(--primary-color);
  opacity: 1;
}

/* Zoom controls */
.lightbox-zoom-controls {
  position: absolute;
  bottom: -30px;
  right: 0;
  display: flex;
  gap: 10px;
}

.lightbox-zoom-in,
.lightbox-zoom-out,
.lightbox-zoom-reset {
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.lightbox-zoom-in:hover,
.lightbox-zoom-out:hover,
.lightbox-zoom-reset:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

/* Testimonial Slider Navigation */
.testimonial-slider {
  position: relative;
  padding: 0 40px;
}

.testimonial-slide {
  background: var(--background-alt);
  border-radius: var(--border-radius);
  padding: 30px;
  margin: 20px 0;
  box-shadow: var(--box-shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-slide.active {
  opacity: 1;
  transform: translateY(0);
}

.testimonial-prev,
.testimonial-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.testimonial-prev:hover,
.testimonial-next:hover {
  background: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.testimonial-prev {
  left: 0;
}

.testimonial-next {
  right: 0;
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.testimonial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.testimonial-dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* Swipe gesture support */
.lightbox-content.swiping {
  transition: transform 0s;
}

/* Keyboard navigation hints */
.keyboard-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 9999;
}

.keyboard-hint.visible {
  opacity: 1;
}

.keyboard-hint span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 3px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .lightbox-prev {
    left: 20px;
  }

  .lightbox-next {
    right: 20px;
  }

  .lightbox-thumbnails {
    bottom: -70px;
  }
}

@media (max-width: 992px) {
  .lightbox-content {
    max-width: 95%;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 30px;
  }

  .lightbox-fullscreen,
  .lightbox-download {
    display: none;
  }

  .testimonial-slider {
    padding: 0 30px;
  }
}

@media (max-width: 768px) {
  .lightbox-image {
    max-height: 70vh;
  }

  .lightbox-caption {
    padding: 10px;
    font-size: 0.9rem;
  }

  .lightbox-thumbnails {
    display: none;
  }

  .lightbox-counter {
    bottom: -25px;
  }

  .lightbox-zoom-controls {
    display: none;
  }

  .testimonial-prev,
  .testimonial-next {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 576px) {
  .lightbox-content {
    max-width: 100%;
    margin: 0 10px;
  }

  .lightbox-image {
    max-height: 60vh;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 35px;
    height: 35px;
    font-size: 25px;
    opacity: 0.5;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: -35px;
    right: 0;
    font-size: 25px;
  }

  .testimonial-slide {
    padding: 20px 15px;
  }

  .testimonial-prev,
  .testimonial-next {
    width: 30px;
    height: 30px;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .lightbox-prev,
  .lightbox-next {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.5);
  }

  .lightbox-close {
    opacity: 0.9;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Accessibility focus styles */
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-fullscreen:focus,
.lightbox-download:focus,
.lightbox-zoom-in:focus,
.lightbox-zoom-out:focus,
.lightbox-zoom-reset:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .lightbox {
    background: white !important;
    position: relative;
    display: block !important;
    overflow: visible;
  }

  .lightbox-content {
    transform: none !important;
  }

  .lightbox-image {
    max-height: none;
    box-shadow: none;
  }

  .lightbox-caption {
    color: black;
  }

  .lightbox-close,
  .lightbox-prev,
  .lightbox-next,
  .lightbox-fullscreen,
  .lightbox-download,
  .lightbox-zoom-controls,
  .lightbox-thumbnails,
  .lightbox-counter {
    display: none !important;
  }
}
