/* =========================================
   1. RESET & BASES
========================================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif;
    background-color: #050505;
    color: #fff;
    overflow-x: hidden; /* Empêche de glisser sur les côtés */
    -webkit-tap-highlight-color: transparent;
}

* { 
    box-sizing: border-box; 
}

/* =========================================
   2. CARTE & VUES
========================================= */
#map {
    height: 100vh;
    width: 100%;
    z-index: 1;
}

.view-section {
    display: none;
    position: fixed; 
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; 
    background: #050505;
    overflow-y: auto !important; /* DÉBLOQUE LE SCROLL VERTICAL */
    padding-bottom: 20px !important; 
    -webkit-overflow-scrolling: touch; /* Scroll ultra fluide sur iPhone */
    z-index: 10;
}

.view-section.active { 
    display: block; 
}

/* LE RESSORT MAGIQUE POUR FORCER LE SCROLL SUR MOBILE */
.view-section::after {
    content: '';
    display: block;
    height: 150px; /* Crée un bloc vide invisible de 150px à la fin pour dégager la navbar */
    width: 100%;
}

/* STYLE POPUP CARTE (Leaflet Custom) */
.leaflet-popup-content-wrapper {
    background: rgba(20, 20, 20, 0.95);
    color: white;
    border-radius: 10px;
    border: 1px solid #333;
    backdrop-filter: blur(5px);
}

.leaflet-popup-tip { 
    background: #1a1a1a; 
}

.popup-inner { 
    text-align: center; 
    font-family: 'Rajdhani', sans-serif; 
}

/* Bouton dans le Popup */
.btn-popup-action {
    background: #2d3436;
    border: 1px solid #555;
    color: white;
    padding: 6px 12px;
    margin-top: 8px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    font-weight: 800;
    transition: 0.2s;
}

.btn-popup-action.active {
    background: #ff3b3b;
    border-color: #ff3b3b;
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.4);
}

/* =========================================
   3. BOUTON FLOTTANT AJOUTER (NOUVEAU STYLE PILULE)
========================================= */
.fab-add, #fabAdd { 
    position: fixed; 
    bottom: 110px;   
    right: 20px; 
    width: auto; 
    height: 55px; 
    padding: 0 25px; 
    background: linear-gradient(135deg, #ff3b3b, #cc0000); 
    border-radius: 30px; 
    font-size: 14px; 
    font-weight: 900;
    letter-spacing: 1px;
    color: white; 
    display: flex; 
    border: none;
    justify-content: center; 
    align-items: center; 
    box-shadow: 0 5px 20px rgba(255, 59, 59, 0.5); 
    z-index: 9999; 
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fab-add:hover, #fabAdd:hover {
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(255, 59, 59, 0.8);
}

.fab-add:active, #fabAdd:active {
    transform: scale(0.95); 
}

/* =========================================
   4. INTRO "GARAGE STYLAX" (Sans Flash)
========================================= */
#introScreen {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(to bottom, rgba(10,10,10,0.9), rgba(0,0,0,1)),
                radial-gradient(circle at center bottom, rgba(50, 0, 0, 0.4) 0%, rgba(0,0,0,0) 60%);
    z-index: 9999;
    display: flex; 
    justify-content: center; 
    align-items: center;
    transition: opacity 1.5s ease-in-out, visibility 1.5s;
    overflow: hidden;
}

/* FUMÉE ROUGE */
.atmosphere-container { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 1; 
    pointer-events: none; 
}

.fog-layer {
    position: absolute; 
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 50, 50, 0.1) 0%, rgba(0,0,0,0) 60%);
    filter: blur(100px); 
    opacity: 0.5; 
    mix-blend-mode: screen;
}

.layer-1 { 
    animation: fogDrift 90s linear infinite; 
}

.layer-2 { 
    background: radial-gradient(circle at 40% 60%, rgba(200, 50, 50, 0.08) 0%, rgba(0,0,0,0) 60%); 
    animation: fogDrift 70s linear infinite reverse; 
    opacity: 0.3; 
}

