﻿/* ========================================
    DESKTOP-ONLY CSS (1024px and above)
    Carousel/Exhibit Gallery View with Thumbnails
======================================== */
@media (min-width: 1024px) {
    /* Desktop Section Container */
    .howscreen-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        position: relative;
        z-index: 20;
        min-height: 100vh;
        height: 100vh;
        max-height: 100vh;
        box-sizing: border-box;
        padding: 0 1.2rem 0.5rem;
        background: var(--bg-light);
        overflow: hidden;
    }

    /* Section Header */
    .howscreen-header {
        text-align: center;
        margin-bottom: 0;
        padding-top: 0;
        width: 100%;
        flex-shrink: 0;
    }

    .howscreen-title {
        font-size: clamp(1.6rem, 2.8vw, 2.4rem);
        font-weight: 700;
        color: var(--eco-green);
        margin: 0 0 0.35rem 0;
        letter-spacing: -0.5px;
        line-height: 1.15;
        text-align: center;
        position: relative;
    }

    .howscreen-container {
        width: 100%;
        max-width: 1400px;
        display: grid;
        grid-template-columns:
            minmax(140px, clamp(150px, 14.5vw, 210px))
            minmax(0, 1fr)
            minmax(140px, clamp(150px, 14.5vw, 210px));
        grid-template-areas:
            "left video right";
        grid-template-rows: minmax(0, 1fr);
        align-items: center;
        justify-content: center;
        column-gap: clamp(0.8rem, 1.3vw, 1.4rem);
        row-gap: 0;
        flex: 1 1 auto;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .howscreen-flow {
        width: 100%;
        margin: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: clamp(0.6rem, 1.1vh, 0.95rem);
        overflow: visible;
        padding: 0;
        align-items: stretch;
        align-content: center;
        justify-items: stretch;
        flex-shrink: 0;
    }

    .howscreen-flow-left {
        grid-area: left;
    }

    .howscreen-flow-right {
        grid-area: right;
    }

    .howscreen-flow .howscreen-thumbnail-item {
        min-width: 0;
        flex: initial;
        position: relative;
        width: 100%;
    }

    /* Thumbnail Item Container */
    .howscreen-thumbnail-item {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        flex: 0 0 auto;
        text-align: center;
    }

    .howscreen-thumbnail-title {
        font-size: clamp(0.76rem, 1vw, 0.95rem);
        font-weight: 700;
        color: var(--eco-green);
        margin: 0;
        letter-spacing: -0.3px;
        line-height: 1.1;
    }

    /* Thumbnail */
    .howscreen-thumbnail {
        position: relative;
        width: 100%;
        aspect-ratio: 16/9;
        border-radius: clamp(7px, 0.7vw, 10px);
        overflow: hidden;
        cursor: pointer;
        border: 2px solid transparent;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

    .howscreen-thumbnail:hover {
        transform: scale(1.03);
        border-color: var(--eco-green);
        box-shadow: 0 12px 32px rgba(5, 111, 55, 0.25);
    }

    .howscreen-thumbnail.active {
        border-color: var(--eco-green);
        box-shadow: 0 14px 40px rgba(5, 111, 55, 0.4);
        transform: scale(1.05);
    }

    .howscreen-thumbnail-image {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        z-index: 1;
    }

    .howscreen-thumbnail-placeholder {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.75rem;
        font-size: clamp(0.78rem, 1.05vw, 0.95rem);
        font-weight: 700;
        color: #ffffff;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
        background:
            linear-gradient(180deg, rgba(8, 40, 20, 0.35) 0%, rgba(8, 40, 20, 0.7) 100%),
            radial-gradient(circle at 20% 20%, rgba(75, 161, 248, 0.35) 0%, rgba(75, 161, 248, 0) 45%),
            linear-gradient(135deg, #0b7a3d 0%, #056f37 55%, #0b5c7d 100%);
        z-index: 0;
    }

    .howscreen-thumbnail video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .howscreen-thumbnail:hover video,
    .howscreen-thumbnail.active video {
        opacity: 1;
    }

    .howscreen-thumbnail-label {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%);
        color: #fff;
        padding: clamp(0.22rem, 0.35vw, 0.35rem);
        font-size: clamp(0.6rem, 0.62vw, 0.68rem);
        font-weight: 600;
        text-align: center;
        z-index: 3;
    }

    .howscreen-flow .howscreen-thumbnail-label {
        font-size: clamp(0.58rem, 0.6vw, 0.65rem);
        padding: clamp(0.2rem, 0.32vw, 0.3rem);
    }

    /* Exhibit Gallery Layout */
    .howscreen-exhibit {
        grid-area: video;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        height: 100%;
        min-height: 0;
    }

    /* Exhibit Frame (Carousel Container) */
    .howscreen-exhibit-frame {
        position: relative;
        width: min(100%, clamp(560px, 58vw, 820px));
        aspect-ratio: 16/9;
        max-height: 100%;
        background: #fff;
        border-radius: clamp(16px, 1.4vw, 24px);
        border: 2px solid transparent;
        background-clip: padding-box;
        box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        display: flex;
        flex-direction: column;
    }

    .howscreen-exhibit-frame::before {
        content: '';
        position: absolute;
        inset: -2px;
        border-radius: clamp(16px, 1.4vw, 24px);
        padding: 2px;
        background: linear-gradient(135deg, var(--eco-green) 0%, var(--eco-accent) 100%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        z-index: -1;
        opacity: 0.6;
        transition: opacity 0.3s ease;
    }

    .howscreen-exhibit-frame:hover {
        box-shadow: 0 35px 85px rgba(5, 111, 55, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .howscreen-exhibit-frame:hover::before {
        opacity: 1;
    }

    /* Zoom Button */
    .howscreen-zoom-btn {
        position: absolute;
        top: -50px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--eco-green) 0%, var(--eco-accent) 100%);
        color: #fff;
        border: 2px solid #fff;
        font-size: 22px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 28px rgba(5, 111, 55, 0.45);
        z-index: 5;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .howscreen-zoom-btn::before {
        content: "🔍";
    }

    .howscreen-zoom-btn:hover {
        transform: translateX(-50%) scale(1.18);
        box-shadow: 0 14px 36px rgba(5, 111, 55, 0.6);
    }

    /* Carousel 3D Wrapper */
    .howscreen-carousel-wrapper {
        width: 100%;
        height: 100%;
        position: relative;
        background: #1a1a1a;
    }

    .howscreen-carousel-inner {
        position: relative;
        width: 100%;
        height: 100%;
    }

    /* Carousel Slides */
    .howscreen-carousel-slide {
        position: absolute;
        inset: 0;
        opacity: 0;
        transform: scale(0.93);
        transition: opacity 0.45s ease, transform 0.45s ease;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 0;
        color: #fff;
        gap: 0;
        overflow: hidden;
    }

    .howscreen-carousel-slide.active {
        opacity: 1;
        transform: scale(1);
        z-index: 2;
    }

    /* Video Container */
    .howscreen-carousel-video-container {
        flex: 1;
        height: 100%;
        border-radius: 0;
        overflow: hidden;
        background: #0a0a0a;
        box-shadow: none;
        position: relative;
        z-index: 25;
    }

    .howscreen-carousel-video {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        border: 0;
    }

    /* Slide Text Content - Separate Container */
    /* Section Header */
    .howscreen-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .howscreen-title {
        font-size: clamp(2rem, 3.5vw, 2.8rem);
        font-weight: 800;
        color: var(--eco-green);
        margin: 0;
        letter-spacing: -0.5px;
    }

    /* Zoom Modal */
    .howscreen-zoom-modal {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.98);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        backdrop-filter: blur(5px);
    }

    .howscreen-zoom-modal.open {
        display: flex;
    }

    .howscreen-zoom-modal-content {
        width: 90%;
        max-width: 1100px;
    }

    .howscreen-zoom-modal-content video {
        width: 100%;
        height: auto;
        border-radius: 18px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
        max-height: 85vh;
    }

    .howscreen-zoom-modal-close {
        position: fixed;
        top: 24px;
        right: 32px;
        font-size: 36px;
        color: #fff;
        cursor: pointer;
        background: rgba(5, 111, 55, 0.3);
        border: 2px solid var(--eco-green);
        padding: 8px 16px;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 1001;
        font-weight: 300;
        line-height: 1;
    }

    .howscreen-zoom-modal-close:hover {
        background: var(--eco-green);
        color: #fff;
        transform: scale(1.15);
    }

    @media (min-width: 1024px) and (max-width: 1280px) {
        .howscreen-container {
            grid-template-columns:
                minmax(130px, 170px)
                minmax(0, 1fr)
                minmax(130px, 170px);
        }

        .howscreen-exhibit-frame {
            width: min(100%, 640px);
        }
    }
}

/* Hide desktop elements on mobile/tablet */
@media (max-width: 1023px) {
    .howscreen-section {
        display: none !important;
    }

    .howscreen-zoom-modal {
        display: none !important;
    }
}

        /* ========================================
           MOBILE/TABLET-ONLY CSS (1023px and below)
           Vertical scrolling video segments
        ======================================== */
        @media (max-width: 1023px) {
            /* Mobile Process Section */
            .hwphone-process-section {
                display: block;
                position: relative;
                z-index: 20;
                padding: 2rem 0;
                 overflow: hidden;

            }

            /* Mobile Process Header */
            .hwphone-process-header {
                text-align: center;
                margin-bottom: 3rem;
                padding: 0 1rem;
            }

            .hwphone-process-title {
                font-size: clamp(1.8rem, 5vw, 2.5rem);
                font-weight: 700;
                color: var(--eco-green);
                margin: 0 0 1rem;
                letter-spacing: -0.5px;
                position: relative;
            }

            .hwphone-process-title::after {
                content: '';
                position: absolute;
                bottom: -8px;
                left: 50%;
                transform: translateX(-50%);
                width: 60px;
                height: 3px;
                background: linear-gradient(90deg, var(--eco-green) 0%, var(--eco-accent) 100%);
                border-radius: 2px;
            }

            /* Mobile Segments Container */
            .hwphone-segments-container {
                max-width: 100%;
                margin: 0 auto;
                padding: 0 1rem;
            }

            /* Mobile Text Segments */
            .hwphone-text-segment {
                width: 100%;
                min-height: 300px;
                display: flex;
                align-items: center;
                justify-content: center;
                padding: 3rem 1rem;
                position: relative;
            }

            /* Mobile Video Segments */
            .hwphone-video-segment {
                width: 100%;
                min-height: 400px;
                display: flex;
                align-items: center;
                justify-content: center;
                padding: 3rem 1rem;
                position: relative;
            }

            /* Mobile Segment Content */
            .hwphone-segment-content {
                max-width: 500px;
                width: 100%;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                text-align: center;
                gap: 2rem;
            }

            /* Mobile Video Container */
            .hwphone-video-container {
                position: relative;
                z-index: 25;
                width: 100%;
                max-width: 90vw;
                aspect-ratio: 16/9;
                border: 3px solid var(--eco-green);
                border-radius: 20px;
                overflow: hidden;
                box-shadow: 0 8px 30px rgba(5, 111, 55, 0.15);
                /* Animation states */
                opacity: 0;
                transform: translateX(100px) scale(0.8);
                transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            }

            /* Mobile Video Element */
            .hwphone-process-video {
                width: 100%;
                height: 100%;
                object-fit: contain;
                display: block;
                border: 0;
            }

            /* Mobile Text Content */
            .hwphone-step-text {
                width: 100%;
                max-width: 85vw;
                /* Animation states */
                opacity: 0;
                transform: translateX(-100px) scale(0.8);
                transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            }

            .hwphone-step-number {
                font-size: 1rem;
                font-weight: 800;
                color: var(--eco-blue);
                margin-bottom: 1rem;
                text-transform: uppercase;
                letter-spacing: 3px;
                opacity: 0.9;
                background: rgba(75, 161, 248, 0.1);
                padding: 0.8rem 1.5rem;
                border-radius: 25px;
                border: 2px solid rgba(75, 161, 248, 0.2);
                display: inline-block;
            }

            .hwphone-step-title {
                font-size: clamp(2.2rem, 6vw, 3.2rem);
                font-weight: 900;
                color: var(--eco-green);
                margin-bottom: 1rem;
                line-height: 1.1;
                letter-spacing: -1px;
            }

            .hwphone-step-description {
                font-size: clamp(1.1rem, 3.5vw, 1.3rem);
                line-height: 1.7;
                color: var(--text-light);
                font-weight: 400;
                text-align: justify;
            }

            /* Mobile Animation Classes - DIRECTIONAL */
            .hwphone-step-text.animate-in {
                opacity: 1;
                transform: translateX(0) scale(1);
            }

            .hwphone-video-container.animate-in {
                opacity: 1;
                transform: translateX(0) scale(1);
            }

            /* Text animates OUT to the LEFT (same direction it came from) */
            .hwphone-step-text.animate-out {
                opacity: 0;
                transform: translateX(-150px) scale(0.7);
                transition: all 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53);
            }

            /* Video animates OUT to the RIGHT (same direction it came from) */
            .hwphone-video-container.animate-out {
                opacity: 0;
                transform: translateX(150px) scale(0.7);
                transition: all 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53);
            }

            /* Mobile Background Colors for 8 Segments */
            .hwphone-segment:nth-child(1) { background: transparent; }
            .hwphone-segment:nth-child(2) { background: transparent; }
            .hwphone-segment:nth-child(3) { background: transparent; }
            .hwphone-segment:nth-child(4) { background: transparent; }
            .hwphone-segment:nth-child(5) { background: transparent; }
            .hwphone-segment:nth-child(6) { background: transparent; }
            .hwphone-segment:nth-child(7) { background: transparent; }
            .hwphone-segment:nth-child(8) { background: transparent; }

            /* Mobile Step Title Colors */
            .hwphone-segment:nth-child(1) .hwphone-step-title,
            .hwphone-segment:nth-child(2) .hwphone-step-title { color: var(--eco-green); }
            .hwphone-segment:nth-child(3) .hwphone-step-title,
            .hwphone-segment:nth-child(4) .hwphone-step-title { color: var(--eco-accent); }
            .hwphone-segment:nth-child(5) .hwphone-step-title,
            .hwphone-segment:nth-child(6) .hwphone-step-title { color: var(--eco-blue); }
            .hwphone-segment:nth-child(7) .hwphone-step-title,
            .hwphone-segment:nth-child(8) .hwphone-step-title { color: var(--eco-dark-green); }

            /* Mobile Scroll Indicator */
            .mobile-scroll-indicator {
                position: fixed;
                bottom: 30px;
                left: 50%;
                transform: translateX(-50%);
                z-index: 100;
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 8px;
                opacity: 0;
                visibility: hidden;
                transition: all 0.8s ease;
                pointer-events: none;
            }

            .mobile-scroll-indicator.show {
                opacity: 1;
                visibility: visible;
            }

            .mobile-scroll-text {
                font-size: 0.9rem;
                font-weight: 600;
                color: var(--eco-green);
                text-transform: uppercase;
                letter-spacing: 1px;
                text-align: center;
                margin-bottom: 5px;
            }

            .mobile-scroll-arrow {
                width: 30px;
                height: 30px;
                border: 2px solid var(--eco-green);
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                background: rgba(255, 255, 255, 0.9);
                backdrop-filter: blur(10px);
                animation: pulseArrow 2s ease-in-out infinite;
            }

            .mobile-scroll-arrow::before {
                content: '';
                width: 8px;
                height: 8px;
                border-right: 2px solid var(--eco-green);
                border-bottom: 2px solid var(--eco-green);
                transform: rotate(45deg);
                margin-top: -2px;
            }

            @keyframes pulseArrow {
                0%, 100% {
                    transform: scale(1);
                    box-shadow: 0 0 0 0 rgba(5, 111, 55, 0.4);
                }
                50% {
                    transform: scale(1.1);
                    box-shadow: 0 0 0 10px rgba(5, 111, 55, 0);
                }
            }

            /* Tablet Specific Adjustments (768px - 1023px) */
            @media (min-width: 768px) {
                .hwphone-text-segment { min-height: 350px; padding: 4rem 2rem; }
                .hwphone-video-segment { min-height: 450px; padding: 4rem 2rem; }
                .hwphone-segment-content { max-width: 600px; gap: 2.5rem; }
                .hwphone-video-container { max-width: 70vw; border-radius: 25px; }
                .hwphone-step-text { max-width: 75vw; }
                .hwphone-step-number { padding: 1rem 2rem; font-size: 1.1rem; }
                .hwphone-step-description { font-size: clamp(1.2rem, 3vw, 1.4rem); line-height: 1.8; }
            }

            /* Small Mobile Adjustments (480px and below) */
            @media (max-width: 480px) {
                .hwphone-text-segment { min-height: 250px; padding: 2rem 1rem; }
                .hwphone-video-segment { min-height: 300px; padding: 2rem 1rem; }
                .hwphone-segment-content { max-width: 100%; gap: 1.5rem; }
                .hwphone-video-container { max-width: 95vw; border-radius: 15px; border-width: 2px; }
                .hwphone-step-text { max-width: 90vw; }
                .hwphone-step-number { font-size: 0.9rem; padding: 0.6rem 1.2rem; letter-spacing: 2px; margin-bottom: 0.8rem; }
                .hwphone-step-description { font-size: clamp(1rem, 4vw, 1.2rem); line-height: 1.6; }
                .mobile-scroll-indicator { bottom: 20px; }
                .mobile-scroll-text { font-size: 0.8rem; }
                .mobile-scroll-arrow { width: 25px; height: 25px; }
                .mobile-scroll-arrow::before { width: 6px; height: 6px; }
            }
        }

        /* Hide mobile section on desktop */
        @media (min-width: 1024px) {
            .hwphone-process-section {
                display: none !important;
            }
            
            /* Hide mobile scroll indicator on desktop */
            .mobile-scroll-indicator {
                display: none !important;
                visibility: hidden !important;
                opacity: 0 !important;
                pointer-events: none !important;
            }
            
            /* Ensure desktop theater overlay is available on desktop */
            .desktop-theater-overlay {
                display: flex;
            }
        }
