/* --- 1. CORE & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

:root {
    --primary-green: #0a2a1b;
    --accent-green: #143d2a;
    --leap-green: #4ade80;
    --text-white: #ffffff;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--primary-green);
    color: var(--text-white);
    margin: 0;
    padding-top: 100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- 2. LAYOUT & NAVIGATION --- */
.custom-header {
    background: #212123;
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
}
@media (max-width: 991.98px) {
    .custom-header { padding: 0.75rem 0; }
    .navbar-toggler { padding: 0.4rem 0.6rem; font-size: 1rem; }
    .navbar-toggler-icon { width: 1.25em; height: 1.25em; }
    .navbar-collapse { padding: 1rem 0; }
    .navbar-nav .nav-item { text-align: center; padding: 0.3rem 0; }
    .navbar-nav .btn-private { display: inline-block; margin: 0.5rem 0; }
}
.navbar-brand { font-weight: 700; letter-spacing: 2px; max-width: 160px; }
@media (max-width: 991.98px) {
    .navbar-brand { max-width: 140px; }
}
.nav-link {
    font-size: 0.8rem; letter-spacing: 1px; font-weight: 400;
    color: var(--text-white) !important; text-transform: uppercase;
}
.btn-private {
    background: linear-gradient(to right, #145220 0%, #3cb554 100%);
    border: none !important; padding: 10px 28px !important; border-radius: 50px;
    color: var(--text-white) !important; font-weight: 600; letter-spacing: 1.5px;
    position: relative; overflow: hidden; z-index: 0; text-decoration: none !important;
}
.btn-private::after {
    content: ''; position: absolute; inset: 0; border-radius: 50px;
    background: linear-gradient(to right, #3cb554 0%, #145220 100%);
    opacity: 0; transition: opacity 0.5s ease; z-index: -1;
}
.btn-private:hover::after { opacity: 1; }

/* --- 3. PAGE BACKGROUNDS --- */
body[class^="bg-"], body[class*=" bg-"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
body.bg-01 { background-image: url('../images/leapmotor-bg-01.webp'); }
body.bg-02 { background-image: url('../images/leapmotor-bg-02.webp'); }

/* --- 4. HERO & HUB ELEMENTS --- */
.hero-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 0; }
.hero-title { font-size: clamp(2rem, 9vw, 4rem); font-weight: 700; line-height: 1.1; margin-bottom: 2rem; text-transform: uppercase; }
.hero-subtitle { letter-spacing: 8px; font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 300; margin-bottom: 2rem; }

/* --- 5. SUB-MENUS --- */
.hub-v-link {
    text-decoration: none !important;
    color: var(--text-white) !important;
    font-size: 1rem;
    letter-spacing: 3px;
    padding: 10px 0;
    transition: var(--transition);
    text-transform: uppercase;
}
.hub-v-link:hover, .active-green { color: var(--leap-green) !important; }
.hub-divider-v { width: 1px; height: 30px; background-color: rgba(255,255,255,0.5); margin: 0 30px; }
.hub-hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.5); width: 100%; max-width: 400px; margin: 20px auto; opacity: .5; }

/* --- 6. GRID SYSTEM (BLINDATO 280px) --- */
.media-grid-container {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; padding: 20px 0; width: 100%;
}
.grid-item-fixed {
    width: 280px !important; min-width: 280px !important; max-width: 280px !important;
    flex: 0 0 280px !important; text-align: center;
}
.media-item-wrapper { position: relative; text-decoration: none !important; }
.thumb-container {
    position: relative; width: 100%; height: 180px !important;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.media-item-wrapper:hover .thumb-img { transform: scale(1.1); }

.doc-label-minimal {
    display: block; font-size: 0.75rem; letter-spacing: 1px;
    margin-top: 12px; color: #ffffff !important; text-transform: uppercase;
    text-decoration: none !important;
}
.folder-link, .doc-link-minimal { text-decoration: none !important; }
.folder-icon { width: 60px !important; fill: var(--leap-green); }

.media-overlay {
    position: absolute; inset: 0; background: rgba(10, 42, 27, 0.7);
    display: flex; align-items: center; justify-content: center; gap: 15px;
    opacity: 0; transition: var(--transition);
}
.media-item-wrapper:hover .media-overlay { opacity: 1; }

.action-btn {
    width: 45px; height: 45px; background: var(--leap-green); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: none;
}
.action-btn:hover { background: #fff; transform: scale(1.1); }
.action-btn svg { width: 20px; fill: var(--primary-green); }

/* --- 7. BREADCRUMBS --- */
.breadcrumb-container { display: flex; justify-content: center; margin-bottom: 40px; }
.breadcrumb { background: rgba(255, 255, 255, 0.05); padding: 10px 25px; border-radius: 50px; margin: 0; list-style: none; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--leap-green); padding: 0 10px; font-size: 1.2rem; }
.breadcrumb-item a { color: rgba(255,255,255,0.6); text-decoration: none !important; font-size: 0.7rem; letter-spacing: 1px; }

/* --- CONTACT PAGE --- */

.contact-full-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding-top: 50px;
}

