/* ==========================================================================
   Manifest Platform — MkDocs Material Theme Overrides
   Matches: frontend/src/app/globals.css
   ========================================================================== */

/* --- Font: Geist Sans / Geist Mono (loaded via overrides/main.html) --- */
:root {
  --md-text-font: "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  --md-code-font: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
}

/* --- Light scheme: "flow" ------------------------------------------------ */
/* Custom scheme must use color-scheme property to inherit light base */
[data-md-color-scheme="flow"] {
  color-scheme: light;

  /* Page background — warm beige from the platform */
  --md-default-bg-color: #f7f2ed;
  --md-default-fg-color: #1a1713;
  --md-default-fg-color--light: #44403c;
  --md-default-fg-color--lighter: #78716c;
  --md-default-fg-color--lightest: #a8a29e;

  /* Primary — dark gray/black, same as platform buttons */
  --md-primary-fg-color: #1c1917;
  --md-primary-fg-color--light: #44403c;
  --md-primary-fg-color--dark: #0c0a09;
  --md-primary-bg-color: #fafaf9;
  --md-primary-bg-color--light: #ffffff;

  /* Accent — platform cyan */
  --md-accent-fg-color: #63cbe9;
  --md-accent-fg-color--transparent: #63cbe910;
  --md-accent-bg-color: #63cbe910;

  /* Sidebar */
  --md-sidebar-bg-color: #faf9f7;

  /* Code blocks — slate-950 background matching platform */
  --md-code-bg-color: #020617;
  --md-code-fg-color: #f1f5f9;
  --md-code-hl-color: #63cbe920;

  /* Inline code */
  --md-code-bg-color--light: #f5f0eb;

  /* Admonitions */
  --md-admonition-bg-color: #ffffff99;

  /* Footer */
  --md-footer-bg-color: #1c1917;
  --md-footer-fg-color: #fafaf9;
  --md-footer-fg-color--light: #a8a29e;
  --md-footer-fg-color--lighter: #78716c;
  --md-footer-bg-color--dark: #0c0a09;

  /* Typeset */
  --md-typeset-color: #1a1713;
  --md-typeset-a-color: #63cbe9;
}

/* --- Dark scheme overrides ----------------------------------------------- */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #1c1917;
  --md-primary-fg-color--light: #44403c;
  --md-primary-fg-color--dark: #0c0a09;
  --md-primary-bg-color: #fafaf9;
  --md-accent-fg-color: #63cbe9;
  --md-accent-fg-color--transparent: #63cbe910;
  --md-code-bg-color: #020617;
  --md-code-fg-color: #f1f5f9;
  --md-footer-bg-color: #0c0a09;
}

/* --- Sharp corners (rounded-none) to match the platform ------------------ */
.md-content code,
.md-typeset code,
.md-typeset pre,
.md-typeset .highlight code,
.md-typeset .admonition,
.md-typeset details,
.md-typeset .tabbed-set,
.md-search__form,
.md-tag {
  border-radius: 0 !important;
}

/* Content tabs — sharp */
.md-typeset .tabbed-labels > label {
  border-radius: 0;
}

