/* ============================================================
   Prism.js — theme GOODEV (inspire PyCharm Darcula/Light)
   Couleurs vives et distinctes, comme dans un vrai IDE.
   Dark mode via [data-theme="dark"].
   ============================================================ */

/* --- Base (light mode — proche PyCharm Light) --- */

code[class*="language-"],
pre[class*="language-"] {
  color: #080808;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.6;
  tab-size: 4;
  hyphens: none;
}

pre[class*="language-"] {
  padding: 1.2rem;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border-radius: 4px;
  background: var(--bg-tertiary, #f5f5f5);
  border: 1px solid var(--border-color, #d0d0d0);
}

:not(pre) > code[class*="language-"] {
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: var(--bg-tertiary, #f5f5f5);
}

/* Commentaires — gris italique */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #8c8c8c;
  font-style: italic;
}

/* Ponctuation */
.token.punctuation {
  color: #080808;
}

/* Keywords — bleu fonce gras (if, for, def, class, import, from, return...) */
.token.keyword,
.token.atrule {
  color: #0033b3;
  font-weight: bold;
}

/* Strings — vert fonce */
.token.string,
.token.char,
.token.attr-value {
  color: #067d17;
}

/* Nombres, booleans, constantes — bleu */
.token.number,
.token.boolean,
.token.constant {
  color: #1750eb;
}

/* Fonctions — jaune/brun fonce */
.token.function {
  color: #7a4e00;
}

/* Classes, types — violet */
.token.class-name {
  color: #6a1b9a;
}

/* Noms de proprietes, tags HTML — rouge brique */
.token.property,
.token.tag {
  color: #871094;
}

/* Attributs (HTML) — bleu */
.token.attr-name {
  color: #174ad4;
}

/* Selecteurs CSS — jaune brun */
.token.selector {
  color: #7a4e00;
}

/* Decorateurs, annotations — jaune */
.token.decorator,
.token.annotation {
  color: #9e880d;
}

/* Builtins (self, True, None...) — violet gras */
.token.builtin {
  color: #8000ff;
  font-weight: bold;
}

/* Operateurs — noir */
.token.operator {
  color: #080808;
}

/* Variables, regex — orange */
.token.regex,
.token.variable,
.token.important {
  color: #b85c00;
}

/* Inserts / deletes (diff) */
.token.inserted {
  color: #067d17;
  background: #e6ffe6;
}

.token.deleted {
  color: #b31d28;
  background: #ffeef0;
}

/* Symboles */
.token.symbol {
  color: #1750eb;
}

/* URL / entities */
.token.entity,
.token.url,
.language-css .token.string {
  color: #174ad4;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

/* ============================================================
   Dark mode — Darcula (PyCharm)
   ============================================================ */

[data-theme="dark"] code[class*="language-"],
[data-theme="dark"] pre[class*="language-"] {
  color: #a9b7c6;
}

[data-theme="dark"] pre[class*="language-"] {
  background: #2b2b2b;
  border-color: #3c3f41;
}

[data-theme="dark"] :not(pre) > code[class*="language-"] {
  background: #2b2b2b;
}

/* Commentaires — gris */
[data-theme="dark"] .token.comment,
[data-theme="dark"] .token.prolog,
[data-theme="dark"] .token.doctype,
[data-theme="dark"] .token.cdata {
  color: #808080;
}

/* Ponctuation */
[data-theme="dark"] .token.punctuation {
  color: #a9b7c6;
}

/* Keywords — orange vif (comme Darcula) */
[data-theme="dark"] .token.keyword,
[data-theme="dark"] .token.atrule {
  color: #cc7832;
  font-weight: bold;
}

/* Strings — vert */
[data-theme="dark"] .token.string,
[data-theme="dark"] .token.char,
[data-theme="dark"] .token.attr-value {
  color: #6a8759;
}

/* Nombres — bleu clair */
[data-theme="dark"] .token.number,
[data-theme="dark"] .token.boolean,
[data-theme="dark"] .token.constant {
  color: #6897bb;
}

/* Fonctions — jaune clair */
[data-theme="dark"] .token.function {
  color: #ffc66d;
}

/* Classes — beige clair */
[data-theme="dark"] .token.class-name {
  color: #a9b7c6;
  text-decoration: underline;
}

/* Tags HTML — jaune */
[data-theme="dark"] .token.property,
[data-theme="dark"] .token.tag {
  color: #e8bf6a;
}

/* Attributs HTML — vert */
[data-theme="dark"] .token.attr-name {
  color: #bababa;
}

/* Selecteurs CSS */
[data-theme="dark"] .token.selector {
  color: #ffc66d;
}

/* Decorateurs */
[data-theme="dark"] .token.decorator,
[data-theme="dark"] .token.annotation {
  color: #bbb529;
}

/* Builtins (self, True, None) — violet clair */
[data-theme="dark"] .token.builtin {
  color: #8888c6;
  font-weight: bold;
}

/* Operateurs */
[data-theme="dark"] .token.operator {
  color: #a9b7c6;
}

/* Variables, regex — orange clair */
[data-theme="dark"] .token.regex,
[data-theme="dark"] .token.variable,
[data-theme="dark"] .token.important {
  color: #e0a46e;
}

/* Inserts/deletes */
[data-theme="dark"] .token.inserted {
  color: #6a8759;
  background: rgba(106, 135, 89, 0.15);
}

[data-theme="dark"] .token.deleted {
  color: #cc7832;
  background: rgba(204, 120, 50, 0.15);
}

/* Symboles */
[data-theme="dark"] .token.symbol {
  color: #6897bb;
}

/* URL/entities */
[data-theme="dark"] .token.entity,
[data-theme="dark"] .token.url,
[data-theme="dark"] .language-css .token.string {
  color: #287bde;
}
