/* ═══════════════════════════════════════════════════════════════
   CHRONO // FALLOUT 2027 — Identité graphique Pip-Boy
   -------------------------------------------------------
   Éditer librement ce fichier pour ajuster les couleurs,
   tailles et effets visuels.
   ═══════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════
   TOKENS — modifier ici pour changer le thème
   ═══════════════════════════════════════════ */
:root {
  --green-bright:  #39FF14;   /* Texte principal, éléments actifs */
  --green-mid:     #1DB308;   /* Labels, texte secondaire         */
  --green-dim:     #0A5C0A;   /* Éléments inactifs, désactivés    */
  --green-surface: #071407;   /* Fond des cards et boîtes         */
  --green-border:  #1A5C1A;   /* Bordures                         */
  --black:         #0A0A0A;   /* Background global                */
  --danger:        #8B0000;   /* Erreurs                          */
  --glow:          0 0 8px #39FF14, 0 0 20px rgba(57,255,20,0.4);
  --glow-dim:      0 0 4px rgba(57,255,20,0.6);
  --font-title:    'VT323', monospace;        /* Titres, headers  */
  --font-mono:     'Share Tech Mono', monospace; /* Corps, méta   */
}


/* ═══════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--black);
  color: var(--green-bright);
  font-family: var(--font-title);
  min-height: 100vh;
  overflow-x: hidden;
}


/* ═══════════════════════════════════════════
   CRT — scanlines horizontales
   ═══════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* CRT — vignette bords */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
  z-index: 9998;
}


/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}


/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.app-header {
  border: 1px solid var(--green-border);
  border-bottom: 2px solid var(--green-border);
  padding: 18px 28px;
  background: var(--green-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 14px; height: 14px;
  border-top: 2px solid var(--green-bright);
  border-left: 2px solid var(--green-bright);
}
.app-header::after {
  content: '';
  position: absolute;
  top: -1px; right: -1px;
  width: 14px; height: 14px;
  border-top: 2px solid var(--green-bright);
  border-right: 2px solid var(--green-bright);
}

.app-title {
  font-size: 42px;
  letter-spacing: 8px;
  color: var(--green-bright);
  text-shadow: var(--glow);
}

.app-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green-mid);
  letter-spacing: 2px;
  text-align: right;
  line-height: 2;
}


/* ═══════════════════════════════════════════
   TIMELINE WRAPPER
   ═══════════════════════════════════════════ */
.timeline-wrapper {
  border: 1px solid var(--green-border);
  border-top: none;
  background: var(--green-surface);
  padding: 28px 24px 0;
}


/* ═══════════════════════════════════════════
   PLUGIN OVERRIDES — horizontal-timeline-2.0
   ═══════════════════════════════════════════ */

/* Ligne de la timeline */
.horizontal-timeline .events {
  background: var(--green-dim);
  height: 2px;
}

/* Ligne de progression */
.horizontal-timeline .filling-line {
  background: var(--green-bright);
  box-shadow: 0 0 8px var(--green-bright);
}

/* Zone scrollable */
.horizontal-timeline .events-wrapper {
  margin: 0 56px;
}

/* Dots */
.horizontal-timeline .events ol li a {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: var(--green-surface);
  border: 2px solid var(--green-dim);
  top: -5px;
}

/* Label sous le dot */
.horizontal-timeline .events ol li a span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green-dim);
  top: 20px;
  white-space: nowrap;
}

/* Dot sélectionné */
.horizontal-timeline .events ol li a.selected {
  background: var(--green-bright);
  border-color: var(--green-bright);
  box-shadow: var(--glow);
}

.horizontal-timeline .events ol li a.selected span {
  color: var(--green-bright);
  text-shadow: var(--glow-dim);
}

/* Dots passés */
.horizontal-timeline .events ol li a.older-event {
  background: var(--green-mid);
  border-color: var(--green-mid);
}

.horizontal-timeline .events ol li a.older-event span {
  color: var(--green-mid);
}

/* Boutons de navigation */
.horizontal-timeline .cd-timeline-navigation a {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: var(--green-surface);
  border: 1px solid var(--green-border);
  top: 50%;
  transform: translateY(-50%);
}

.horizontal-timeline .cd-timeline-navigation a::before,
.horizontal-timeline .cd-timeline-navigation a::after {
  border-color: var(--green-mid);
}

.horizontal-timeline .cd-timeline-navigation a:hover {
  background: rgba(57,255,20,0.06);
  border-color: var(--green-bright);
}

.horizontal-timeline .cd-timeline-navigation a:hover::before,
.horizontal-timeline .cd-timeline-navigation a:hover::after {
  border-color: var(--green-bright);
}

.horizontal-timeline .cd-timeline-navigation a.inactive {
  opacity: 0.25;
}

/* Panneau de contenu */
.horizontal-timeline .events-content {
  border-top: 2px solid var(--green-border);
  margin-top: 52px;
  background: var(--black);
}

