/* ============================================================
   VINSTA Lighting Visualizer — Ultra-Premium Cinematic UI
   ============================================================
   
   DESIGN TOKENS:
   ┌─ Radii ─────────────────────────────────────┐
   │  Scene container: 20px                      │
   │  Overlay panel:   16px                      │
   │  Controls pill:   100px (full-round)        │
   │  Toggle:          34px (rounded-full)       │
   │  Arrows:          50% (circle)              │
   │  Indicators:      50% (circle)              │
   ├─ Motion ────────────────────────────────────┤
   │  Scene swap:     600ms cubic-bezier         │
   │  Image crossfade: 500ms ease-in-out         │
   │  Toggle:         400ms cubic-bezier         │
   │  Overlay reveal: 500ms ease 300ms delay     │
   │  Arrow hover:    200ms ease-out             │
   │  Glow/bloom:     600ms ease-in-out          │
   └─────────────────────────────────────────────┘
   ============================================================ */


/* ══════════════════════════════════════════════════════════
   1. HERO SECTION — Premium bold header
   ══════════════════════════════════════════════════════════ */
.visualizer-hero {
    padding: 12rem 0 4rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.visualizer-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    line-height: 1.15;
}

/* Animated underline reveal */
.visualizer-hero h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    margin: 1.25rem auto 0;
    background: linear-gradient(90deg, var(--primary-neon), rgba(99, 102, 241, 0.6));
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    animation: underlineReveal 0.8s ease-out 0.3s forwards;
}

@keyframes underlineReveal {
    to {
        transform: scaleX(1);
    }
}

.visualizer-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
    opacity: 0.7;
}


/* ══════════════════════════════════════════════════════════
   2. MAIN SECTION — Full-width immersive background
   ══════════════════════════════════════════════════════════ */
.lighting-visualizer {
    padding: 0 0 8rem;
    position: relative;
    z-index: 5;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(15, 15, 30, 0.4) 0%, transparent 60%),
        transparent;
}


/* ══════════════════════════════════════════════════════════
   3. CAROUSEL CONTAINER
   ══════════════════════════════════════════════════════════ */
.visualizer-carousel-container {
    padding: 0 4rem;
    max-width: 1400px;
    margin: 3rem auto 0;
    position: relative;
}

.visualizer-carousel {
    position: relative;
    width: 100%;
    min-height: 700px;
    display: grid;
    grid-template-areas: "stack";
}


/* ══════════════════════════════════════════════════════════
   4. SCENE CARDS — Cinematic image containers
   ══════════════════════════════════════════════════════════ */
.visualizer-scene {
    grid-area: stack;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #0a0a14;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);

    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96) translateY(12px);
    z-index: 1;

    /* Scene transition — cinematic ease */
    transition:
        opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.visualizer-scene.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
    z-index: 2;
}


/* ── Image Container ───────────────────────────────────── */
.scene-image-container {
    position: relative;
    width: 100%;
    height: 700px;
    overflow: hidden;
}

/* Dual-image layer for cinematic crossfade */
.scene-image-container img.scene-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 500ms ease-in-out;
    will-change: opacity;
}

/* ON image (hidden by default, fades in) */
.scene-image-container img.scene-image-on {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 500ms ease-in-out;
    will-change: opacity;
    z-index: 1;
}

.visualizer-scene.lights-on .scene-image-container img.scene-image-on {
    opacity: 1;
}


/* ── Vignette overlay — fades when lights ON ────────────── */
.scene-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(ellipse at center,
            transparent 40%,
            rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
    transition: opacity 600ms ease-in-out;
}

.visualizer-scene.lights-on .scene-image-container::before {
    opacity: 0.3;
}


/* ── Bloom / warm glow when ON ──────────────────────────── */
.scene-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    background: radial-gradient(ellipse 70% 60% at 50% 45%,
            rgba(255, 220, 150, 0.15) 0%,
            rgba(255, 180, 100, 0.06) 40%,
            transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 600ms ease-in-out;
    mix-blend-mode: screen;
}

.visualizer-scene.lights-on .scene-image-container::after {
    opacity: 1;
}

/* Light-spill edge glow */
.visualizer-scene::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: transparent;
    z-index: 0;
    pointer-events: none;
    transition: box-shadow 600ms ease-in-out;
}