/* --- Code block styling -------------------------------------------------- */
.md-typeset pre > code {
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* Copy button styling */
.md-clipboard {
  color: #94a3b8;
}
.md-clipboard:hover {
  color: #f1f5f9;
}

/* --- Syntax highlighting — ensure contrast on dark code bg --------------- */
/* Base: force all tokens to inherit readable foreground unless overridden */
.md-typeset .highlight span {
  color: #e2e8f0;
}

.md-typeset .highlight .n,    /* name */
.md-typeset .highlight .nn,   /* name.namespace */
.md-typeset .highlight .nx,   /* name.other */
.md-typeset .highlight .na,   /* name.attribute */
.md-typeset .highlight .no,   /* name.constant */
.md-typeset .highlight .ni,   /* name.entity */
.md-typeset .highlight .ne,   /* name.exception */
.md-typeset .highlight .nv,   /* name.variable */
.md-typeset .highlight .bp,   /* name.builtin.pseudo */
.md-typeset .highlight .fm,   /* name.function.magic */
.md-typeset .highlight .vc,   /* name.variable.class */
.md-typeset .highlight .vg,   /* name.variable.global */
.md-typeset .highlight .vi {  /* name.variable.instance */
  color: #e2e8f0;
}
.md-typeset .highlight .o,    /* operator */
.md-typeset .highlight .ow {  /* operator.word */
  color: #93c5fd;
}
.md-typeset .highlight .p,    /* punctuation */
.md-typeset .highlight .pi {  /* punctuation.indicator */
  color: #cbd5e1;
}

/* Strings — bright green for contrast on dark code bg */
.md-typeset .highlight .s,    /* string */
.md-typeset .highlight .s1,   /* string.single */
.md-typeset .highlight .s2,   /* string.double */
.md-typeset .highlight .sa,   /* string.affix */
.md-typeset .highlight .sb,   /* string.backtick */
.md-typeset .highlight .sc,   /* string.char */
.md-typeset .highlight .sd,   /* string.doc */
.md-typeset .highlight .se,   /* string.escape */
.md-typeset .highlight .sh,   /* string.heredoc */
.md-typeset .highlight .si,   /* string.interpol */
.md-typeset .highlight .sx,   /* string.other */
.md-typeset .highlight .sr {  /* string.regex */
  color: #86efac;
}

/* Comments — visible gray on dark code bg */
.md-typeset .highlight .c,    /* comment */
.md-typeset .highlight .c1,   /* comment.single */
.md-typeset .highlight .ch,   /* comment.hashbang */
.md-typeset .highlight .cm,   /* comment.multiline */
.md-typeset .highlight .cp,   /* comment.preproc */
.md-typeset .highlight .cpf,  /* comment.preprocfile */
.md-typeset .highlight .cs {  /* comment.special */
  color: #94a3b8;
}

/* Name.tag / name.label — JSON keys, HTML tags */
.md-typeset .highlight .nt,   /* name.tag */
.md-typeset .highlight .nl,   /* name.label */
.md-typeset .highlight .nb {  /* name.builtin */
  color: #93c5fd;
}

/* Keywords — soft purple */
.md-typeset .highlight .k,    /* keyword */
.md-typeset .highlight .kd,   /* keyword.declaration */
.md-typeset .highlight .kn,   /* keyword.namespace */
.md-typeset .highlight .kp,   /* keyword.pseudo */
.md-typeset .highlight .kr,   /* keyword.reserved */
.md-typeset .highlight .kt {  /* keyword.type */
  color: #c4b5fd;
}

/* Builtin constants — true, false, null, None */
.md-typeset .highlight .kc {  /* keyword.constant */
  color: #93c5fd;
}

/* Literals, numbers, generic output — ensure visibility on dark code bg */
.md-typeset .highlight .l,    /* literal */
.md-typeset .highlight .ld,   /* literal.date */
.md-typeset .highlight .m,    /* number */
.md-typeset .highlight .mb,   /* number.bin */
.md-typeset .highlight .mf,   /* number.float */
.md-typeset .highlight .mh,   /* number.hex */
.md-typeset .highlight .mi,   /* number.integer */
.md-typeset .highlight .mo,   /* number.oct */
.md-typeset .highlight .il,   /* number.integer.long */
.md-typeset .highlight .go,   /* generic.output */
.md-typeset .highlight .gp,   /* generic.prompt */
.md-typeset .highlight .ge,   /* generic.emph */
.md-typeset .highlight .gr,   /* generic.error */
.md-typeset .highlight .gt,   /* generic.traceback */
.md-typeset .highlight .gs,   /* generic.strong */
.md-typeset .highlight .gi,   /* generic.inserted */
.md-typeset .highlight .gd,   /* generic.deleted */
.md-typeset .highlight .gh,   /* generic.heading */
.md-typeset .highlight .gu {  /* generic.subheading */
  color: #e2e8f0;
}

/* --- Admonitions — match platform alert card styling --------------------- */
.md-typeset .admonition,
.md-typeset details {
  border-left-width: 3px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* --- Header bar ---------------------------------------------------------- */
.md-header {
  background-color: #1c1917 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* Navigation tabs bar */
.md-tabs {
  background-color: #1c1917 !important;
  border-top: 1px solid #63cbe920;
}
.md-tabs__link--active,
.md-tabs__link:hover {
  color: #63cbe9 !important;
}

/* --- Nav sidebar active item — cyan left border only on the current page -- */
.md-nav__link--active {
  border-left: 3px solid #63cbe9;
  padding-left: 0.6rem;
}

/* --- Search input -------------------------------------------------------- */
.md-search__input {
  background-color: #ffffff40;
}

/* --- Tables -------------------------------------------------------------- */
.md-typeset table:not([class]) {
  border: 1px solid #cbd5e1;
  border-radius: 0;
}
.md-typeset table:not([class]) th {
  background-color: #f8fafc;
}
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  border-color: #334155;
}
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: #1e293b;
  color: #e2e8f0;
}

/* --- Mermaid diagram styling (via Material CSS custom properties) --------- */
[data-md-color-scheme="flow"] {
  --md-mermaid-node-bg-color: #ffffff;
  --md-mermaid-node-fg-color: #1c1917;
  --md-mermaid-edge-color: #44403c;
  --md-mermaid-label-bg-color: #f7f2ed;
  --md-mermaid-label-fg-color: #1c1917;
}
[data-md-color-scheme="slate"] {
  --md-mermaid-node-bg-color: #2d2d2d;
  --md-mermaid-node-fg-color: #e0e0e0;
  --md-mermaid-edge-color: #a8a29e;
  --md-mermaid-label-bg-color: #1e1e1e;
  --md-mermaid-label-fg-color: #e0e0e0;
}