.layer-3 { 
    background: radial-gradient(circle at 60% 40%, rgba(150, 0, 0, 0.1) 0%, rgba(0,0,0,0) 60%); 
    animation: fogDrift 120s linear infinite; 
    opacity: 0.4; 
}

@keyframes fogDrift { 
    0% { transform: rotate(0deg) scale(1); } 
    50% { transform: rotate(180deg) scale(1.1); } 
    100% { transform: rotate(360deg) scale(1); } 
}

/* Réaction fumée au démarrage */
.engine-running .fog-layer {
    background: radial-gradient(circle at center, rgba(255, 50, 50, 0.25) 0%, rgba(0,0,0,0) 60%) !important;
    opacity: 0.8; 
    transition: all 0.5s ease-in; 
    animation-duration: 5s;
}

/* CONTENU INTRO */
.intro-content { 
    text-align: center; 
    position: relative; 
    z-index: 10; 
}

.intro-title {
    font-size: 45px; 
    color: #ff3b3b; 
    margin: 0;
    text-transform: uppercase; 
    letter-spacing: 8px;
    font-weight: 900; 
    font-style: italic;
    text-shadow: 0 0 10px rgba(255, 59, 59, 0.8), 0 0 30px rgba(255, 59, 59, 0.4);
}

.intro-subtitle { 
    color: #ccc; 
    letter-spacing: 4px; 
    margin-top: 15px; 
    font-size: 14px; 
    text-transform: uppercase; 
    font-weight: 300; 
}

/* BOUTON FERRARI */
#btnStartEngine {
    width: 140px; 
    height: 140px; 
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #cc0000);
    border: 4px solid #1a1a1a;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 0 4px #1a1a1a, 0 0 30px rgba(255, 50, 50, 0.4), inset 0 0 20px rgba(0,0,0,0.5);
    color: white; 
    cursor: pointer;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    transition: all 0.2s; 
    outline: none; 
    margin: 50px auto 0 auto;
    animation: pulseStart 2.5s infinite ease-in-out; 
    position: relative;
}

#btnStartEngine::after { 
    content: ''; 
    position: absolute; 
    top: 10%; 
    left: 20%; 
    width: 30%; 
    height: 20%; 
    background: rgba(255,255,255,0.2); 
    border-radius: 50%; 
    filter: blur(5px); 
}

#btnStartEngine:active { 
    transform: scale(0.95) translateY(5px);
    background: radial-gradient(circle at 30% 30%, #cc0000, #990000);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5), 0 0 0 4px #1a1a1a, inset 0 0 30px rgba(0,0,0,0.8);
}

.start-text { 
    font-size: 22px; 
    font-weight: 900; 
    display: block; 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); 
    letter-spacing: 1px; 
}

.engine-text { 
    font-size: 12px; 
    color: #ffcccc; 
    display: block; 
    letter-spacing: 3px; 
    margin-top: 4px; 
    font-weight: bold; 
}