.visualizer-scene.lights-on::after {
    box-shadow:
        0 0 40px rgba(255, 200, 100, 0.08),
        0 0 80px rgba(255, 180, 80, 0.04);
}


/* ── Floating particles (subtle dust) ───────────────────── */
.scene-particles {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 800ms ease-in-out;
}

.visualizer-scene.lights-on .scene-particles {
    opacity: 1;
}

.scene-particles .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 230, 180, 0.5);
    border-radius: 50%;
    animation: floatParticle linear infinite;
    will-change: transform;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100%) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-20%) translateX(30px);
        opacity: 0;
    }
}


/* ══════════════════════════════════════════════════════════
   5. OVERLAY CONTENT — Glass info panel
   ══════════════════════════════════════════════════════════ */
.scene-overlay-content {
    position: absolute;
    bottom: 2.5rem;
    left: 2.5rem;
    z-index: 10;
    background: rgba(10, 10, 18, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 1.75rem 2.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 400px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Slide-up reveal */
    transform: translateY(20px);
    opacity: 0;
    transition:
        transform 500ms ease 300ms,
        opacity 500ms ease 300ms;
}

body.light-theme .scene-overlay-content {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(28px);
}

.visualizer-scene.active .scene-overlay-content {
    transform: translateY(0);
    opacity: 1;
}

.scene-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-neon);
    margin-bottom: 0.5rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.scene-overlay-content h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.scene-overlay-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    opacity: 0.7;
    line-height: 1.5;
}


/* ══════════════════════════════════════════════════════════
   6. CONTROLS — Premium pill toggle bar
   ══════════════════════════════════════════════════════════ */
