/* ======================================================
   DRONE OPS GAE — map.css
   Panel carte / vue 3D : radar slider, contrôles, canvas
   ====================================================== */

/* --- CONTENEUR CARTE (colonne gauche) --- */
.map-panel {
    position: relative;
    flex: 1;           /* prend toute la hauteur disponible dans la colonne */
    min-height: 0;
}

/* ⚠️ CRITIQUE — Leaflet EXIGE une hauteur explicite sur #map
   Sans ça la carte reste noire / invisible                     */
#map {
    width: 100%;
    flex: 1;           /* s'étire dans le flex parent (.map-panel) */
    min-height: 0;
    height: 100%;      /* fallback pour les navigateurs sans flex support */
    border-radius: 0 0 var(--radius) var(--radius);
    background: #0b111a;
}

/* Forcer le fond sombre de Leaflet */
.leaflet-container {
    background: #0b111a !important;
    font-family: "Barlow Condensed", sans-serif;
}

.leaflet-tile {
    image-rendering: auto;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform, opacity;
}

.leaflet-tile-container {
    will-change: transform;
}

.leaflet-maplibre-gl-layer,
.maplibregl-canvas-container,
.maplibregl-canvas {
    width: 100% !important;
    height: 100% !important;
}

.maplibregl-canvas {
    outline: none;
}

.leaflet-maplibre-gl-layer .maplibregl-control-container {
    display: none;
}

/* Adapter les popups Leaflet au thème */
.leaflet-popup-content-wrapper {
    background: #16202c;
    color: #eef3f8;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.leaflet-popup-tip {
    background: #16202c;
}

.leaflet-popup-close-button {
    color: rgba(148,163,184,.7) !important;
}

.leaflet-popup-close-button:hover {
    color: #eef3f8 !important;
}

.leaflet-top,
.leaflet-bottom {
    z-index: 700;
}

.leaflet-control-layers,
.leaflet-control-zoom a {
    border-color: rgba(2, 9, 18, .16) !important;
    box-shadow: 0 6px 18px rgba(2, 9, 18, .18);
}

/* --- CANVAS / VUE 3D --- */
#mapCanvas,
#terrainCanvas,
#scene3d {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    display: block;
}

/* --- CONTRÔLES RADAR (overlay sur la carte) --- */
.radar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    flex-wrap: wrap;
}

/* Slider d'animation radar */
#radar-slider {
    appearance: none;
    height: 3px;
    width: 80px;
    background: #1a2d44;
    border-radius: 2px;
    outline: none;
}

#radar-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2c7be5;
    cursor: pointer;
    box-shadow: 0 0 6px #2c7be5;
}

/* Select vitesse animation radar */
#radar-speed {
    background: #0b111a;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 4px;
    color: #eef3f8;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    outline: none;
    cursor: pointer;
}

/* Label horodatage radar */
#radar-time {
    font-size: 10px;
    letter-spacing: 1px;
    color: #2c7be5;
    font-weight: 700;
}

/* --- OVERLAY COORDONNÉES / HUD --- */
.map-hud {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(11, 17, 26, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    pointer-events: none;
    z-index: 10;
}

.map-hud strong {
    color: var(--accent);
}

/* --- LÉGENDE SOURCES / DROITS COUCHES --- */
.map-source-legend {
    max-width: min(460px, calc(100vw - 160px));
    padding: 4px 7px;
    background: rgba(6, 15, 30, .88);
    color: #cbd5e1;
    border: 1px solid rgba(56, 189, 248, .2);
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(0,0,0,.25);
    backdrop-filter: blur(12px);
    font-family: "Barlow Condensed", sans-serif;
}

.map-source-title {
    display: inline;
    margin-right: 8px;
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.map-source-details {
    margin: 0;
}

.map-source-details summary {
    display: none;
}

.map-source-line {
    display: inline;
    padding: 0;
}

.map-source-name {
    color: #f8fafc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
}

.map-source-line + .map-source-line::before {
    content: " · ";
    color: rgba(148, 163, 184, .58);
}

.map-source-owner {
    display: none;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.35;
}

.map-source-note {
    display: none;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(56,189,248,.16);
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
}

/* ── POPUP RTBA — au-dessus de tout ── */
.rtba-popup {
    z-index: 9999 !important;
}

.rtba-popup .leaflet-popup-content-wrapper {
    background: rgba(2,9,18,.97) !important;
    border: 1px solid rgba(220,38,38,.4) !important;
    border-radius: 8px !important;
    padding: 0 !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.85) !important;
}

.rtba-popup .leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

.rtba-popup .leaflet-popup-tip {
    background: rgba(2,9,18,.97) !important;
}

.rtba-popup .leaflet-popup-close-button {
    color: rgba(148,163,184,.5) !important;
    top: 4px !important;
    right: 6px !important;
    font-size: 16px !important;
    z-index: 10000 !important;
}

/* ── POPUP SIA — plus opaque et lisible ── */
.sia-popup {
    z-index: 9998 !important;
}

.sia-popup .leaflet-popup-content-wrapper {
    background: rgba(10, 19, 31, .98) !important;
    border: 1px solid rgba(56, 189, 248, .22) !important;
    border-radius: 10px !important;
    padding: 0 !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .72) !important;
    backdrop-filter: blur(10px);
}

.sia-popup .leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

.sia-popup .leaflet-popup-tip {
    background: rgba(10, 19, 31, .98) !important;
}

.sia-popup .leaflet-popup-close-button {
    top: 6px !important;
    right: 8px !important;
    font-size: 16px !important;
    z-index: 10000 !important;
}
