/**
 * ==============================================================================
 * SADRA VISUALS — ARTBOOK PHOTOGRAPHY GALLERY & STUDIO CMS
 * SECTION 1.5: CINEMATIC AMBIENT SLIDESHOW ENGINE STYLES
 * ==============================================================================
 */

/* 1. Backdrop & Fullscreen Stage */
.slideshow-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #030407;
    z-index: var(--z-slideshow, 10800);
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.slideshow-backdrop.is-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.slideshow-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 2. Dual Slide Canvas (Cross-fading with Ken Burns Motion) */
.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.2s;
    will-change: transform, opacity;
}

.slideshow-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.slideshow-slide.is-previous {
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

.slideshow-img {
    max-width: 96vw;
    max-height: 92vh;
    max-height: 92dvh;
    object-fit: contain;
    border-radius: var(--radius-sm, 6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 0, 0, 0.7);
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 3. Ken Burns Dynamic Zoom & Pan Animations */
@keyframes kenBurnsZoomIn {
    0% {
        transform: scale(1.0);
    }
    100% {
        transform: scale(1.08);
    }
}

@keyframes kenBurnsZoomOut {
    0% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1.0);
    }
}

@keyframes kenBurnsPanLeft {
    0% {
        transform: scale(1.05) translate(1.5%, 0);
    }
    100% {
        transform: scale(1.05) translate(-1.5%, 0);
    }
}

@keyframes kenBurnsPanRight {
    0% {
        transform: scale(1.05) translate(-1.5%, 0);
    }
    100% {
        transform: scale(1.05) translate(1.5%, 0);
    }
}

.slideshow-slide.is-active.kb-zoom-in .slideshow-img {
    animation: kenBurnsZoomIn var(--slideshow-pace, 5s) cubic-bezier(0.2, 0, 0.4, 1) forwards;
}

.slideshow-slide.is-active.kb-zoom-out .slideshow-img {
    animation: kenBurnsZoomOut var(--slideshow-pace, 5s) cubic-bezier(0.2, 0, 0.4, 1) forwards;
}

.slideshow-slide.is-active.kb-pan-left .slideshow-img {
    animation: kenBurnsPanLeft var(--slideshow-pace, 5s) cubic-bezier(0.2, 0, 0.4, 1) forwards;
}

.slideshow-slide.is-active.kb-pan-right .slideshow-img {
    animation: kenBurnsPanRight var(--slideshow-pace, 5s) cubic-bezier(0.2, 0, 0.4, 1) forwards;
}

.slideshow-backdrop.is-paused .slideshow-img {
    animation-play-state: paused !important;
}

/* 4. Top Progress Bar Rail */
.slideshow-progress-rail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 10820;
}

.slideshow-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
    transform-origin: left center;
}

.slideshow-progress-bar.is-animating {
    transition: width var(--slideshow-pace, 5s) linear;
    width: 100%;
}

.slideshow-backdrop.is-paused .slideshow-progress-bar {
    transition: none !important;
}

/* 5. Ambient HUD Controls (Top Bar & Bottom Specs) */
.slideshow-hud {
    position: absolute;
    z-index: 10815;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
    pointer-events: auto;
}

.slideshow-backdrop.hud-hidden .slideshow-hud {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Top HUD Bar */
.slideshow-top-bar {
    top: 16px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.slideshow-top-bar > * {
    pointer-events: auto;
}

.slideshow-meta-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(10, 14, 24, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-width: 60%;
}

.slideshow-counter {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    white-space: nowrap;
}

.slideshow-title {
    font-size: 14px;
    font-weight: 500;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slideshow-genre-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    white-space: nowrap;
}

/* Controls Tray */
.slideshow-controls-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: rgba(10, 14, 24, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Pacing Segmented Selector */
.slideshow-pacing-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill, 9999px);
    padding: 2px;
}

.slideshow-pacing-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    min-height: 34px;
    border-radius: var(--radius-pill, 9999px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slideshow-pacing-btn:hover {
    color: #f1f5f9;
}

.slideshow-pacing-btn.is-active {
    background: #38bdf8;
    color: #030407;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
}

/* Action Buttons (Tap targets >= 44px, matching floating lightbox UI) */
.slideshow-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 22, 34, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary, #f8fafc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.18s ease,
                border-color 0.18s ease,
                color 0.18s ease,
                box-shadow 0.18s ease;
    padding: 0;
}

.slideshow-btn:hover {
    background: rgba(28, 35, 54, 0.9);
    color: var(--accent-gold, #d4af37);
    border-color: var(--accent-gold, #d4af37);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.28);
    transform: translateY(-2px) scale(1.06);
}

.slideshow-btn:active {
    transform: scale(0.95);
}

.slideshow-btn:focus-visible {
    outline: 2px solid var(--accent-gold, #d4af37);
    outline-offset: 2px;
}

.slideshow-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: opacity 0.2s ease;
}

.slideshow-btn.is-muted {
    color: #94a3b8;
    background: rgba(18, 22, 34, 0.45);
    border-color: rgba(255, 255, 255, 0.08);
}

.slideshow-btn.is-muted svg {
    opacity: 0.5;
}

.slideshow-btn-close {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.slideshow-btn-close:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.6);
}

/* Nav Arrows */
.slideshow-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(10, 14, 24, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10810;
}

.slideshow-nav-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
    transform: translateY(-50%) scale(1.08);
}

.slideshow-nav-prev {
    left: 20px;
}

.slideshow-nav-next {
    right: 20px;
}

.slideshow-nav-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Bottom Technical Specs Pill */
.slideshow-bottom-bar {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    background: rgba(10, 14, 24, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    font-size: 13px;
    color: #94a3b8;
}

.slideshow-camera-spec {
    color: #cbd5e1;
    font-weight: 500;
}

.slideshow-exposure-spec {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    color: #38bdf8;
    font-size: 12px;
}

/* Sound notification toast */
.slideshow-toast {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 8px 16px;
    background: rgba(10, 14, 24, 0.9);
    border: 1px solid #38bdf8;
    color: #f1f5f9;
    border-radius: var(--radius-pill, 9999px);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10830;
}

.slideshow-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 6. Mobile Responsiveness (< 768px and < 480px) */
@media (max-width: 768px) {
    .slideshow-top-bar {
        top: 12px;
        left: 12px;
        right: 12px;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .slideshow-meta-pill {
        max-width: 100%;
        justify-content: space-between;
        padding: 6px 12px;
    }

    .slideshow-controls-tray {
        justify-content: space-between;
        width: 100%;
    }

    .slideshow-pacing-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .slideshow-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .slideshow-nav-btn {
        width: 44px;
        height: 44px;
        background: rgba(10, 14, 24, 0.4);
    }

    .slideshow-nav-prev {
        left: 8px;
    }

    .slideshow-nav-next {
        right: 8px;
    }

    .slideshow-bottom-bar {
        bottom: 12px;
        padding: 6px 14px;
        font-size: 12px;
    }

    .slideshow-img {
        max-width: 98vw;
        max-height: 85vh;
        max-height: 85dvh;
    }
}

@media (max-width: 480px) {
    .slideshow-genre-tag {
        display: none;
    }

    .slideshow-exposure-spec {
        display: none;
    }
}
