/* style.css — Mise en page de l'application (3D plein cadre + panneaux). */

:root {
  --bg: #0f1620;
  --panel: #182230;
  --card: #1f2b3a;
  --text: #e7eef6;
  --muted: #9fb0c0;
  --accent: #3a7bd5;
  --clear: #28aa6e;
  --blocked: #e23c3c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#header {
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid #0a0f16;
}
#header h1 {
  margin: 0 0 4px;
  font-size: 18px;
}
#header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 1100px;
  line-height: 1.4;
}

#layout {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

#map {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

#panel {
  width: 320px;
  flex: 0 0 320px;
  background: var(--panel);
  padding: 12px;
  overflow-y: auto;
  border-left: 1px solid #0a0f16;
}

.card {
  background: var(--card);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.results {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  margin: 0;
  font-size: 13.5px;
}
.results dt {
  color: var(--muted);
}
.results dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.verdict {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  background: #2a3647;
}
.verdict.clear {
  background: rgba(40, 170, 110, 0.2);
  color: var(--clear);
}
.verdict.blocked {
  background: rgba(226, 60, 60, 0.2);
  color: var(--blocked);
}

.ctrl {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}
.ctrl input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  background: #0f1620;
  border: 1px solid #2a3647;
  border-radius: 6px;
  color: var(--text);
}
.ctrl input[type="range"] {
  width: 100%;
  margin-top: 6px;
}
.hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #74879a;
}

.btn {
  width: 100%;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.08);
}

.toggles {
  margin-top: 14px;
  border: 1px solid #2a3647;
  border-radius: 6px;
  padding: 8px 10px;
}
.toggles legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.toggles label {
  display: block;
  font-size: 13px;
  margin: 4px 0;
  cursor: pointer;
}
/* Cases à cocher et boutons radio du panneau : même teinte que les actions. */
.toggles input[type="checkbox"],
.toggles input[type="radio"] {
  accent-color: var(--accent);
  margin-right: 4px;
  vertical-align: -1px;
}
.toggles input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggles .hint {
  margin-top: 6px;
}

.status {
  background: #243247;
  border: 1px solid #31465f;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.status.error {
  background: rgba(226, 60, 60, 0.15);
  border-color: var(--blocked);
  color: #ffb3b3;
}

#profil {
  flex: 0 0 auto;
  height: 260px;
  background: var(--panel);
  border-top: 1px solid #0a0f16;
  padding: 8px 14px 12px;
  transition: height 0.2s ease;
  overflow: hidden;
}
#profil h2 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}
#profil.collapsed {
  height: 0;
  padding: 0 14px;
}
.chart-wrap {
  position: relative;
  height: 210px;
}

/* Lisibilité des contrôles MapLibre sur fond sombre. */
.maplibregl-ctrl-attrib {
  font-size: 10px;
}

/* Boussole : orientation cardinale de la caméra 3D, superposée à la carte
   (haut à gauche, pour ne pas recouvrir le NavigationControl en haut à droite). */
.compass-ctrl {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 34px);
  grid-auto-rows: 34px;
  gap: 4px;
  padding: 6px;
  background: rgba(24, 34, 48, 0.85);
  border: 1px solid #2a3647;
  border-radius: 8px;
}
.compass-btn {
  padding: 0;
  background: var(--card);
  color: var(--text);
  border: 1px solid #2a3647;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.compass-btn:hover {
  filter: brightness(1.15);
  border-color: var(--accent);
}

/* Aide-mémoire discret des interactions de navigation, sous la boussole. */
.nav-hint {
  position: absolute;
  top: 92px;
  left: 10px;
  z-index: 2;
  max-width: 190px;
  margin: 0;
  padding: 6px 8px;
  background: rgba(24, 34, 48, 0.85);
  border: 1px solid #2a3647;
  border-radius: 8px;
  color: var(--muted, #9fb0c3);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

@media (max-width: 820px) {
  #layout {
    flex-direction: column;
  }
  #panel {
    width: 100%;
    flex: 0 0 auto;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid #0a0f16;
  }
}