@keyframes pulseStart { 
    0% { box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 0 4px #1a1a1a, 0 0 30px rgba(255, 50, 50, 0.3), inset 0 0 20px rgba(0,0,0,0.5); } 
    50% { box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 0 4px #1a1a1a, 0 0 60px rgba(255, 50, 50, 0.6), inset 0 0 20px rgba(0,0,0,0.5); } 
    100% { box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 0 4px #1a1a1a, 0 0 30px rgba(255, 50, 50, 0.3), inset 0 0 20px rgba(0,0,0,0.5); } 
}

#flashOverlay { 
    display: none; 
} 

.engine-running { 
    animation: engineVibrate 0.05s infinite; 
}

@keyframes engineVibrate { 
    0% { transform: translate(0, 0); } 
    25% { transform: translate(-1px, 1px); } 
    50% { transform: translate(1px, -1px); } 
    75% { transform: translate(-1px, -1px); } 
    100% { transform: translate(0, 0); } 
}

.hidden-intro { 
    opacity: 0; 
    visibility: hidden; 
}

/* =========================================
   5. NAVBAR
========================================= */
.navbar {
    position: fixed; 
    bottom: 0; 
    width: 100%; 
    height: 80px;
    background: rgba(10, 10, 10, 0.95);
    display: flex; 
    justify-content: space-around; 
    align-items: center;
    border-top: 1px solid #333; 
    z-index: 5000;
    backdrop-filter: blur(10px); 
    padding-bottom: 10px;
}

.nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    font-size: 11px; 
    color: #777; 
    transition: 0.2s; 
    cursor: pointer; 
    padding: 5px; 
}

.nav-item span { 
    font-size: 24px; 
    margin-bottom: 4px; 
}

.nav-item.active { 
    color: #ff3b3b; 
    transform: translateY(-3px); 
    text-shadow: 0 0 10px rgba(255, 59, 59, 0.4); 
}

/* =========================================
   6. LISTE & UI
========================================= */
.list-header { 
    position: sticky; 
    top: 0; 
    background: rgba(5,5,5,0.98); 
    padding: 15px; 
    z-index: 10; 
    border-bottom: 1px solid #333; 
}

.list-header h2 { 
    margin: 0 0 10px 0; 
    color: #ff3b3b; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.filters-bar { 
    display: flex; 
    gap: 10px; 
    margin-top: 10px; 
}

select, input, textarea { 
    width: 100%; 
    padding: 12px; 
    background: #1a1a1a; 
    border: 1px solid #333; 
    color: white; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    font-family: 'Rajdhani'; 
    outline: none; 
    font-size: 16px; 
}

input:focus, textarea:focus { 
    border-color: #ff3b3b; 
}

.rasso-card { 
    background: #161616; 
    margin: 15px; 
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid #222; 
    border-left: 4px solid #ff3b3b; 
    animation: slideUp 0.3s ease; 
}

.rasso-card.Pro { 
    border-left: 4px solid #0984e3; 
}

.card-content { 
    padding: 15px; 
}

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

.badge { 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 10px; 
    font-weight: bold; 
    text-transform: uppercase; 
    color: black; 
    background: #fff; 
}

.rasso-infos { 
    font-size: 13px; 
    color: #aaa; 
    margin-top: 5px; 
    line-height: 1.4; 
}

.rasso-actions { 
    margin-top: 10px; 
    display: flex; 
    gap: 10px; 
    border-top: 1px solid #333; 
    padding-top: 10px; 
}

/* BOUTONS ACTIONS LISTE */
.btn-fire { 
    background: #2d3436; 
    color: #ff7675; 
    border: 1px solid #ff7675; 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 12px; 
    cursor: pointer; 
    transition: 0.2s; 
}

.btn-fire.active { 
    background: #ff7675; 
    color: white; 
}

.btn-icon { 
    background: transparent; 
    border: 1px solid #555; 
    color: #aaa; 
    padding: 6px 10px; 
    border-radius: 50%; 
    cursor: pointer; 
}

/* =========================================
   7. STYLES MARKERS (HUD STYLAX)
========================================= */
.map-marker {
    width: 44px; 
    height: 44px; 
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 24px;
    background: rgba(20, 20, 20, 0.85); 
    border: 3px solid;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s ease; 
    animation: markerFloat 3s ease-in-out infinite;
}

.map-marker:hover { 
    transform: scale(1.15); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.5); 
}

/* Couleurs Néons */
.marker-Rasso { 
    border-color: #ff3b3b; 
    box-shadow: 0 0 15px rgba(255, 59, 59, 0.5), inset 0 0 10px rgba(255, 59, 59, 0.2); 
}

.marker-Garage { 
    border-color: #0984e3; 
    box-shadow: 0 0 15px rgba(9, 132, 227, 0.5), inset 0 0 10px rgba(9, 132, 227, 0.2); 
}

