:root {
    --cine-bg: #050505;
    --cine-text: #ffffff;
    --cine-accent: #00A651;
    /* Keeping brand, but subtle */

    --panel-width: 400px;
    --ease-cinema: cubic-bezier(0.2, 0, 0.2, 1);
    /* Very smooth, slight ease in/out */
    --transition-slow: 1.5s;

    --guide-camera-x: 0px;
    --guide-camera-y: 0px;
    --guide-camera-z: 0px;
    --guide-rotate-x: 0deg;
    --guide-rotate-y: 0deg;
    --guide-origin-x: 50%;
    --guide-origin-y: 50%;
}

body {
    background-color: var(--cine-bg);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    color: var(--cine-text);
    font-family: 'Poppins', sans-serif;
    perspective: 2000px;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cinematic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    z-index: -2;
    /* Hardware acceleration only where needed */
    transform: translateZ(0);
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 1000;
    /* Front of app, behind text */
    /* GPU acceleration */
    will-change: opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

#app-wrapper,
#cart-app-wrapper,
#products-app-wrapper,
#profile-app-wrapper,
#checkout-app-wrapper {
    border-radius: 15px;
    width: 80%;
    position: absolute;
    top: 0;
    left: 60px;
    transform: translateY(-50%);
    background: #ffffff;
    color: #333333;
    z-index: 150;
    overflow-y: auto;
    /* GPU acceleration for smooth performance */
    will-change: transform;
    backface-visibility: hidden;
}

#app-wrapper,
#cart-app-wrapper,
#products-app-wrapper,
#profile-app-wrapper,
#checkout-app-wrapper {
    text-align: left;
    opacity: 1;
    transform-style: preserve-3d;

    /* Camera Motion variables */
    transform: translateX(calc(var(--guide-camera-x) - 15%)) translateY(var(--guide-camera-y)) translateZ(var(--guide-camera-z)) rotateX(var(--guide-rotate-x)) rotateY(var(--guide-rotate-y));

    transform-origin: var(--guide-origin-x) var(--guide-origin-y);
    transition: transform var(--transition-slow) var(--ease-cinema);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* Lock fixed elements into the guide wrappers */
#app-wrapper .bottom-nav,
#cart-app-wrapper .bottom-nav,
#products-app-wrapper .bottom-nav,
#profile-app-wrapper .bottom-nav,
#checkout-app-wrapper .bottom-nav,
#products-app-wrapper .floating-cart-btn,
#profile-app-wrapper .modal-overlay {
    position: absolute !important;
}


/* Scrollbar styling for the virtual screen */
#app-wrapper::-webkit-scrollbar,
#cart-app-wrapper::-webkit-scrollbar,
#products-app-wrapper::-webkit-scrollbar,
#checkout-app-wrapper::-webkit-scrollbar {
    width: 6px;
}

#app-wrapper::-webkit-scrollbar-thumb,
#cart-app-wrapper::-webkit-scrollbar-thumb,
#products-app-wrapper::-webkit-scrollbar-thumb,
#checkout-app-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 166, 81, 0.3);
    border-radius: 10px;
}

/* Instruction Panel (Right Side) */
.instruction-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 35%;
    height: 100%;
    padding: 60px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.9) 20%, #000000 100%);
    z-index: 2000;
    pointer-events: none;
    /* Allow click through if needed, but usually text blocks */
}

.instruction-content {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s var(--ease-cinema);
}

.instruction-content.active {
    opacity: 1;
    transform: translateY(0);
}

.guide-step-count {
    color: var(--cine-accent);
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
    text-transform: uppercase;
}

.instruction-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 24px 0;
    background: linear-gradient(to bottom right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Standard fallback if text-fill-color isn't supported, though background-clip: text usually needs it */
}

.instruction-text {
    font-size: 18px;
    line-height: 1.6;
    color: #cccccc;
    font-weight: 300;
    margin-bottom: 40px;
    max-width: 500px;
}

.instruction-action {
    display: flex;
    gap: 20px;
    pointer-events: auto;
    /* Buttons clickable */
}

.cine-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cine-btn:hover {
    background: white;
    color: black;
}

.cine-btn.primary {
    background: var(--cine-accent);
    border-color: var(--cine-accent);
}

.cine-btn.primary:hover {
    background: #008f45;
    color: white;
}


/* Highlight Logic */
[data-guide-step] {
    transition: transform 1s var(--ease-cinema),
        opacity 1s var(--ease-cinema),
        box-shadow 1s var(--ease-cinema);
    /* GPU acceleration */
    will-change: transform, opacity;
    backface-visibility: hidden;
}