.horizontal-timeline .events-content ol {
  overflow: hidden;
}

.horizontal-timeline .events-content ol li {
  padding: 28px 32px;
  min-height: 160px;
}


/* ═══════════════════════════════════════════
   BARRE DE MODE (ANNÉE / ANNÉE + MOIS)
   ═══════════════════════════════════════════ */
.mode-bar {
  border: 1px solid var(--green-border);
  border-top: none;
  background: var(--green-surface);
  display: flex;
}

.mode-btn {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-right: 1px solid var(--green-border);
  color: var(--green-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.mode-btn:last-child { border-right: none; }

.mode-btn.active {
  color: var(--green-bright);
  background: rgba(57,255,20,0.05);
  box-shadow: inset 0 -2px 0 var(--green-bright);
}

.mode-btn:hover:not(.active) { color: var(--green-mid); }


/* ═══════════════════════════════════════════
   BARRE DE NAVIGATION DIRECTE
   ═══════════════════════════════════════════ */
.jump-bar {
  border: 1px solid var(--green-border);
  border-top: none;
  padding: 12px 28px;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.jump-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green-dim);
  letter-spacing: 3px;
}

.jump-selects {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Select — style Pip-Boy */
.jump-bar select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--green-surface);
  border: 1px solid var(--green-border);
  color: var(--green-mid);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 6px 32px 6px 12px;
  cursor: pointer;
  outline: none;
  /* Flèche personnalisée */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231DB308'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 140px;
  transition: border-color 0.15s, color 0.15s;
}

.jump-bar select:hover:not(:disabled) {
  border-color: var(--green-mid);
  color: var(--green-bright);
}

.jump-bar select:focus:not(:disabled) {
  border-color: var(--green-bright);
  color: var(--green-bright);
  box-shadow: var(--glow-dim);
}

.jump-bar select:disabled {
  opacity: 0.3;
  cursor: default;
}

.jump-bar select option {
  background: var(--green-surface);
  color: var(--green-mid);
}


/* ═══════════════════════════════════════════
   EN-TÊTE DE DATE
   ═══════════════════════════════════════════ */
.event-date-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--green-mid);
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--green-border);
}

.event-date-label::before { content: '[ '; color: var(--green-dim); }
.event-date-label::after  { content: ' ]'; color: var(--green-dim); }


/* ═══════════════════════════════════════════
   CARTES FACTION
   ═══════════════════════════════════════════ */
.faction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faction-entry {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 12px 16px;
  border: 1px solid var(--green-border);
  background: rgba(57,255,20,0.02);
  position: relative;
}

/* Coins décoratifs */
.faction-entry::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 8px; height: 8px;
  border-top: 2px solid var(--green-bright);
  border-left: 2px solid var(--green-bright);
}
.faction-entry::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  border-bottom: 2px solid var(--green-bright);
  border-right: 2px solid var(--green-bright);
}

.faction-name {
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--green-bright);
  text-shadow: var(--glow-dim);
  letter-spacing: 2px;
  min-width: 200px;
  flex-shrink: 0;
  line-height: 1.3;
}

.faction-name::after {
  content: ' //';
  color: var(--green-dim);
  font-size: 16px;
  letter-spacing: 0;
}

.faction-events {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green-mid);
  line-height: 1.7;
}

/* Événement unique */
.faction-events.single {
  display: flex;
  align-items: center;
}

/* Événements multiples */
.faction-events.multi {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.event-item::before {
  content: '▸';
  color: var(--green-dim);
  flex-shrink: 0;
  line-height: 1.7;
}

/* Tag mois dans la vue ANNÉE */
.event-month-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green-dim);
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 38px;
  padding: 1px 4px;
  border: 1px solid var(--green-border);
  margin-right: 6px;
  text-align: center;
  line-height: 1.6;
}

/* Masquer le sélecteur de mois en mode ANNÉE */
.jump-selects.year-mode #jump-month {
  display: none;
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.app-footer {
  border: 1px solid var(--green-border);
  border-top: none;
  padding: 10px 28px;
  background: var(--green-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green-dim);
  letter-spacing: 1px;
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  bottom: -1px; left: -1px;
  width: 14px; height: 14px;
  border-bottom: 2px solid var(--green-bright);
  border-left: 2px solid var(--green-bright);
}
.app-footer::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 14px; height: 14px;
  border-bottom: 2px solid var(--green-bright);
  border-right: 2px solid var(--green-bright);
}


/* ═══════════════════════════════════════════
   ÉTATS LOADING / ERREUR
   ═══════════════════════════════════════════ */
.state-msg {
  padding: 48px 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green-mid);
  letter-spacing: 3px;
  text-align: center;
}

.state-msg.error { color: var(--danger); }

.cursor-blink {
  display: inline-block;
  animation: blink 0.8s step-end infinite;
}


/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
