:root {
  --bg: #ffffff;
  --text: #0a0a0a;
  --gray: #6b7280;
  --accent: #0000ff;
}

body.dark-theme {
  --bg: #0a0a0a;
  --text: #ffffff;
  --gray: #aaaaaa;
  --accent: #4e6ff2;
}

body.dark-theme .frame {
  background: #1a1a1a;
  border-color: #333;
}

body.dark-theme .card {
  background: #1a1a1a;
  border-color: #333;
}

body.dark-theme .card h2 {
  /* Les couleurs sont définies inline dans le HTML */
}

/* Grok 4 doit être blanc en mode sombre */
body.dark-theme .card h2.grok-title {
  color: #ffffff !important;
}

body.dark-theme .card p {
  color: #aaaaaa;
}

body.dark-theme .ai-value {
  color: #ffffff;
}

body.dark-theme table {
  background: #1a1a1a;
  border-color: #333;
}

body.dark-theme th, body.dark-theme td {
  border-color: #333;
  color: #ffffff;
}

body.dark-theme th {
  background: #2a2a2a;
}

body.dark-theme .label {
  color: #ffffff;
}

/* === BOUTON DE BASCULEMENT THÈME === */
#theme-toggle {
  background: var(--bg);
  border: 2px solid var(--text);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

#theme-toggle:hover {
  background: var(--text);
  color: var(--bg);
}

#theme-icon {
  font-size: 18px;
}

* {
  box-sizing: border-box;
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  transition: background 0.3s, color 0.3s;
}

/* HEADER */
header {
  border: 2px solid var(--text);
  padding: 10px 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 12px;
  color: var(--gray);
}

.right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#twitter-link {
  text-decoration: underline;
  color: var(--text);
  font-size: 12px;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--text);
  padding: 3px 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--text);
  transition: all 0.3s;
}

#theme-toggle:hover {
  background: var(--text);
  color: var(--bg);
}

/* CADRES GÉNÉRAUX */
.frame {
  border: 2px solid var(--text);
  padding: 10px;
  position: relative;
  margin-bottom: 20px;
}

.label {
  position: absolute;
  top: -10px;
  left: 10px;
  background: var(--bg);
  font-size: 11px;
  font-weight: bold;
  padding: 0 5px;
  z-index: 1000;
  line-height: 1;
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.card h2 {
  margin: 0;
  /* Couleurs définies inline dans le HTML */
  font-size: 16px;
}

/* TABLEAU */
.table-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table-section th,
.table-section td {
  border-top: 1px solid var(--text);
  padding: 6px 8px;
  text-align: left;
}

.table-section th {
  background: rgba(0, 0, 0, 0.05);
}

main {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  border-top: 2px solid var(--text);
  padding-top: 10px;
}

/* CHART SECTION */
.chart-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 800px;
  padding: 20px; /* Reduced padding for more space */
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto; /* Allow horizontal scrolling if needed */
}

#valueChart {
  width: 150%; /* Nettement plus large */
  max-width: 150%; /* Ensure it takes full width */
  height: 700px; /* Increased height */
  margin: 0 auto;
  display: block;
  box-sizing: border-box;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  max-width: 500px;
  width: 80%;
}

.modal-content h3 {
  margin-top: 0;
}

.modal-content button {
  background: none;
  border: 1px solid var(--text);
  padding: 4px 10px;
  margin-top: 10px;
  cursor: pointer;
  color: var(--text);
}

.modal-content button:hover {
  background: var(--text);
  color: var(--bg);
}

/* === CADRES DES IA SIMPLIFIÉS === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.card {
  border-radius: 0; /* Angles droits */
}

.card h2 {
  margin: 0;
  /* Couleurs définies inline dans le HTML */
  font-size: 16px;
}

.card p {
  margin: 5px 0;
  font-size: 12px;
  color: var(--gray);
}

.ai-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  margin-top: 5px;
}