.marker-Detailing { 
    border-color: #a29bfe; 
    box-shadow: 0 0 15px rgba(162, 155, 254, 0.5), inset 0 0 10px rgba(162, 155, 254, 0.2); 
}

.marker-Photographe { 
    border-color: #55efc4; 
    box-shadow: 0 0 15px rgba(85, 239, 196, 0.5), inset 0 0 10px rgba(85, 239, 196, 0.2); 
}

.marker-Convoi { 
    border-color: #e67e22; 
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.5), inset 0 0 10px rgba(230, 126, 34, 0.2); 
}

@keyframes markerFloat { 
    0%, 100% { transform: translateY(0); } 
    50% { transform: translateY(-4px); } 
}

/* =========================================
   8. MODALES & BOUTONS
========================================= */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.85); 
    z-index: 6000; 
    justify-content: center; 
    align-items: flex-end; 
    backdrop-filter: blur(5px); 
}

.modal-content { 
    background: #111; 
    width: 100%; 
    max-width: 500px; 
    border-radius: 20px 20px 0 0; 
    padding: 25px; 
    border-top: 1px solid #333; 
    animation: slideUp 0.3s; 
    max-height: 85vh; 
    overflow-y: auto; 
    margin: 0 auto; 
}

@media (min-width: 768px) { 
    .modal { align-items: center; } 
    .modal-content { border-radius: 20px; width: 90%; } 
}

.close-modal { 
    float: right; 
    font-size: 28px; 
    cursor: pointer; 
    color: #777; 
    line-height: 20px; 
}

/* BOUTONS CLASSIQUES */
.btn-main { 
    background: #ff3b3b; 
    color: white; 
    border: none; 
    padding: 14px; 
    width: 100%; 
    border-radius: 10px; 
    font-weight: bold; 
    cursor: pointer; 
    text-transform: uppercase; 
    margin-top: 10px; 
    font-size: 14px; 
}

.btn-outline { 
    background: transparent; 
    border: 1px solid #555; 
    color: #ccc; 
    padding: 12px; 
    width: 100%; 
    border-radius: 10px; 
    cursor: pointer; 
    margin-top: 10px; 
}

/* BOUTON AVIS "PILULE NÉON" */
.btn-reviews {
    background: linear-gradient(135deg, #6c5ce7, #0984e3);
    color: white;
    border: none;
    padding: 15px;
    width: 100%;
    border-radius: 50px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(108, 92, 231, 0.4);
    transition: all 0.3s ease;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px;
}

.btn-reviews:active { 
    transform: scale(0.95); 
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.6); 
}

/* COCKPIT & DIVERS */
.speed-circle { 
    width: 220px; 
    height: 220px; 
    border: 6px solid #ff3b3b; 
    border-radius: 50%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    margin: 60px auto; 
    box-shadow: 0 0 40px rgba(255, 59, 59, 0.4); 
    background: rgba(0,0,0,0.6); 
}

.speed-value { 
    font-size: 90px; 
    font-weight: bold; 
} 

.speed-unit { 
    font-size: 18px; 
    color: #aaa; 
}

.hud-grid { 
    display: flex; 
    justify-content: center; 
    gap: 40px; 
    margin-top: 30px; 
}

.hud-data { 
    font-size: 28px; 
    font-weight: bold; 
    color: #00b894; 
    text-shadow: 0 0 10px rgba(0, 184, 148, 0.4); 
}

.btn-exit-cockpit { 
    background: transparent; 
    border: 1px solid #333; 
    color: #666; 
    margin-top: 50px; 
    padding: 10px 30px; 
    border-radius: 30px; 
    cursor: pointer; 
    font-size: 12px; 
    letter-spacing: 2px; 
}

.weather-badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    padding: 8px 15px; 
    border-radius: 20px; 
    margin-top: 10px; 
    font-size: 14px; 
    color: #fff; 
}

