/* --- Structure & Carte --- */
#map { height: calc(100vh - 180px); width: 100%; border-radius: 8px; z-index: 1; }
.filter-bar { background: #fff; padding: 15px; border-bottom: 2px solid #eee; }

/* --- Marqueur Position Utilisateur (GPS) --- */
.user-location {
    background-color: #3880ff;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.user-location::after {
    content: ""; position: absolute; width: 100%; height: 100%;
    border-radius: 50%; background: #3880ff;
    animation: pulsate 2s infinite; opacity: 0.5; z-index: -1;
}
@keyframes pulsate {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(3); opacity: 0; }
}

/* --- Marqueurs DPE avec Lettres --- */
.dpe-marker-container {
    display: flex; justify-content: center; align-items: center;
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid #fff; color: white; font-weight: bold;
    font-size: 16px; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* --- Animation Nouveau DPE (-15j) --- */
.pulse-recent {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    animation: pulse-gold 1.5s infinite;
    border: 3px solid #ffd700 !important;
}
@keyframes pulse-gold {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* --- Overrides Leaflet & Bootstrap --- */
.leaflet-popup-content-wrapper { border-radius: 12px; padding: 5px; }
.btn-sm { font-weight: bold; text-transform: uppercase; font-size: 0.7rem; }


.animate-flash {
    animation: flash 1s steps(2, start) infinite;
}
@keyframes flash {
    to { visibility: hidden; }
}

/* Carte plein écran moins les barres */
#map { 
    height: calc(100vh - 120px); 
    width: 100%; 
    z-index: 1; 
}

/* --- Marqueurs Géants pour le pouce --- */
.dpe-marker-container {
    width: 60px !important;  /* Encore plus grand */
    height: 60px !important;
    font-size: 24px !important; /* Lettre très lisible */
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: white;
    font-weight: 900;
}

/* --- Le volet coulissant (Bottom Sheet) --- */
/* --- LE VOLET COULISSANT --- */
/* --- LE VOLET COULISSANT --- */
#bottom-sheet {
    position: fixed;
    bottom: -100vh; /* Cache tout en bas */
    left: 0; right: 0;
    background: #ffffff;
    z-index: 9999 !important; /* DOIT ÊTRE AU DESSUS DE TOUT */
    height: 90vh; 
    border-radius: 25px 25px 0 0;
    padding: 20px;
    overflow-y: auto;
    transition: bottom 0.4s ease-out; /* Animation fluide */
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    display: block !important;
}

#bottom-sheet.active {
    bottom: 0 !important; /* On le remonte au bord */
	transition: bottom 0.3s cubic-bezier(0.4, 0, 1, 1); /* Transition plus sèche pour la descente */
}

#sheet-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000; /* Juste sous le volet */
    display: none;
}

/* Bouton fermer GÉANT */
.btn-close-large {
    width: 50px; height: 50px; border-radius: 50%;
    background: #f1f3f5; border: none; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
}

/* Marqueurs sur la carte */
.dpe-marker-container {
    width: 60px !important; height: 60px !important;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; color: #fff; font-weight: 900;
    font-size: 22px !important; border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Grille technique DPE */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.tech-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #eee;
    text-align: center;
}
.tech-label { font-size: 0.65rem; text-transform: uppercase; font-weight: 800; color: #888; display: block; margin-bottom: 2px; }
.tech-val { font-size: 0.85rem; font-weight: 700; color: #333; line-height: 1.1; display: block; }

/* Boutons CRM (Enum) */
/* --- BOUTONS CRM ÉLÉGANTS --- */
.crm-status-group { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-bottom: 20px; 
}
.crm-status-group input[type="radio"] { 
    display: none !important; /* On cache le rond */
}
.crm-status-group label {
    flex: 1; 
    min-width: 80px; 
    padding: 15px 5px; 
    border-radius: 12px; 
    border: 3px solid #f1f5f9;
    font-size: 0.75rem; 
    font-weight: 900; 
    text-align: center; 
    cursor: pointer; 
    background: #fff; 
    color: #64748b;
    text-transform: uppercase;
}

/* Changement de couleur quand COCHÉ */
#st_1:checked + label { border-color: #3b82f6; background: #eff6ff; color: #3b82f6; }
#st_2:checked + label { border-color: #10b981; background: #ecfdf5; color: #10b981; }
#st_3:checked + label { border-color: #f59e0b; background: #fffbeb; color: #f59e0b; }
#st_5:checked + label { border-color: #64748b; background: #f1f5f9; color: #1e293b; }
#st_4:checked + label { border-color: #ef4444; background: #fef2f2; color: #ef4444; }
/* Bouton Aide / Barème flottant */
#help-btn {
    position: fixed;
    top: 65px; /* Sous la top-bar */
    left: 15px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1500;
    font-weight: bold;
    color: #0d6efd;
    border: 2px solid #0d6efd;
}
@media (max-width: 767.98px) {
#help-btn	{
        top: 85px; 
	}
	
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Keyframe pour les badges (si non déjà défini) */
@keyframes badgeFlash {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; background-color: #0d6efd !important; }
    100% { transform: scale(1); opacity: 1; }
}


/* Valeur chiffrée sous la lettre dans le volet */
.val-under-letter {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    margin-top: -5px;
    opacity: 0.8;
}

/* Tableau du barème DPE */
.bareme-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}
.bareme-table td { padding: 8px; border-bottom: 1px solid #eee; font-weight: bold; }
.bareme-color { width: 30px; border-radius: 4px; }

/* Grille d'actions 2 colonnes x 3 lignes pour être bien gros sur mobile */
.action-flash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 grosses colonnes */
    gap: 15px;
    margin-top: 20px;
}

.action-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s active;
}

.action-item:active { transform: scale(0.95); background: #f1f5f9; }

.action-icon { font-size: 2.2rem; margin-bottom: 5px; display: block; }
.action-label { font-size: 0.8rem; font-weight: 900; text-transform: uppercase; color: #475569; }

/* Bouton FAIT (Le plus important) */
.btn-fait {
    background: #10b981 !important;
    border-color: #059669 !important;
}
.btn-fait .action-label { color: white !important; }

/* Bouton Refus/Masquer */
.btn-danger-light { border-color: #fecaca; }
.btn-dark-light { border-color: #cbd5e1; }

/* Brique Argumentaire Expert */
.pitch-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 5px solid #3b82f6;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}
.pitch-title {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #1e40af;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pitch-text {
    font-size: 0.95rem;
    color: #1e3a8a;
    line-height: 1.5;
    font-style: italic;
}
.pitch-highlight {
    background: #fde047;
    font-weight: bold;
    padding: 0 4px;
}

/* Animation de disparition du marqueur */
@keyframes markerExplode {
    0% { 
        transform: scale(1); 
        filter: brightness(1) blur(0);
        opacity: 1;
    }
    30% { 
        transform: scale(3.5); /* Explosion massive pour bien la voir */
        filter: brightness(2.5) blur(2px);
        opacity: 0.8;
    }
    60% {
        transform: scale(3.2);
        filter: brightness(3) blur(5px);
        opacity: 0.4;
    }
    100% { 
        transform: scale(0); 
        filter: brightness(5) blur(20px); /* Disparition dans un nuage */
        opacity: 0;
    }
}

.marker-exploding {
    /* Durée portée à 1.2s avec une courbe de sortie lente */
    animation: markerExplode 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
    z-index: 10000 !important;
}

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}