/**
 * (841) AlsaéroMap : habillage de la carte réseau (public/reseau.php) et des silhouettes d'avions de la carte Flotte.
 * Feuille séparée de style.css pour ne rien casser ailleurs : chaque règle est limitée à `.alsaeromap` (carte réseau) ou à des classes propres
 * (`.vaa-plane`, `.vaa-apt`, `.np-*`, `.alsaeromap-*`). Les couleurs du site (jetons --surface, --border, --text…) suivent les trois thèmes.
 */

/* ---------- Barre d'outils : recherche, filtres, étiquettes ---------- */
.alsaeromap-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 12px; }
.alsaeromap-search { position: relative; flex: 1 1 240px; min-width: 190px; max-width: 420px; }
.alsaeromap-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.alsaeromap-search input:focus { outline: 2px solid var(--vaa-blue-500); outline-offset: 1px; }
.alsaeromap-search::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa5b1' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E");
    pointer-events: none;
}
.alsaeromap-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; flex: 1 1 100%; }
.alsaeromap-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.alsaeromap-group__title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-right: 2px; }
.alsaeromap-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 12.5px;
    line-height: 1.25;
    cursor: pointer;
    transition: opacity var(--vaa-transition), background var(--vaa-transition);
}
.alsaeromap-chip:hover { background: var(--surface-alt); }
.alsaeromap-chip[aria-pressed="false"] { opacity: .45; background: transparent; }
.alsaeromap-chip__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.alsaeromap-chip svg { width: 15px; height: 15px; flex: none; }
.alsaeromap-chip__n { font-weight: 700; font-variant-numeric: tabular-nums; }
.alsaeromap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
.alsaeromap-tools select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 12.5px;
}
.alsaeromap-reset { border: 0; background: none; color: var(--vaa-blue-500); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.alsaeromap-count { font-variant-numeric: tabular-nums; }

/* ---------- Carte ---------- */
.alsaeromap .network-map { height: 620px; }
.alsaeromap .network-map__panel { flex-basis: 340px; width: 340px; max-height: 620px; }
@media (max-width: 700px) {
    .alsaeromap .network-map { height: 460px; }
    .alsaeromap .network-map__panel { width: 100%; flex-basis: auto; max-height: 360px; }
}
/* Fond de carte OpenStreetMap assombri (sans changer de fournisseur) quand le site est en thème sombre ou anthracite. */
:root:is([data-theme="dark"], [data-theme="anthracite"]) .vaa-tiles--auto,
.vaa-tiles--dark { filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.9) saturate(.75); }
:root:is([data-theme="dark"], [data-theme="anthracite"]) .alsaeromap .leaflet-container { background: #1b2230; }

/* ---------- Avions ---------- */
.network-map__plane-icon { background: transparent; border: none; }
/* Déplacement fluide : entre deux relevés (20 s) l'avion glisse vers sa nouvelle position au lieu de sauter. Coupé pendant un zoom (Leaflet anime lui-même). */
.alsaeromap .network-map__plane-icon.leaflet-marker-icon { transition: transform 20s linear; }
.alsaeromap.leaflet-zoom-anim .network-map__plane-icon.leaflet-marker-icon,
.alsaeromap .leaflet-zoom-anim .network-map__plane-icon.leaflet-marker-icon,
.alsaeromap.vaa-no-glide .network-map__plane-icon.leaflet-marker-icon { transition: none; }
.vaa-plane { position: relative; width: 100%; height: 100%; cursor: pointer; }
.vaa-plane__scale { position: relative; width: 100%; height: 100%; transform: scale(var(--vaa-scale, 1)); transform-origin: 50% 50%; transition: transform .25s ease; }
.vaa-plane__rot, .vaa-plane__srot { position: absolute; inset: 0; transform-origin: 50% 50%; }
.vaa-plane__rot { transition: transform 1.2s ease; }
.vaa-plane__srot { transition: transform 1.2s ease; }
/* Trois dessins par avion (silhouette, flèche, point), centrés ; `data-ic` sur la carte dit lequel s'affiche (réglage « Icônes » + zoom). */
.vaa-ic { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; line-height: 0; }
.vaa-ic svg { display: block; }
.alsaeromap[data-ic="sil"] .vaa-ic--sil, .alsaeromap[data-ic="detail"] .vaa-ic--sil,
.alsaeromap[data-ic="simple"] .vaa-ic--simple, .alsaeromap[data-ic="dot"] .vaa-ic--dot { display: block; }
/* (851) Icônes illustrées : le dessin vectoriel s'efface au profit de l'illustration aux niveaux « normal » et « détail » ; flèche et point restent
   ceux du réglage ou des zooms éloignés. */
.alsaeromap[data-style="illu"] .vaa-ic--sil { display: none; }
.alsaeromap[data-style="illu"][data-ic="sil"] .vaa-ic--illu, .alsaeromap[data-style="illu"][data-ic="detail"] .vaa-ic--illu { display: block; }
.vaa-ic--illu { width: 0; height: 0; }
.vaa-illu { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: block; max-width: none; user-select: none; pointer-events: none; }
/* Anneau de la phase de vol sous l'illustration (couleur de phase ; liseré = réseau). */
.vaa-illu-ring { position: absolute; left: 50%; top: 50%; width: var(--ring, 30px); height: var(--ring, 30px); margin: calc(var(--ring, 30px) / -2) 0 0 calc(var(--ring, 30px) / -2); box-sizing: border-box; border-radius: 50%; border: 2.5px solid var(--pc, #1d4e89); box-shadow: 0 0 0 1.5px var(--sc, #fff); }
.vaa-illu-ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--pc, #1d4e89); opacity: .3; }
.vaa-plane__rot { filter: drop-shadow(0 1px 1.4px rgba(0, 0, 0, .35)); }
/* Ombre portée (niveau « détail », silhouettes seulement) : décalée vers le bas à droite d'autant plus que l'avion est haut. */
.vaa-plane__shadow { position: absolute; inset: 0; opacity: 0; transform: translate(var(--sh, 0px), var(--sh, 0px)); filter: blur(1.4px); pointer-events: none; transition: transform 1.2s ease, opacity .3s ease; }
.vaa-plane__shadow svg, .vaa-plane__shadow img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.vaa-plane__shadow svg { display: block; }
.vaa-plane__shadow img { display: none; filter: brightness(0); max-width: none; }
.alsaeromap[data-style="illu"] .vaa-plane__shadow svg { display: none; }
.alsaeromap[data-style="illu"] .vaa-plane__shadow img { display: block; }
.alsaeromap[data-ic="detail"] .vaa-plane__shadow { opacity: .3; }
/* Vecteur de cap et de vitesse (option) : trait devant le nez, de longueur proportionnelle à la vitesse sol. */
.vaa-plane__vec { position: absolute; left: 50%; bottom: 100%; width: 2px; margin-left: -1px; height: var(--vl, 0px); display: none; border-radius: 1px; background: linear-gradient(to top, var(--vc, #fff), rgba(255, 255, 255, 0)); filter: drop-shadow(0 0 1px rgba(0, 0, 0, .7)); pointer-events: none; }
.alsaeromap--vec .vaa-plane__vec { display: block; }
.alsaeromap[data-ic="simple"] .vaa-plane__vec { bottom: calc(50% + var(--cs, 20) * .46px); }
.alsaeromap[data-ic="dot"] .vaa-plane__vec { bottom: calc(50% + var(--ds, 12) * .5px); }
/* Fond de carte sombre (thème sombre/anthracite avec le fond automatique, ou fonds « Sombre » / satellite) : couleurs éclaircies et halo clair autour du halo sombre. */
:root:is([data-theme="dark"], [data-theme="anthracite"]) .alsaeromap:where(:not([data-style="illu"]))[data-base="auto"] .vaa-plane__rot,
.alsaeromap:where(:not([data-style="illu"])):is([data-base="dark"], [data-base="mbdark"], [data-base="mbsat"]) .vaa-plane__rot { filter: brightness(1.45) saturate(1.1) drop-shadow(0 0 2px rgba(255, 255, 255, .6)); }
/* (851) Icônes illustrées sur fond sombre : leurs couleurs d'origine, simple liseré clair pour les détacher du fond. */
:root:is([data-theme="dark"], [data-theme="anthracite"]) .alsaeromap[data-style="illu"][data-base="auto"] .vaa-plane__rot,
.alsaeromap[data-style="illu"]:is([data-base="dark"], [data-base="mbdark"], [data-base="mbsat"]) .vaa-plane__rot { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .75)); }
.vaa-plane__label {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: calc(var(--s, 30) * (var(--vaa-scale, 1) - 1) * .5px + 1px);
    display: none;
    white-space: nowrap;
    pointer-events: none;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .92);
    color: #0b2545;
    font: 600 11px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* Flèche ou point : l'étiquette se place sous le petit dessin, pas sous le grand cadre de la silhouette. */
.alsaeromap[data-ic="simple"] .vaa-plane__label { top: 50%; margin-top: calc(var(--cs, 20) * var(--vaa-scale, 1) * .5px + 3px); }
.alsaeromap[data-ic="dot"] .vaa-plane__label { top: 50%; margin-top: calc(var(--ds, 12) * var(--vaa-scale, 1) * .5px + 3px); }
.vaa-plane__label span { font-weight: 500; color: #4b5563; margin-left: 4px; font-variant-numeric: tabular-nums; }
.alsaeromap--labels .vaa-plane__label, .vaa-plane.is-selected .vaa-plane__label, .vaa-plane.is-emerg .vaa-plane__label { display: block; }
/* Code d'urgence du transpondeur (étiquette, bandeau d'alerte). */
.vaa-sq { font-style: normal; margin-left: 5px; padding: 0 5px; border-radius: 4px; background: #c8102e; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.alsaeromap[data-ic] .vaa-plane.is-selected .vaa-plane__rot { filter: drop-shadow(0 0 3px #ffd24a) drop-shadow(0 0 7px rgba(255, 210, 74, .95)); }
.vaa-plane.is-selected::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid #ffd24a;
    animation: vaa-plane-pulse 1.9s ease-out infinite;
    pointer-events: none;
}
.alsaeromap[data-ic="simple"] .vaa-plane.is-selected::before, .alsaeromap[data-ic="simple"] .vaa-plane.is-emerg::after { inset: calc(50% - var(--cs, 20) * .75px); }
.alsaeromap[data-ic="dot"] .vaa-plane.is-selected::before, .alsaeromap[data-ic="dot"] .vaa-plane.is-emerg::after { inset: calc(50% - var(--ds, 12) * .9px); }
/* Urgence (7500 / 7600 / 7601 / 7700) : avion rouge, halo rouge et anneau rouge qui pulse en permanence. */
.alsaeromap[data-ic] .vaa-plane.is-emerg .vaa-plane__rot { filter: drop-shadow(0 0 3px #ff1744) drop-shadow(0 0 8px rgba(255, 23, 68, .9)); }
.vaa-plane.is-emerg::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 3px solid #e60023;
    animation: vaa-emerg-pulse 1.1s ease-out infinite;
    pointer-events: none;
}
@keyframes vaa-plane-pulse { 0% { transform: scale(.65); opacity: .95; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes vaa-emerg-pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
.alsaeromap--has-selection .vaa-plane:not(.is-selected):not(.is-emerg) { opacity: .55; }
@media (prefers-reduced-motion: reduce) {
    .vaa-plane.is-selected::before, .vaa-plane.is-emerg::after { animation: none; }
    .alsaeromap .network-map__plane-icon.leaflet-marker-icon, .vaa-plane__rot, .vaa-plane__srot, .vaa-plane__scale, .vaa-plane__shadow { transition: none; }
}

/* Bandeau d'alerte transpondeur (au-dessus de la carte). */
.alsaeromap-alerts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.alsaeromap-alerts[hidden] { display: none; }
.alsaeromap-alert { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 0; border-radius: 999px; background: #c8102e; color: #fff; font: 600 13px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; cursor: pointer; box-shadow: 0 0 0 0 rgba(230, 0, 35, .6); animation: vaa-alert-glow 1.6s ease-out infinite; }
.alsaeromap-alert:hover { background: #a50d25; }
.alsaeromap-alert .vaa-sq { background: #fff; color: #c8102e; }
@keyframes vaa-alert-glow { 0% { box-shadow: 0 0 0 0 rgba(230, 0, 35, .55); } 100% { box-shadow: 0 0 0 10px rgba(230, 0, 35, 0); } }
@media (prefers-reduced-motion: reduce) { .alsaeromap-alert { animation: none; } }

/* Repères de départ / arrivée du vol sélectionné. */
.vaa-apt-wrap { background: transparent; border: none; }
.vaa-apt {
    display: inline-block;
    transform: translate(-50%, -50%);
    padding: 1px 7px;
    border: 2px solid #fff;
    border-radius: 7px;
    background: #0b2545;
    color: #fff;
    font: 700 11px/1.35 system-ui, -apple-system, 'Segoe UI', sans-serif;
    letter-spacing: .03em;
    white-space: nowrap;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
}
.vaa-apt--arr { background: #c8102e; }

/* Bouton « Tout voir » de la carte. */
.alsaeromap-fit { background: #fff; color: #1f2933; border: 0; border-radius: 4px; padding: 6px 10px; font: 600 12px system-ui, sans-serif; cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }
.alsaeromap-fit:hover { background: #f1f4f8; }

/* ---------- Fiche de vol (panneau de gauche) ---------- */
.np-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04));
}
.np-hero__icon { flex: 0 0 62px; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.np-hero__icon svg { transform: rotate(90deg); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.np-hero__main { min-width: 0; }
.np-hero__type { font-size: 21px; font-weight: 800; letter-spacing: .02em; line-height: 1.15; }
.np-hero__sub { font-size: 12px; color: rgba(255, 255, 255, .72); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.np-phase { display: inline-block; margin-top: 7px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; }
.np-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin: 14px 0 4px; }
.np-route__icao { font-size: 24px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.np-route__name { font-size: 11px; color: rgba(255, 255, 255, .68); line-height: 1.25; min-height: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.np-alert { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: #c8102e; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .04em; line-height: 1.2; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25) inset; }
.np-alert small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; opacity: .95; }
.np-route__proc { margin-top: 3px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #c4b5fd; font-variant-numeric: tabular-nums; }
.np-route__end--arr { text-align: right; }
.np-route__mid { padding-bottom: 14px; color: rgba(255, 255, 255, .75); }
.np-route__mid svg { width: 22px; height: 22px; transform: rotate(90deg); display: block; }
.np-progress { position: relative; height: 7px; margin: 10px 0 5px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: visible; }
.np-progress__bar { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: var(--np-color, #4d8fe3); transition: width .6s ease; }
.np-progress__bar::after { content: ''; position: absolute; right: -5px; top: 50%; width: 11px; height: 11px; transform: translateY(-50%); border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--np-color, #4d8fe3); }
.np-progress--pending .np-progress__bar::after { display: none; }
.np-progress__legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; }
.np-guess { font-size: 11px; color: rgba(255, 255, 255, .6); margin: 2px 0 0; }
.np-rmk-key { font-weight: 800; text-decoration: underline dotted; text-underline-offset: 3px; }
.np-pilot { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.np-pilot__name { font-size: 18px; font-weight: 700; line-height: 1.2; color: #a9b6ff; }
.np-pilot__grade { margin-top: 3px; font-size: 14px; font-weight: 500; }
.np-pilot__sub { margin-top: 3px; font-size: 13px; opacity: .7; }
.np-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.np-btn {
    flex: 1 1 auto;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .13);
    color: #fff;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--vaa-transition);
}
.np-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.np-btn[aria-pressed="true"] { background: #2f9e52; }
.alsaeromap .network-map__panel-grid { grid-template-columns: repeat(3, 1fr); }
.alsaeromap .network-map__panel-tile-value { font-variant-numeric: tabular-nums; font-size: 14.5px; }

/* ---------- Carte Flotte : silhouettes dans les infobulles et tableaux ---------- */
.fleet-ic { color: var(--vaa-blue-500); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 6px; vertical-align: middle; }
.fleet-ic svg { width: 100%; height: 100%; }
.fleet-ic--tip { color: #1d4e89; }
.fleet-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 1rem; }