@keyframes slideUp { 
    from { transform: translateY(50px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}

/* =========================================
   9. BOUTON GOOGLE PREMIUM
========================================= */
.btn-google {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-google:active {
    transform: scale(0.98);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* =========================================
   10. MODE PRO CERTIFIÉ 👑
========================================= */
.marker-Premium {
    background: linear-gradient(135deg, #ffd700, #f39c12) !important;
    color: black !important;
    border: 2px solid white !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
}

.badge-premium {
    background: #ffd700;
    color: black;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 900;
    margin-right: 5px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    text-transform: uppercase;
}

.promo-box {
    background: rgba(255, 215, 0, 0.1);
    border: 1px dashed #ffd700;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    color: #ffd700;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
}

.card-premium {
    border: 1px solid #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

/* =========================================
   11. TEMPLATE STORY INSTA (CACHÉ)
========================================= */
#storyTemplate {
    position: fixed; 
    top: -9999px; 
    left: -9999px; 
    width: 1080px; 
    height: 1920px; 
    background: #050505;
    background-image: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    color: white; 
    font-family: 'Rajdhani', sans-serif;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 80px; 
    text-align: center; 
    border: 20px solid #ff3b3b;
    box-sizing: border-box; 
    z-index: -1;
}

.st-logo { 
    font-size: 150px; 
    margin-bottom: 20px; 
}

.st-badge { 
    background: #ff3b3b; 
    color: white; 
    padding: 20px 50px; 
    border-radius: 50px; 
    font-size: 70px; 
    font-weight: 900; 
    margin-bottom: 80px; 
    text-transform: uppercase; 
}

.st-title { 
    font-size: 90px; 
    font-weight: 900; 
    color: white; 
    text-transform: uppercase; 
    margin-bottom: 40px; 
    line-height: 1.1; 
}

.st-date { 
    font-size: 60px; 
    color: #ffd700; 
    margin-bottom: 30px; 
    font-weight: bold; 
}

.st-address { 
    font-size: 50px; 
    color: #ccc; 
    margin-bottom: 120px; 
}

.st-footer { 
    font-size: 45px; 
    color: #777; 
    font-style: italic; 
    margin-top: auto; 
}

.st-footer strong { 
    color: #ff3b3b; 
}

/* =========================================
   12. MESSAGES TOAST (ALERTES FLOTTANTES)
========================================= */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999; 
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; 
    width: 90%; 
    max-width: 400px;
}

.toast {
    background: rgba(20, 20, 20, 0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: bold;
    border: 2px solid #ff3b3b;
    box-shadow: 0 5px 25px rgba(255, 59, 59, 0.4);
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto; 
}

.toast.error {
    border-color: #ff5555;
    box-shadow: 0 5px 25px rgba(255, 85, 85, 0.4);
}

/* =========================================
   13. TCHAT EN DIRECT & GARAGE PHOTOS
========================================= */
.chat-container {
    background: #111; border-radius: 12px; border: 1px solid #333; margin-top: 15px;
    display: flex; flex-direction: column; height: 300px;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px;
}
.chat-msg {
    display: flex; gap: 10px; align-items: flex-start; animation: slideUp 0.3s ease;
}
.chat-msg img {
    width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 1px solid #ff3b3b;
}
.chat-bubble {
    background: #222; padding: 8px 12px; border-radius: 12px; border-top-left-radius: 0; 
    font-size: 14px; color: #ddd; max-width: 85%; line-height: 1.4;
}
.chat-bubble strong { display: block; color: #00b894; font-size: 11px; margin-bottom: 3px; text-transform: uppercase; }
.chat-input-area {
    display: flex; gap: 5px; padding: 10px; border-top: 1px solid #333; background: #1a1a1a; border-radius: 0 0 12px 12px;
}
.chat-input-area input { margin: 0; padding: 12px; font-size: 14px; border-radius: 30px; }
.chat-input-area button { width: auto; padding: 10px 20px; border-radius: 30px; }

.garage-car-img {
    width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin-top: 10px; border: 1px solid #333;
}