.contact-sub-nav {
    display: inline-flex;
    border-bottom: none;
    padding-bottom: 0;
}

.contact-sub-link {
    text-decoration: none !important;
    color: var(--text-white);
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 500;
    transition: var(--transition);
    padding: 0 15px;
}

.contact-divider-v {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.4);
}

#contact-display {
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
}

.fade-in-smooth {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.fade-out-smooth {
    opacity: 0 !important;
    transform: translateY(15px) !important;
}

#contact-display .hero-title {
    font-size: 3rem;
    letter-spacing: 5px;
    margin-top: 40px;
}

.contact-person {
    margin-bottom: 2.5rem;
}

.contact-person .name {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.contact-person .phone {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-white);
}

.contact-person .hub-hr {
    margin: 30px auto;
    width: 100%;
    max-width: 350px; /* Lunghezza della linea come da screenshot */
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

/* --- 9. LOGIN FORM --- */
.login-panel { width: 100%; text-align: center; }
.login-input { 
    background: transparent !important; border: none !important; 
    color: var(--text-white) !important; font-size: 1.2rem; 
    letter-spacing: 2px; width: 100%; outline: none; 
    padding: 10px; text-align: center; text-transform: uppercase;
}
.login-input::placeholder { color: rgba(255, 255, 255, 0.4); font-weight: 300; text-transform: uppercase; }

.btn-private-large {
    background: linear-gradient(to right, #145220 0%, #3cb554 100%);
    border: none; padding: 15px 60px; border-radius: 50px; color: var(--text-white);
    font-weight: 600; letter-spacing: 2px; position: relative; overflow: hidden; 
    z-index: 0; cursor: pointer; transition: var(--transition);
}
.btn-private-large::after { 
    content: ''; position: absolute; inset: 0; 
    background: linear-gradient(to right, #3cb554 0%, #145220 100%); 
    opacity: 0; transition: opacity 0.5s ease; z-index: -1; 
}
.btn-private-large:hover::after { opacity: 1; }
.btn-private-large:hover { transform: scale(1.05); }

/* --- AGENDA PAGE --- */
.agenda-grid {
    display: flex;
    flex-direction: column;
}

.agenda-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
}

.agenda-item .time {
    width: 140px; /* Leggermente più largo per gestire i range orari */
    font-weight: 300;
    font-size: 1.05rem;
    text-align: left;
    color: var(--text-white);
}

.agenda-item .divider {
    width: 1px;
    min-height: 25px;
    align-self: stretch; /* Si allunga se il testo dell'evento va su più righe */
    background-color: rgba(255, 255, 255, 0.4);
    margin: 0 25px;
}

.agenda-item .event {
    flex: 1;
    font-weight: 400;
    font-size: 1.05rem;
    text-align: left;
    color: var(--text-white);
    line-height: 1.4;
}

/* Contenitore Immagine Auto */
.agenda-car-container {
    width: 100%;
    padding-top: 40px;
    text-align: right; /* Allinea l'auto a destra della colonna */
}

.agenda-car-container img {
    max-width: 90%;
    height: auto;
}

.car-shadow {
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4));
}

/* Ottimizzazione mobile */
@media (max-width: 768px) {
    .agenda-item .time { width: 110px; font-size: 0.9rem; }
    .agenda-item .event { font-size: 0.9rem; }
    .agenda-car-container { text-align: center; padding-top: 20px; }
    .agenda-car-container img { max-width: 100%; }
}

