/* Step3D — apparence inspirée de la maquette : fond bleu nuit, cartes rondes. */

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

:root {
  --fond: #0b1124;
  --fond-panneau: #101733;
  --carte: #161e3e;
  --bordure: #232c52;
  --texte: #dde3f5;
  --texte-faible: #8b93b8;
  --bleu: #5b8af5;
  --bleu-clair: #7ea4f8;
  --vert: #2f9e6e;
  --jaune: #c9a227;
  --rouge: #d95d5d;
  --orange: #e8923d;
  --cyan: #4fb8e0;
}

body {
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

/* ---------- Colonne des sujets ---------- */

#panneau-sujets {
  background: var(--fond-panneau);
  border-right: 1px solid var(--bordure);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.marque { display: flex; align-items: center; gap: 10px; }
.marque-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--bleu);
  color: #fff;
  font-weight: bold; font-size: 18px;
  display: grid; place-items: center;
}
.marque h1 { font-size: 18px; }

.titre-section {
  font-size: 11px; letter-spacing: 1.5px;
  color: var(--texte-faible); text-transform: uppercase;
}

#liste-sujets { flex: 1; overflow-y: auto; }

.sujet-bloc { margin-bottom: 10px; }
.sujet-ligne {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; border-radius: 8px;
  cursor: pointer;
}
.sujet-ligne:hover { background: var(--carte); }
.sujet-ligne.actif { background: var(--carte); }
.sujet-code { font-weight: 600; }

.compteur {
  font-size: 11px; color: var(--texte-faible);
}

.visite-ligne {
  padding: 4px 8px 4px 20px;
  color: var(--texte-faible);
  cursor: pointer;
  border-radius: 8px;
  display: flex; justify-content: space-between;
}
.visite-ligne:hover { background: var(--carte); color: var(--texte); }

.essai-ligne {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px 6px 32px;
  margin: 2px 0;
  border-radius: 8px;
  cursor: pointer;
}
.essai-ligne:hover { background: var(--carte); }
.essai-ligne.actif {
  background: #1d2a5e;
  outline: 1px solid var(--bleu);
}

.badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
}
.badge.anote { background: #143d2c; color: #4fc08d; }
.badge.a-faire { background: #3d3314; color: #d9b64a; }

/* Petits boutons renommer / supprimer au survol */
.boutons-mini { display: none; gap: 2px; }
.sujet-ligne:hover .boutons-mini,
.visite-ligne:hover .boutons-mini,
.essai-ligne:hover .boutons-mini { display: flex; }
.boutons-mini button {
  background: none; border: none;
  color: var(--texte-faible); cursor: pointer;
  font-size: 12px; padding: 0 3px;
}
.boutons-mini button:hover { color: #fff; }
.boutons-mini .btn-suppr:hover { color: var(--rouge); }

.bouton-large {
  background: var(--carte);
  border: 1px solid var(--bordure);
  color: var(--texte);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.bouton-large:hover { border-color: var(--bleu); }

/* ---------- Zone centrale ---------- */

#zone-principale { padding: 20px; overflow-y: auto; }

#bloc-formulaires section {
  background: var(--fond-panneau);
  border: 1px solid var(--bordure);
  border-radius: 14px;
  padding: 20px;
  max-width: 560px;
  margin-bottom: 16px;
}
#bloc-formulaires h2 { font-size: 16px; margin-bottom: 14px; }
.carte-cachee { display: none; }

label {
  display: block;
  color: var(--texte-faible);
  font-size: 12px;
  margin: 10px 0 4px;
}

input, select {
  width: 100%;
  background: var(--carte);
  border: 1px solid var(--bordure);
  color: var(--texte);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}
input:focus, select:focus { outline: 1px solid var(--bleu); }

.ligne-boutons { display: flex; gap: 10px; margin-top: 16px; }

.bouton-bleu {
  background: var(--bleu); border: none; color: #fff;
  padding: 9px 18px; border-radius: 8px;
  cursor: pointer; font-size: 14px;
}
.bouton-bleu:hover { background: var(--bleu-clair); }
.bouton-gris {
  background: var(--carte); border: 1px solid var(--bordure); color: var(--texte);
  padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 14px;
}

.info-fichier { color: var(--texte-faible); font-size: 12px; margin-top: 8px; }

#message { margin-top: 8px; font-size: 13px; min-height: 18px; }
#message.erreur { color: var(--rouge); }
#message.succes { color: #4fc08d; }

/* ---------- Colonne des détails ---------- */

#panneau-details {
  background: var(--fond-panneau);
  border-left: 1px solid var(--bordure);
  padding: 16px;
  overflow-y: auto;
}
#panneau-details h2 { font-size: 15px; margin-bottom: 12px; }

.fiche-essai h3 { font-size: 15px; margin-bottom: 8px; }
.fiche-essai ul { list-style: none; }
.fiche-essai li {
  display: flex; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid var(--bordure);
  color: var(--texte-faible);
}
.fiche-essai li strong { color: var(--texte); font-weight: 600; }

.fiche-essai .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.note { color: var(--texte-faible); font-size: 13px; }

/* ---------- Vue 3D d'annotation ---------- */

.cache { display: none !important; }

#zone-principale:has(#vue-3d:not(.cache)) {
  padding: 0;
  overflow: hidden;
}

#vue-3d { display: flex; flex-direction: column; height: 100vh; }

#entete-3d {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
}
#entete-3d h2 { font-size: 16px; }
#meta-3d { color: var(--texte-faible); font-size: 12px; }

