:root {
    --primary-color: #ff5e00; /* Orange accent */
    --text-light: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    background-color: #050505;
    color: var(--text-light);
}

.scene-container {
    position: relative;
    width: 100vw;
    height: 100dvh; /* Usa dynamic viewport height per coprire esattamente lo schermo su mobile */
    min-height: 100vh;
    overflow: hidden;
    background: #000;
}

.parallax-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    transform: scale(1.05); /* Safe zone for parallax */
}

.video-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    visibility: visible; /* IMPORTANTE: Mai usare hidden o display none */
    transition: opacity 0.4s ease-in-out;
    z-index: 1;
}

.video-bg.active {
    opacity: 1;
    z-index: 5;
}

.video-bg.behind {
    opacity: 1;
    z-index: 4;
}

.static-bg {
    z-index: 2;
}

.static-bg.active {
    z-index: 5;
}

.static-bg.behind {
    z-index: 4;
}

/* OVERLAY CINEMATICO */
.cinematic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 30%, rgba(0,0,0,0.85) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Background Text */
.background-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    z-index: 5;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 20; /* Sopra il pannello sinistro */
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 3px;
    font-style: italic;
    flex-grow: 1;
    text-align: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.4rem;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 50px; /* Bilancia il logo centrale */
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Main Content */
.content {
    display: flex;
    justify-content: flex-end; /* Sposta le icone social a destra */
    align-items: center;
    height: 100%;
    padding: 0 50px;
    position: relative;
    z-index: 10;
}



.right-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
    animation: fadeIn 2s ease forwards;
}

.social-icon {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon:hover {
    color: var(--text-light);
    transform: scale(1.2);
}

/* Bottom Bar */
.bottom-bar {
    position: absolute;
    bottom: 50px;
    width: 100%;
    padding: 0 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 200px;
}

.step-number {
    font-weight: 600;
    font-size: 1.2rem;
}

.step-indicator .line {
    flex-grow: 1;
    height: 2px;
    background: var(--glass-border);
    position: relative;
}

.step-indicator .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--primary-color);
}

.cards-carousel-wrapper {
    position: absolute;
    width: 100vw;
    left: 0;
    bottom: 0;
    overflow: visible;
}

.cards-container {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    gap: 40px;
    width: max-content;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Colonna Sinistra (Modelli Auto) */
.left-panel {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 290px; /* Aumentato del ~15% rispetto a 250px per ingrandire le auto */
    padding: 100px 20px 20px 20px; /* Padding top per lasciare spazio alla top-bar */
    display: flex;
    flex-direction: column;
    z-index: 15; /* Alzato per essere sopra .content ed evitare blocchi del mouse */
    background: rgba(10, 10, 10, 0.5); /* Sfondo ripristinato */
    backdrop-filter: blur(20px); /* Sfocatura ripristinata */
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0; /* Assicuriamo che non ci siano angoli arrotondati */
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: none;
}

.menu-list::-webkit-scrollbar {
    display: none;
}

.menu-list.text-menu {
    gap: 20px;
    padding: 0 20px;
    justify-content: center;
    height: 100%;
}

.menu-item {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
}

.menu-item:hover, .menu-item.active {
    color: #fff;
    border-bottom: 1px solid #e50000;
    transform: translateX(10px);
}

.menu-item:last-child {
    border-bottom: none;
}

.config-card {
    background: rgba(255, 255, 255, 0.05); /* Dark frosted glass */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Cover flow effects */
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(0.85);
    opacity: 0.5;
    pointer-events: none;
}

.config-card.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
}

.settings-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255,255,255,0.2);
    color: var(--text-light);
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.nav-arrow {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-arrow:hover {
    color: var(--text-light);
    transform: scale(1.2);
}

.car-carousel, .wheels-carousel {
    display: flex;
    align-items: center;
    gap: 20px;
}

.carousel-item, .wheel-item {
    width: 100px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.5;
    position: relative;
}

.carousel-item.active, .wheel-item.active {
    opacity: 1;
    transform: scale(1.3);
    z-index: 2;
}

.carousel-item img, .wheel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
}

