/* Background Slideshow Styles */
.slideshow-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #000;
}

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.slideshow-slide.active {
    opacity: 1;
}

.slideshow-slide img,
.slideshow-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
}

/* Special handling for slideshow background images only */
.slideshow-background .slideshow-slide img {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute;
    top: 0;
    left: 0;
}

/* Ensure product images are NOT affected by slideshow styles */
.product-image,
.product-image-container img,
.slideshow-container img,
.slideshow-slide img:not(.slideshow-background .slideshow-slide img) {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

/* Overlay gradient for better text readability */
.slideshow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 1;
}

/* Dark mode overlay */
body[data-theme="dark"] .slideshow-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

/* Animation effects */
.slideshow-slide.fade-in {
    animation: fadeIn 2s ease-in-out;
}

.slideshow-slide.fade-out {
    animation: fadeOut 2s ease-in-out;
}

.slideshow-slide.zoom {
    animation: zoomEffect 8s ease-in-out infinite alternate;
}

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

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

@keyframes zoomEffect {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Ken Burns effect - subtle pan and zoom */
.slideshow-slide.ken-burns {
    animation: kenBurns 15s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1) translateX(0);
    }
    50% {
        transform: scale(1.15) translateX(-3%);
    }
    100% {
        transform: scale(1) translateX(0);
    }
}

/* Slide from right */
.slideshow-slide.slide-right {
    animation: slideRight 2s ease-out;
}

@keyframes slideRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading indicator */
.slideshow-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    z-index: 10;
}

/* Slideshow controls - hidden by default, positioned at bottom center */
.slideshow-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: none; /* Hidden by default */
    gap: 10px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

/* Show controls on desktop when hovering over slideshow */
@media (min-width: 769px) {
    .slideshow-background:hover .slideshow-controls {
        display: flex;
    }
}

.slideshow-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slideshow-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.slideshow-control-btn svg {
    width: 20px;
    height: 20px;
}

/* Progress indicator */
.slideshow-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 49;
}

.slideshow-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3FA34D, #C5E384);
    width: 0%;
    transition: width 0.3s ease;
}

/* Mobile optimization */
@media (max-width: 768px) {
    /* Hide slideshow controls on mobile to avoid disturbing users */
    .slideshow-controls {
        display: none !important;
    }
    
    /* Disable animations on mobile for better performance */
    .slideshow-slide.zoom,
    .slideshow-slide.ken-burns {
        animation: none;
    }
}

/* Preload hint */
.slideshow-slide img,
.slideshow-slide video {
    image-rendering: -webkit-optimize-contrast;
}

