/*
  Explorer, feuille de style.
  Une seule couleur d'accent (un bleu lumineux), un fond sombre facon nuit,
  et un panneau de controle en verre pose par-dessus le globe plein ecran.
*/

/* Les variables : on ecrit nos couleurs une fois ici, puis on les reutilise. */
:root {
  --accent: #4da3ff;            /* la couleur d'accent unique */
  --accent-soft: rgba(77, 163, 255, 0.15);
  --ink: #eaf1fb;              /* texte clair */
  --ink-dim: #9db0c9;         /* texte secondaire, plus discret */
  --panel-bg: rgba(15, 23, 40, 0.82);
  --panel-border: rgba(120, 160, 220, 0.18);
  --field-bg: rgba(255, 255, 255, 0.06);
  --danger: #ff6b6b;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Remise a zero de base : pas de marges surprises, la boite inclut le padding. */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #05070d;         /* noir bleute au cas ou la 3D tarde */
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;            /* le globe prend tout, pas de scroll de page */
}

/* Le conteneur du globe occupe tout l'ecran, en arriere-plan. */
#globe {
  position: fixed;
  inset: 0;                    /* top/right/bottom/left = 0 */
  z-index: 0;
}

/* ---------- Ecrans plein centre (chargement / erreur) ---------- */
.overlay-center {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  color: var(--ink-dim);
  background: radial-gradient(circle at center, #0a1120 0%, #05070d 70%);
}

/* L'anneau qui tourne pendant le chargement. */
.loader-ring {
  width: 52px;
  height: 52px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 340px;
}
.error-card h2 { color: var(--ink); margin-bottom: 10px; font-size: 20px; }
.error-card p { color: var(--ink-dim); font-size: 15px; }

/* ---------- Le panneau de controle flottant ---------- */
.panel {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel-bg);
  backdrop-filter: blur(14px);           /* effet verre depoli */
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.panel-head { margin-bottom: 16px; }
.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand-sub { color: var(--ink-dim); font-size: 13px; margin-top: 2px; }
.who { color: var(--accent); font-size: 12px; margin-top: 6px; }

/* ---------- Les onglets ---------- */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--field-bg);
  padding: 4px;
  border-radius: 999px;                  /* pilule */
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--accent); color: #04101f; }

/* On cache les panneaux inactifs et on montre l'actif. */
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Champs et boutons ---------- */
.row { display: flex; gap: 8px; margin-bottom: 10px; }
.field {
  flex: 1;
  min-width: 0;
  background: var(--field-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--ink-dim); }

.btn {
  background: var(--accent);
  color: #04101f;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Petits messages sous les formulaires (succes, erreur, info). */
.msg { font-size: 12px; min-height: 16px; color: var(--ink-dim); }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--accent); }
.hint { color: var(--ink-dim); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }

/* ---------- Les statistiques ---------- */
.stats {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}
.stat {
  flex: 1;
  background: var(--field-bg);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- La liste des lieux ---------- */
.places { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.place-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--field-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.place-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent);
}
.place-body { flex: 1; min-width: 0; cursor: pointer; }
.place-label { font-size: 14px; font-weight: 600; }
.place-meta { font-size: 12px; color: var(--ink-dim); }
.place-del {
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.place-del:hover { color: var(--danger); background: rgba(255, 107, 107, 0.12); }

.empty {
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
  padding: 20px 10px;
  border: 1px dashed var(--panel-border);
  border-radius: 10px;
}

/* ---------- La carte d'un pays ---------- */
.country-card {
  background: var(--field-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 6px;
}
.country-flag {
  width: 64px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
}
.country-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.country-fact { font-size: 13px; color: var(--ink-dim); margin-bottom: 4px; }
.country-fact strong { color: var(--ink); font-weight: 600; }

/* ---------- Le suivi de l'ISS ---------- */
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

.iss-readout {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.iss-readout strong { color: var(--accent); }

/* Utilitaire : cache un element. */
.hidden { display: none !important; }

/* ---------- Adaptation tablette / petit ecran ---------- */
@media (max-width: 640px) {
  .panel {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    max-height: 70vh;
  }
}

/* Logo dans l'entete du panneau (ajoute avec l'icone generee) */
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo { border-radius: 9px; flex-shrink: 0; display: block; }