/* --- 10. UTILS & ROADBOOK --- */
.hub-main-img { border-radius: 20px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); }
.roadbook-info { border-left: 3px solid var(--leap-green); padding-left: 1.5rem; margin-bottom: 2.5rem; text-align: left; }
.modal-content { background: #000; border-radius: 0; border: 1px solid rgba(255,255,255,0.1); }
.btn-close-white { filter: invert(1) brightness(200%); }
footer { background: #051a11; padding: 2rem 0; font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-top: auto; text-align: center; }

/* --- ROADBOOK BUTTONS --- */
.btn-get-route {
    display: inline-block;
    background: linear-gradient(to right, #145220 0%, #3cb554 100%);
    border: none;
    color: var(--text-white) !important;
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-decoration: none !important;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    z-index: 0;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}
.btn-get-route::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #3cb554 0%, #145220 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}
.btn-get-route:hover::after { opacity: 1; }
.btn-get-route:hover { transform: scale(1.05); }

/* Correzione per i titoli degli Stage */
.roadbook-info h3 {
    letter-spacing: 1px;
}

@media (min-width: 1200px) { .container-fluid.px-5 { padding: 0 10% !important; } }
/* --- RESPONSIVE MOBILE (aggiunto fix) --- */
@media (max-width: 767.98px) {
    body { padding-top: 70px; }

    .hero-title { font-size: clamp(1.8rem, 10vw, 3rem); }
    .hero-subtitle { font-size: clamp(0.85rem, 3.5vw, 1.2rem); letter-spacing: 4px; }

    /* container-fluid px-5 → padding ridotto su mobile */
    .container-fluid.px-5 { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Hub vertical menu su mobile: orizzontale con scroll o wrap */
    .hub-divider-v { display: none; }
    .d-flex.align-items-center.justify-content-center {
        flex-wrap: wrap;
        gap: 12px;
    }
    /* Sub-menu DOCS | PHOTO | VIDEO */
    .sub-menu-container { gap: 16px !important; }
    .sub-menu-container .hub-divider-v { display: none !important; }

    /* Grid items leggermente più piccoli su schermi molto stretti */
    .grid-item-fixed {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        flex: 0 0 260px !important;
    }
}
@media (max-width: 359px) {
    .grid-item-fixed {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
        flex: 0 0 240px !important;
    }
}
@media (max-width: 767.98px) {
    /* Login e Roadbook */
    .login-input { font-size: 1rem; }
    .btn-private-large { padding: 12px 40px; font-size: 0.85rem; }
    .btn-get-route { padding: 12px 40px; font-size: 0.75rem; }

    /* Roadbook info */
    .roadbook-info { margin-bottom: 1.5rem; }
    .hub-main-img { border-radius: 12px; }

    /* Contact page */
    .contact-full-container { padding-top: 20px; }
    #contact-display .hero-title { font-size: 2rem; }

    /* Agenda */
    .agenda-item .time { width: 90px; font-size: 0.8rem; }
    .agenda-item .event { font-size: 0.8rem; }
    .agenda-item .divider { margin: 0 12px; }
}

/* Lightbox */

#lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#lb-overlay.lb-active {
    display: flex;
    opacity: 1;
}

#lb-box {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lb-zoom-in 0.3s ease;
}

@keyframes lb-zoom-in {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

#lb-img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    display: block;
}

#lb-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--leap-green);
    border: none;
    color: var(--primary-green);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background 0.2s, transform 0.2s;
    z-index: 1;
}
#lb-close:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Reset stili nativi per <button class="btn-get-route"> */
button.btn-get-route {
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    text-transform: uppercase;
}

/* --- PRIVACY BANNER REFINED --- */
.privacy-banner {
    position: fixed !important;
    bottom: -150px;
    left: 0;
    width: 100%;
    background: rgba(10, 42, 27, 0.98); 
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(74, 222, 128, 0.3);
    padding: 15px 0;
    z-index: 999999 !important;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.privacy-banner.show {
    bottom: 0 !important;
}

/* Pulsante Accetta Coerente */
.btn-privacy-sm {
    /* Usiamo lo stesso gradiente dei pulsanti principali */
    background: linear-gradient(to right, #145220 0%, #3cb554 100%) !important;
    border: none !important;
    padding: 8px 25px !important;
    border-radius: 50px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Effetto hover coerente */
.btn-privacy-sm:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.btn-privacy-sm::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #3cb554 0%, #145220 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.btn-privacy-sm:hover::after {
    opacity: 1;
}