[data-guide-step].guide-focused {
    transform: translateZ(50px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 166, 81, 0.5);
    /* Subtle outline */
    z-index: 10;
    border-radius: 8px;
    /* Smooth corners */
    /* Ensure it stands out against potential transparent backgrounds */
}

[data-guide-step].guide-dimmed {
    opacity: 0.6;
    transform: scale(0.98);
    position: relative;
    pointer-events: none;
}

/* Whiteish vibe for all dimmed sections */
[data-guide-step].guide-dimmed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.88);
    z-index: 100;
    pointer-events: none;
    border-radius: inherit;
    transition: opacity 0.5s ease;
}

/* Specifically hide news dots when dimmed */
[data-guide-step="news"].guide-dimmed .slider-dots {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

/* Remove overlay and show full color when focused */
[data-guide-step].guide-focused::after {
    content: none !important;
}

[data-guide-step].guide-focused {
    opacity: 1 !important;
    filter: none !important;
}

/* On mobile, remove filters entirely */
@media (max-width: 1024px) {
    [data-guide-step].guide-dimmed {
        filter: none !important;
    }
}

/* Markers simplified */
.guide-marker-dot {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1px solid var(--cine-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20;
    animation: ripple-scan 3s infinite;
    /* GPU acceleration */
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.guide-marker-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--cine-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

/* Optimized ripple animation using transform instead of width/height */
/* Fully Optimized Ripple for Mobile */
@keyframes ripple-scan {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ========================================
   NEWS SECTION STYLES
   ======================================== */

/* Ambient Glow Slider */
.news-slider-wrapper {
    position: relative;
    margin-bottom: 25px;
}

.ambient-glow {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background: #00A651;
    filter: blur(40px);
    opacity: 0.15;
    z-index: 1;
    border-radius: 500px;
    transition: background 0.8s ease;
}

.news-slider {
    position: relative;
    height: 150px;
    overflow: hidden;
    border-radius: 500px;
    z-index: 5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.news-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    background: linear-gradient(135deg, #00A651, #008f45);
    border-radius: 500px;
}

.news-card.active {
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.news-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 20px;
}

.news-text {
    flex: 1;
    color: white;
}

.news-text h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.news-text p {
    font-size: 17px;
    font-weight: 500;
    opacity: 0.95;
}

.news-content img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    object-fit: cover;
}

/* Scanning Effect */
.news-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    z-index: 3;
    pointer-events: none;
    animation: scanLine 4s infinite linear;
}

@keyframes scanLine {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Slider Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dots .dot.active {
    background-color: #00A651;
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.3);
    transition: all 0.3s ease;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.news-skeleton {
    width: 100%;
    height: 150px;
    border-radius: 75px;
}

/* Responsive - Premium but Simple Mobile Mode */
@media (max-width: 1024px) {
    :root {
        --guide-rotate-x: 0deg !important;
        --guide-rotate-y: 0deg !important;
        --guide-camera-z: 0px !important;
        --transition-slow: 0.7s;
        /* Snappier for mobile */
    }

    body {
        perspective: none !important;
        overflow: hidden;
    }

    /* Remove the heavy whiteish overlay on mobile for cleaner performance, use literal opacity instead */
    [data-guide-step].guide-dimmed {
        opacity: 0.15 !important;
        transform: scale(0.95);
    }

    [data-guide-step].guide-dimmed::after {
        display: none !important;
    }

    .instruction-side-panel {
        width: 100%;
        height: 48vh;
        top: auto;
        bottom: 0;
        background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.95) 20%, #000 100%);
        padding: 30px 20px;
        justify-content: flex-start
    }

    #app-wrapper,
    #cart-app-wrapper,
    #products-app-wrapper,
    #profile-app-wrapper,
    #checkout-app-wrapper {
        position: absolute;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        border-radius: 0;
        box-shadow: none;
        /* Mobile screen is full width, no shadow needed */
        transform: translateX(var(--guide-camera-x)) translateY(calc(var(--guide-camera-y) - 18vh)) !important;
        will-change: transform;
    }

    [data-guide-step].guide-focused {
        transform: none !important;
        /* No Z-axis pop on mobile */
        box-shadow: 0 0 20px rgba(0, 166, 81, 0.2);
    }

    .instruction-title {
        font-size: 26px;
        margin-bottom: 15px;
    }

    .instruction-text {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 25px;
    }

    .vignette {
        background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
        z-index: 100;
        /* Move behind wrappers or instruction panel */
    }

    .cinematic-bg {
        background: #050505;
        /* Solid dark background is fine */
    }

    .guide-marker-dot {
        display: none !important;
        /* Markers can be visually noisy on mobile */
    }

    /* No nested media queries - keeping mobile simple and consistent */
}

/* Reduced Motion Support for Accessibility and Low-End Devices */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}