/* ============================================================
   Influx — Tableau de bord boursier · Devoir 5 SEG3525
   Thème « terminal » sombre · Inter (texte) + JetBrains Mono (chiffres)
   ============================================================ */

:root {
  --bg:      #0B0F17;
  --panel:   #111827;
  --border:  #1F2A3A;
  --text:    #E5EDF7;
  --muted:   #8A99AD;
  --brand:   #4F8CFF;
  --gain:    #22C55E;
  --loss:    #F43F5E;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── En-tête ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(79,140,255,0.06), transparent);
}
.header-brand { display: flex; align-items: center; gap: 0.8rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #22D3EE);
  color: #0B0F17;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 0 22px rgba(79,140,255,0.35);
}
.header-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.header-text p {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lang-btn {
  font-family: var(--mono);
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-btn:hover  { border-color: var(--brand); background: rgba(79,140,255,0.08); }
.lang-btn:active { transform: scale(0.97); }
.lang-btn:focus  { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Mise en page principale ── */
main { padding: 1.5rem 2rem 2rem; max-width: 1340px; margin: 0 auto; }

/* ── Bande de cotation (ticker) ── */
.ticker-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1.25rem;
}
.ticker-chip {
  flex: 1 0 auto;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
}
.ticker-sym { font-family: var(--mono); font-weight: 600; font-size: 0.85rem; }
.ticker-val { font-family: var(--mono); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }

/* ── Panneaux ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.chart-panel { margin-bottom: 1.25rem; }

.panel-head { display: flex; align-items: flex-start; gap: 0.7rem; }
.panel-icon { font-size: 1.4rem; line-height: 1; margin-top: 0.05rem; }
.panel-head h2 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.panel-head p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.2rem;
}

/* ── Onglets de sélection d'action (graphique linéaire) ── */
.ticker-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tab {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tab:hover      { color: var(--text); border-color: var(--muted); }
.tab-active     { background: rgba(255,255,255,0.03); border-width: 1.5px; }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Contrôle (menu déroulant du mois) ── */
.control-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  width: fit-content;
}
.control-row label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.control-row select {
  font-family: var(--mono);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s;
}
.control-row select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(79,140,255,0.25);
}

/* ── Conteneurs de canevas Chart.js ── */
.canvas-wrapper { position: relative; height: 290px; }
.canvas-lg      { height: 340px; }

/* ── Rangée inférieure: graphique à barres+faits saillants ── */
.lower-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) { .lower-grid { grid-template-columns: 1fr; } }

/* ── Liste des faits saillants ── */
.hl-list { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.hl-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.hl-row:last-child { border-bottom: none; }
.hl-icon  { font-size: 1.2rem; }
.hl-label { font-size: 0.8rem; color: var(--muted); flex: 1; }
.hl-value { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; text-align: right; white-space: nowrap; }

/* ── Pied de page ── */
footer {
  text-align: center;
  padding: 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.74rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
footer .back-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
footer .back-link:hover { text-decoration: underline; }
.footer-sep { margin: 0 0.5rem; color: var(--border); }