body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Rajdhani', sans-serif;
    background-color: #0b0f19;
    color: #ffffff;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Panneau de contrôle principal (Desktop) */
.ui-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 340px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

.header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.live-indicator {
    width: 10px;
    height: 10px;
    background-color: #ff3b30;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #ff3b30;
    margin-right: 10px;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 15px #ff3b30; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.header h1 span {
    color: #ff3b30;
}

/* Sélecteur de département */
.dept-selector {
    margin-bottom: 20px;
}

.dept-selector label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 6px;
    font-weight: 600;
}

.dept-selector select {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

.dept-selector select option {
    background: #0b0f19;
    color: white;
}

/* Grille des statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-box.danger {
    border-color: rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.05);
}

.stat-box.info {
    border-color: rgba(0, 122, 255, 0.3);
    background: rgba(0, 122, 255, 0.05);
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 0.5px;
}

.wind-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wind-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Liste des alertes */
.alerts-list h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #bbb;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

#alerts-container {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

#alerts-container::-webkit-scrollbar {
    width: 4px;
}

#alerts-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.alert-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #ff3b30;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.alert-time {
    display: block;
    font-size: 0.75rem;
    color: #ff8a84;
    margin-bottom: 2px;
}

.alert-item strong {
    font-size: 0.85rem;
    color: #fff;
}

.loading {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 10px;
    font-size: 0.9rem;
}

/* Animation des marqueurs de feu sur la carte */
.fire-pulse-icon {
    position: relative;
    width: 40px;
    height: 40px;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.4);
    animation: pulse-ring 2s infinite;
}

.pulse-core {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 10px #ff3b30;
}

@keyframes pulse-ring {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Bouton mobile par défaut masqué sur PC */
#mobile-toggle {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: #ff3b30;
    color: white;
    border: none;
    padding: 10px 15px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* --- Styles spécifiques pour les écrans mobiles (smartphones) --- */
@media screen and (max-width: 768px) {
    #mobile-toggle {
        display: block; /* Visible sur mobile */
    }

    .ui-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 45vh !important;
        transform: translateY(100%); /* Masqué par défaut en bas */
        transition: transform 0.3s ease-in-out;
        border-radius: 16px 16px 0 0 !important;
        z-index: 999;
        background: rgba(11, 15, 25, 0.95) !important;
        backdrop-filter: blur(15px);
        padding: 15px !important;
    }

    .ui-panel.mobile-open {
        transform: translateY(0) !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .stat-box {
        padding: 8px !important;
    }

    .stat-value {
        font-size: 1.3rem !important;
    }

    .alerts-list {
        max-height: 100px !important;
    }
}
/* === Ajouts : bandeau anomalie, badges catégories, drone === */
#anomaly-banner {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid #ff3b30;
    color: #ff8a84;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    animation: pulse-dot 1.8s infinite;
}

.breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.breakdown .badge {
    border: 1px solid;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
}

.drone-icon {
    font-size: 22px;
    text-align: center;
    filter: drop-shadow(0 0 6px #007aff);
}

.weak-toggle {
    margin-bottom: 14px;
    font-size: 0.8rem;
}

.weak-toggle a {
    color: #ffcc00;
    text-decoration: none;
    cursor: pointer;
}

.weak-toggle a:hover {
    text-decoration: underline;
}

#reset-view-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 122, 255, 0.9);
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
#reset-view-btn:hover { background: rgba(0, 122, 255, 1); }

.fwi-btn {
    width: 100%;
    background: rgba(255, 149, 0, 0.12);
    border: 1px solid rgba(255, 149, 0, 0.4);
    color: #ff9500;
    padding: 9px;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.2s;
}
.fwi-btn:hover { background: rgba(255, 149, 0, 0.2); }
.fwi-btn.active {
    background: rgba(255, 149, 0, 0.3);
    border-color: #ff9500;
    color: #fff;
}
