/**
 * Nutec Slideshow v2.0
 */

.nutec-slideshow {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: transparent;
  max-height: var(--nutec-auto-max-height, 90vh);
  --transition-speed: 0.6s;
  --transition-easing: ease;
  --image-scale: 1;
  --image-max-width: none;
  --image-max-height: none;
  --zoom-start: 0.9;
  --zoom-end: 1;
}

.nutec-slideshow__container {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: inherit;
}

.nutec-slideshow__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nutec-slideshow__slide:first-child {
  position: relative;
}

.nutec-slideshow__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: scale(var(--image-scale, 1));
  max-width: var(--image-max-width, none);
  max-height: var(--image-max-height, none);
}

/* Zoom Animation */
.has-zoom .nutec-slideshow__slide img {
  transform: scale(calc(var(--image-scale, 1) * var(--zoom-start, 0.9)));
  transition: transform 8s ease-out;
}

.has-zoom .nutec-slideshow__slide.is-active img {
  transform: scale(calc(var(--image-scale, 1) * var(--zoom-end, 1)));
}

/* Image Fit Options */
.fit-contain .nutec-slideshow__slide img {
  object-fit: contain;
}

.fit-cover .nutec-slideshow__slide img {
  object-fit: cover;
}

.fit-fill .nutec-slideshow__slide img {
  object-fit: fill;
}

.fit-none .nutec-slideshow__slide img {
  object-fit: none;
  width: auto;
  height: auto;
}

/* Vertical Position - Using Flexbox */
.position-top .nutec-slideshow__slide {
  align-items: flex-start;
}

.position-center .nutec-slideshow__slide {
  align-items: center;
}

.position-bottom .nutec-slideshow__slide {
  align-items: flex-end;
}

/* Links */
.nutec-slideshow__link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Captions */
.nutec-slideshow__caption {
  position: absolute;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nutec-slideshow__slide.is-active .nutec-slideshow__caption {
  opacity: 1;
}

.caption-bottom .nutec-slideshow__caption {
  bottom: 0;
}

.caption-top .nutec-slideshow__caption {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.caption-overlay .nutec-slideshow__caption {
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  text-align: center;
}

.nutec-slideshow__slide.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

/* Transitions */
.transition-fade .nutec-slideshow__slide {
  transition: opacity 0.6s ease;
}

.transition-slide-left .nutec-slideshow__slide {
  transform: translateX(100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-slide-left .nutec-slideshow__slide.is-active {
  transform: translateX(0);
}

.transition-slide-right .nutec-slideshow__slide {
  transform: translateX(-100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-slide-right .nutec-slideshow__slide.is-active {
  transform: translateX(0);
}

.transition-slide-up .nutec-slideshow__slide {
  transform: translateY(100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-slide-up .nutec-slideshow__slide.is-active {
  transform: translateY(0);
}

.transition-slide-down .nutec-slideshow__slide {
  transform: translateY(-100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-slide-down .nutec-slideshow__slide.is-active {
  transform: translateY(0);
}

.transition-zoom-in .nutec-slideshow__slide {
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-zoom-in .nutec-slideshow__slide.is-active {
  transform: scale(1);
}

.transition-zoom-out .nutec-slideshow__slide {
  transform: scale(1.2);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-zoom-out .nutec-slideshow__slide.is-active {
  transform: scale(1);
}

.transition-blur .nutec-slideshow__slide {
  filter: blur(20px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}

.transition-blur .nutec-slideshow__slide.is-active {
  filter: blur(0);
}

.transition-flip .nutec-slideshow__slide {
  transform: perspective(1000px) rotateY(90deg);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-flip .nutec-slideshow__slide.is-active {
  transform: perspective(1000px) rotateY(0);
}

.transition-flip-vertical .nutec-slideshow__slide {
  transform: perspective(1000px) rotateX(90deg);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-flip-vertical .nutec-slideshow__slide.is-active {
  transform: perspective(1000px) rotateX(0);
}

.transition-cube .nutec-slideshow__slide {
  transform: perspective(1200px) rotateY(-90deg) translateZ(50%);
  transform-origin: right center;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.transition-cube .nutec-slideshow__slide.is-active {
  transform: perspective(1200px) rotateY(0) translateZ(0);
}

.transition-rotate .nutec-slideshow__slide {
  transform: rotate(180deg) scale(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.transition-rotate .nutec-slideshow__slide.is-active {
  transform: rotate(0) scale(1);
}

.transition-ken-burns .nutec-slideshow__slide {
  transform: scale(1);
  transition: opacity 0.6s ease, transform 8s ease-out;
}

.transition-ken-burns .nutec-slideshow__slide.is-active {
  transform: scale(1.15);
}

.transition-ken-burns .nutec-slideshow__slide img {
  transform-origin: center center;
}

/* Arrows */
.nutec-slideshow__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
  opacity: 0;
}

.nutec-slideshow:hover .nutec-slideshow__arrow {
  opacity: 1;
}

.nutec-slideshow__arrow:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

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

.nutec-slideshow__arrow--prev {
  left: 20px;
}

.nutec-slideshow__arrow--next {
  right: 20px;
}

/* Control Button */
.nutec-slideshow__control {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.nutec-slideshow__control:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.nutec-slideshow__control-play,
.nutec-slideshow__control-pause {
  width: 24px;
  height: 24px;
}

.nutec-slideshow__control-pause {
  display: none;
}

.nutec-slideshow__control.is-playing .nutec-slideshow__control-play {
  display: none;
}

.nutec-slideshow__control.is-playing .nutec-slideshow__control-pause {
  display: block;
}

/* Dots */
.nutec-slideshow__dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}

.nutec-slideshow__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  padding: 0;
}

.nutec-slideshow__dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.nutec-slideshow__dot.is-active {
  background: white;
  transform: scale(1.3);
}

/* Single Image */
.nutec-slideshow-single {
  width: 100%;
  display: block;
  background: transparent;
  max-height: var(--nutec-auto-max-height, 90vh);
}

.nutec-slideshow-single img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Responsive */
@media (max-width: 768px) {
  .nutec-slideshow__arrow {
    width: 40px;
    height: 40px;
  }

  .nutec-slideshow__arrow--prev {
    left: 10px;
  }

  .nutec-slideshow__arrow--next {
    right: 10px;
  }

  .nutec-slideshow__control {
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
  }

  .nutec-slideshow__dots {
    bottom: 10px;
  }

  .nutec-slideshow__dot {
    width: 10px;
    height: 10px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .nutec-slideshow__slide {
    transition: opacity 0.3s ease !important;
    transform: none !important;
  }
}

/* Focus styles */
.nutec-slideshow__arrow:focus,
.nutec-slideshow__control:focus,
.nutec-slideshow__dot:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Lightbox */
.nutec-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.nutec-lightbox__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.nutec-lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

.nutec-lightbox__content img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.nutec-lightbox__close {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.2s ease;
}

.nutec-lightbox__close:hover {
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
