/* ── Feux France — Styles ── */
:root {
    --bg: #0b1121;
    --surface: #131c31;
    --surface-2: #1a2744;
    --text: #e2e8f0;
    --text-2: #94a3b8;
    --accent: #ef4444;
    --accent-2: #f97316;
    --green: #22c55e;
    --blue: #3b82f6;
    --border: #1e3a5f;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --radius: 12px;
}

[data-theme="light"] {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #e8ecf1;
    --text: #1a1a2e;
    --text-2: #6b7280;
    --border: #d1d5db;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

/* ── Header ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    height: 56px;
}
.header-left { display: flex; align-items: center; gap: 0.6rem; }
.header-left .logo { font-size: 1.5rem; }
.header-left h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { font-size: 0.7rem; color: var(--text-2); display: block; }
.header-right { display: flex; align-items: center; gap: 0.5rem; }
.stat { font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--surface-2); }

.btn-icon {
    background: var(--surface-2);
    border: none;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text);
    transition: all 0.2s;
}
.btn-icon:hover {
    background: var(--accent);
    color: white;
}

/* ── Panneau liste ── */
.liste-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 40vh;
    background: var(--surface);
    border-top: 2px solid var(--accent);
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}
.liste-panel.visible { transform: translateY(0); }
.liste-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; font-weight: 700; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.liste-scroll { overflow-y: auto; max-height: calc(40vh - 40px); }
.liste-scroll table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.liste-scroll th { text-align: left; padding: 0.3rem 0.5rem; color: var(--text-2); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.liste-scroll td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
.liste-scroll tr { cursor: pointer; }
.liste-scroll tr:hover { background: var(--surface-2); }

/* ── Contenu SEO ── */
.seo-content {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Carte ── */
#map {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 32px;
    z-index: 1;
}
.leaflet-container {
    background: var(--bg) !important;
}

/* ── Contrôles ── */
.controls {
    position: fixed;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 0.4rem;
    background: var(--surface);
    padding: 0.4rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.ctrl-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ctrl-btn:hover { background: var(--surface-2); color: var(--text); }
.ctrl-btn.active { background: var(--accent); color: white; box-shadow: 0 0 12px rgba(239,68,68,0.4); }

/* ── Légende ── */
.legend {
    position: fixed;
    top: 68px;
    right: 0.75rem;
    z-index: 1000;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-width: 180px;
    font-size: 0.78rem;
}
.legend-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.legend.collapsed .legend-body,
.legend.collapsed .legend-divider,
.legend.collapsed #statDetail { display: none; }
.legend-body { display: flex; flex-direction: column; gap: 0.35rem; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.dot-fire-high { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.dot-fire-med  { background: #f97316; box-shadow: 0 0 4px #f97316; }
.dot-fire-low  { background: #fbbf24; }
.dot-plane { background: #3b82f6; border-radius: 2px; width: 12px; height: 6px; }
.dot-risk  { background: #dc2626; opacity: 0.4; width: 12px; height: 12px; }

.legend-divider { height: 1px; background: var(--border); margin: 0.4rem 0; }

/* ── Info-bulle contrôle ── */
.ctrl-info {
    position: fixed;
    z-index: 1000;
    background: var(--surface);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.78rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}

/* ── Popup personnalisé ── */
.fire-popup .popup-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.fire-popup .popup-row { font-size: 0.8rem; color: var(--text-2); margin-bottom: 0.15rem; }
.fire-popup .popup-row strong { color: var(--text); }
.popup-confiance { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }

/* ── Icônes avions personnalisées ── */
.plane-icon { display: flex; align-items: center; justify-content: center; }
.plane-icon svg { width: 24px; height: 24px; transform-origin: center; }

/* ── Footer ── */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.3rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-2);
    height: 32px;
}
.footer a { color: var(--accent-2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Marqueur cliqué ── */
.leaflet-marker-icon.highlight {
    filter: brightness(1.5) drop-shadow(0 0 8px rgba(239,68,68,0.8));
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .header { padding: 0.5rem 0.75rem; }
    .header-left h1 { font-size: 1rem; }
    .subtitle { display: none; }
    .stat { font-size: 0.7rem; padding: 0.15rem 0.4rem; }
    .legend { display: none; }
    .controls { gap: 0.2rem; padding: 0.3rem; }
    .ctrl-btn { width: 34px; height: 34px; font-size: 1rem; }
    .footer { font-size: 0.55rem; padding: 0.2rem 0.5rem; }
}