.check-mark {
    position: absolute;
    top: -5px;
    right: 25px;
    background: #000;
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.carousel-item.active .check-mark,
.wheel-item.active .check-mark {
    opacity: 1;
}

/* Animations */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .background-text {
        font-size: 25vw;
    }
    .text-menu {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    .content {
        flex-direction: column;
        justify-content: flex-end;
        padding-bottom: 150px;
    }
    .left-panel {
        background: transparent;
        border: none;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0;
        margin-bottom: 20px;
    }
    .right-panel {
        display: none; /* Hide social icons on mobile for cleaner look */
    }
    .bottom-bar {
        padding: 0 20px;
    }
    .step-indicator {
        display: none;
    }
    .carousel-wrapper {
        gap: 15px;
    }
    .car-carousel {
        gap: 10px;
    }
    .carousel-item {
        width: 80px;
        height: 45px;
    }
}

/* ORIENTATION WARNING - BURN STYLE */
.orientation-warning { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh; 
    background: radial-gradient(circle at center, #1a0a00 0%, #050505 100%);
    color: #fff; 
    z-index: 999999; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    padding: 30px; 
}

.orientation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: pulseGlow 3s infinite alternate;
}

.flame-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 20px rgba(255, 94, 0, 0.6));
    margin-bottom: 5px;
}

.orientation-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
}

.orientation-content p {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
}

.phone-icon-wrapper {
    margin-top: 30px;
}

.rotate-phone-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    animation: rotatePhone 2s infinite ease-in-out;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); color: var(--primary-color); }
    100% { transform: rotate(-90deg); }
}

@keyframes pulseGlow {
    0% { opacity: 0.85; }
    100% { opacity: 1; }
}

@media screen and (max-width: 900px) and (orientation: portrait) { 
    .orientation-warning { display: flex; } 
}

/* RESPONSIVE MOBILE LANDSCAPE (Gira Telefono - Visualizzazione Auto) */
@media screen and (max-height: 500px) and (orientation: landscape), screen and (max-width: 950px) and (orientation: landscape) {
    .left-panel {
        width: 100vw !important;
        height: 45px !important; 
        top: auto !important;
        bottom: 10px !important;
        left: 0 !important;
        padding: 0 15px !important;
        background: transparent !important; 
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 9999 !important;
    }

    .menu-list {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important; 
        gap: 8px !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }
    
    .menu-list::-webkit-scrollbar {
        display: none !important;
    }

    .menu-list .menu-item {
        margin: 0 !important;
        padding: 0 5px !important;
        background: rgba(10, 10, 10, 0.75) !important; 
        border: 1px solid rgba(255,255,255,0.1) !important;
        transition: all 0.3s ease !important;
        text-shadow: none !important;
        flex: 1 1 0 !important; /* 5 box uguali */
        height: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 2px !important;
        
        /* Text styling embedded */
        font-size: 0.55rem !important; 
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
        opacity: 0.8 !important;
        color: #fff !important;
        text-align: center !important;
        text-transform: uppercase !important;
    }

    .menu-list .menu-item.active {
        background: rgba(255, 94, 0, 0.15) !important; 
        border: 1px solid var(--primary-color) !important;
        opacity: 1 !important;
        color: #fff !important;
    }

    .menu-list .menu-item.active::before {
        display: none !important; 
    }

    .top-header {
        padding: 10px 20px !important;
        background: transparent !important;
    }

    .top-header .logo {
        font-size: 0.8rem !important;
        letter-spacing: 2px !important;
        text-shadow: 1px 2px 5px rgba(0,0,0,0.9) !important;
    }

    .right-social {
        top: 15px !important;
        bottom: auto !important;
        right: 15px !important;
        transform: none !important;
        flex-direction: row !important;
        gap: 15px !important;
    }
    
    .right-social a {
        font-size: 0.9rem !important;
        margin: 0 !important;
        text-shadow: 1px 2px 5px rgba(0,0,0,0.9) !important;
    }
}


/* Hardware acceleration and anti-flicker for video transitions */
.video-bg, .static-bg {
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-transform: translate3d(0,0,0) !important;
    transform: translate3d(0,0,0) !important;
    background: #000 !important;
}
.video-container, .parallax-wrapper, .scene-container {
    background: #000 !important;
}