.scene-controls {
    position: absolute;
    top: 2.5rem;
    right: 2.5rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(10, 10, 18, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Slide-down reveal */
    transform: translateY(-16px);
    opacity: 0;
    transition:
        transform 500ms ease 300ms,
        opacity 500ms ease 300ms;
}

body.light-theme .scene-controls {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(28px);
}

.visualizer-scene.active .scene-controls {
    transform: translateY(0);
    opacity: 1;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 300ms ease-in-out, text-shadow 300ms ease-in-out;
    opacity: 0.6;
}

.control-label.active {
    opacity: 1;
}

.visualizer-scene.lights-on .control-label.active {
    color: var(--primary-neon);
    text-shadow: 0 0 16px var(--primary-neon-glow);
}


/* ── Toggle Switch — Premium tactile feel ───────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition:
        background 400ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
        background 300ms ease,
        box-shadow 400ms ease;
}

input:checked+.slider {
    background: rgba(0, 243, 255, 0.12);
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.12);
}

input:checked+.slider::before {
    transform: translateX(26px);
    background: var(--primary-neon);
    box-shadow:
        0 0 12px var(--primary-neon-glow),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

body.light-theme .slider {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .slider::before {
    background: rgba(0, 0, 0, 0.25);
}

body.light-theme input:checked+.slider {
    background: rgba(0, 200, 213, 0.12);
}

body.light-theme input:checked+.slider::before {
    background: var(--primary-neon);
}


/* ══════════════════════════════════════════════════════════
   7. NAVIGATION ARROWS — Minimal elegant
   ══════════════════════════════════════════════════════════ */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(10, 10, 18, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 200ms ease-out,
        color 200ms ease-out,
        box-shadow 200ms ease-out,
        transform 200ms ease-out;
}

.nav-arrow:hover {
    background: rgba(0, 243, 255, 0.12);
    color: var(--primary-neon);
    box-shadow: 0 0 24px rgba(0, 243, 255, 0.15);
    transform: translateY(-50%) scale(1.08);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow:disabled {
    opacity: 0.2;
    pointer-events: none;
    filter: grayscale(1);
}

.nav-arrow i,
.nav-arrow svg {
    width: 20px;
    height: 20px;
}

.prev-arrow {
    left: -16px;
}

.next-arrow {
    right: -16px;
}

body.light-theme .nav-arrow {
    background: rgba(255, 255, 255, 0.7);
    color: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .nav-arrow:hover {
    background: rgba(0, 200, 213, 0.1);
    color: var(--primary-neon);
}


/* ══════════════════════════════════════════════════════════
   8. INDICATORS — Minimal dots with active label
   ══════════════════════════════════════════════════════════ */
.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    cursor: pointer;
    padding: 0;
    transition:
        background 300ms ease,
        transform 300ms ease,
        box-shadow 300ms ease,
        width 300ms ease;
}

.indicator.active {
    width: 28px;
    border-radius: 10px;
    background: var(--primary-neon);
    box-shadow: 0 0 12px var(--primary-neon-glow);
}

.indicator:hover:not(.active) {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.2);
}

body.light-theme .indicator {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .indicator:hover:not(.active) {
    background: rgba(0, 0, 0, 0.2);
}

/* Scene label under indicators */
.scene-label {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: opacity 300ms ease;
    min-height: 1.2em;
}


/* ══════════════════════════════════════════════════════════
   9. CTA SECTION
   ══════════════════════════════════════════════════════════ */
.cta-section {
    text-align: center;
}


/* ══════════════════════════════════════════════════════════
   10. RESPONSIVE — Tablet
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
    .visualizer-carousel-container {
        max-width: 92%;
        padding: 0 3rem;
    }
}


/* ══════════════════════════════════════════════════════════
   11. RESPONSIVE — Mobile
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

    /* Hero */
    .visualizer-hero {
        padding: 8rem 1rem 2rem;
    }

    .visualizer-hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Section */
    .lighting-visualizer {
        padding: 0 0 4rem;
    }

    /* Container */
    .visualizer-carousel-container {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 0;
        margin-top: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .visualizer-carousel {
        width: 100%;
        min-height: auto;
    }

    /* Scene */
    .visualizer-scene {
        display: flex;
        flex-direction: column;
        height: auto;
        border-radius: 0;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    }

    /* Image — immersive tall */
    .scene-image-container {
        position: relative;
        width: 100%;
        height: 60vh;
        max-height: 550px;
    }

    /* Overlay — below image on mobile */
    .scene-overlay-content {
        position: static;
        transform: none;
        opacity: 1;
        width: 100%;
        max-width: none;
        padding: 1.25rem 1.5rem;
        background: var(--bg-secondary);
        backdrop-filter: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        text-align: center;
    }

    .scene-overlay-content h3 {
        font-size: 1.5rem;
    }

    .visualizer-scene.active .scene-overlay-content {
        transform: none;
    }

    /* Controls — bottom of card */
    .scene-controls {
        position: static;
        transform: none;
        opacity: 1;
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 0.75rem 1.25rem;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: none;
        backdrop-filter: none;
    }

    .visualizer-scene.active .scene-controls {
        transform: none;
    }

    /* Toggle — larger for touch */
    .toggle-switch {
        width: 72px;
        height: 38px;
    }

    .slider {
        border-radius: 38px;
    }

    .slider::before {
        width: 30px;
        height: 30px;
        bottom: 3px;
        left: 4px;
    }

    input:checked+.slider::before {
        transform: translateX(34px);
    }

    /* Arrows — floating on image */
    .nav-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(8px);
        z-index: 100;
        opacity: 0.8;
    }

    .prev-arrow {
        left: 12px;
    }

    .next-arrow {
        right: 12px;
    }

    .nav-arrow:active {
        transform: translateY(-50%) scale(0.92);
        background: var(--primary-neon);
        color: #000;
        opacity: 1;
    }

    /* Particles hidden on mobile for perf */
    .scene-particles {
        display: none;
    }

    /* Faster transitions */
    .visualizer-scene {
        transition-duration: 350ms !important;
    }

    .scene-overlay-content,
    .scene-controls {
        transition-delay: 0ms !important;
    }
}

@media (max-width: 480px) {
    .visualizer-hero h1 {
        font-size: 1.75rem;
    }

    .scene-image-container {
        height: 50vh;
    }

    .scene-overlay-content h3 {
        font-size: 1.3rem;
    }

    .scene-controls {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .control-label {
        font-size: 0.65rem;
    }
}


/* ══════════════════════════════════════════════════════════
   12. REDUCED MOTION
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .visualizer-hero h1::after {
        animation: none;
        transform: scaleX(1);
    }

    .scene-particles {
        display: none;
    }

    .visualizer-scene,
    .scene-image-container img,
    .scene-image-container::before,
    .scene-image-container::after,
    .scene-overlay-content,
    .scene-controls,
    .slider,
    .slider::before,
    .nav-arrow,
    .indicator {
        transition-duration: 0.01ms !important;
    }
}