#conteneur-3d {
  flex: 1;
  position: relative;
  min-height: 0;
  background: var(--fond);
}
#conteneur-3d canvas { display: block; }

#cadran-info {
  position: absolute; top: 12px; left: 12px;
  background: #101733e6;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  pointer-events: none;
}

#legende {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 8px;
}

#cadran-info .sol { color: #4fc08d; }
#cadran-info .leve { color: #d95d5d; }

#message-3d { font-size: 13px; margin-right: 8px; }
#message-3d.erreur { color: var(--rouge); }
#message-3d.succes { color: #4fc08d; }
#legende span {
  background: #101733e6;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
}
.legende-gauche { color: var(--cyan); }
.legende-droite { color: var(--orange); }
.legende-bassin { color: #b9c1dd; }

/* ---------- Barre de lecture ---------- */

#barre-lecture {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--bordure);
  background: var(--fond-panneau);
}
#barre-lecture button {
  background: var(--carte);
  border: 1px solid var(--bordure);
  color: var(--texte);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 13px;
}
#barre-lecture button:hover { border-color: var(--bleu); }
#btn-lecture { min-width: 44px; color: var(--bleu-clair); font-size: 15px; }

#horloge {
  font-family: Consolas, monospace;
  font-size: 15px;
  margin: 0 10px;
}

.vitesse-boutons { margin-left: auto; display: flex; gap: 4px; }
.vitesse-boutons button { padding: 6px 10px; font-size: 12px; }
.vitesse-active {
  background: var(--bleu) !important;
  border-color: var(--bleu) !important;
  color: #fff !important;
}

/* ---------- Frise des contacts (timeline) ---------- */

#timeline {
  padding: 8px 16px 14px;
  background: var(--fond-panneau);
  border-top: 1px solid var(--bordure);
}
.tl-ligne { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.tl-label {
  width: 18px; text-align: center;
  font-weight: 600; font-size: 12px;
  border-radius: 5px; padding: 2px 0;
}
.tl-label-g { background: #14384d; color: var(--cyan); }
.tl-label-d { background: #4d3114; color: var(--orange); }

.tl-piste {
  flex: 1; position: relative;
  height: 24px;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 7px;
  cursor: crosshair;
  overflow: hidden;
}

.tl-segment {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 5px;
  opacity: 0.75;
}
.tl-segment:hover { opacity: 1; }
.tl-segment.pied-g { background: var(--cyan); }
.tl-segment.pied-d { background: var(--orange); }

.tl-poignee {
  position: absolute; top: 0; bottom: 0;
  width: 12px;
  cursor: ew-resize;
  touch-action: none;
}
.tl-poignee::after {
  content: "";
  position: absolute; top: 3px; bottom: 3px;
  width: 2px; background: #0b1124cc;
  border-radius: 2px;
}
.tl-poignee.cote-gauche::after { left: 2px; }
.tl-poignee.cote-droit::after { right: 2px; }
.tl-poignee:hover::after { background: #fff; }

.tl-curseur {
  position: absolute; top: 0; bottom: 0;
  width: 2px;
  background: #fff;
  pointer-events: none;
  box-shadow: 0 0 4px #fff8;
}

/* ---------- Panneau des événements ---------- */

.titre-evenements { display: flex; justify-content: space-between; }
#compte-evenements { color: var(--texte-faible); font-weight: normal; }

.grille-poses {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-bottom: 12px;
}
.grille-poses button {
  background: var(--carte);
  border: 1px solid var(--bordure);
  color: var(--texte);
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  font-size: 13px;
}
.grille-poses button:hover { border-color: var(--bleu); }
.bouton-pose { color: var(--texte); }
.bouton-lever { color: var(--texte); }
.grille-poses #btn-pose-g, .grille-poses #btn-lever-g { color: var(--cyan); }
.grille-poses #btn-pose-d, .grille-poses #btn-lever-d { color: var(--orange); }

#liste-evenements { margin-bottom: 12px; }
.evenement-ligne {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: Consolas, monospace;
}
.evenement-ligne:hover { background: var(--carte); }
.evenement-ligne .ev-type { width: 76px; flex: none; }
.evenement-ligne .ev-info { flex: 1; color: var(--texte-faible); }
.evenement-ligne.pied-g .ev-type { color: var(--cyan); }
.evenement-ligne.pied-d .ev-type { color: var(--orange); }
.evenement-ligne .ev-mini {
  background: none; border: none; color: var(--texte-faible);
  cursor: pointer; font-size: 12px; padding: 0 3px;
  visibility: hidden;
}
.evenement-ligne:hover .ev-mini { visibility: visible; }
.evenement-ligne .ev-mini:hover { color: #fff; }
.evenement-ligne .ev-mini.btn-suppr:hover { color: var(--rouge); }

#btn-auto { width: 100%; margin-bottom: 12px; font-size: 12.5px; }

.raccourcis {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 10px 12px;
}
.raccourcis h3 { font-size: 13px; margin-bottom: 8px; }
.raccourcis ul { list-style: none; }
.raccourcis li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--texte-faible);
  margin: 5px 0;
}
kbd {
  background: #0b1124;
  border: 1px solid var(--bordure);
  border-radius: 5px;
  padding: 1px 7px;
  font-family: Consolas, monospace;
  font-size: 11px;
  color: var(--texte);
}