/*
 * Blind Insight Developer Docs — Dark Theme
 * Built on MkDocs Material (slate scheme).
 * Brand tokens pulled from bi-dot-com/src/styles/theme.css.
 */

/* TASA Orbiter for headings — Inter + Fira Mono loaded by MkDocs Material font config */
@import url("https://fonts.googleapis.com/css2?family=TASA+Orbiter:wght@400;600;700&display=swap");

[data-md-color-scheme="slate"] {
  /* --- Fonts (Inter + Fira Mono handled by mkdocs.yml font config) --- */

  /* --- Backgrounds --- */
  --md-default-bg-color: #08020f;
  --md-default-bg-color--light: #0f0620;
  --md-default-bg-color--lighter: #150a2a;
  --md-default-bg-color--lightest: #1c1035;

  /* --- Primary (purple) --- */
  --md-primary-fg-color: #a78bfa;
  --md-primary-fg-color--light: #c4b5fd;
  --md-primary-fg-color--dark: #7c3aed;
  /* Light so header icons (hamburger, search) are visible on the dark header */
  --md-primary-bg-color: rgba(240, 235, 255, 0.9);
  --md-primary-bg-color--light: rgba(240, 235, 255, 0.55);

  /* --- Accent (teal — high contrast on dark) --- */
  --md-accent-fg-color: #2dd4bf;
  --md-accent-fg-color--transparent: rgba(45, 212, 191, 0.1);
  --md-accent-bg-color: #08020f;
  --md-accent-bg-color--light: rgba(45, 212, 191, 0.08);

  /* --- Prose text (softer than white — ~72% lavender-gray) --- */
  --md-typeset-color: #b4a8cc;
  --md-default-fg-color: #b4a8cc;
  --md-default-fg-color--light: rgba(180, 168, 204, 0.7);
  --md-default-fg-color--lighter: rgba(180, 168, 204, 0.45);
  --md-default-fg-color--lightest: rgba(180, 168, 204, 0.2);

  /* --- Code blocks --- */
  --md-code-bg-color: #0f0620;
  --md-code-fg-color: #c4b5fd;
  --md-code-hl-color: rgba(167, 139, 250, 0.15);
  --md-code-hl-number-color: #2dd4bf;
  --md-code-hl-special-color: #d946ef;
  --md-code-hl-function-color: #a78bfa;
  --md-code-hl-constant-color: #f472b6;
  --md-code-hl-keyword-color: #d946ef;
  --md-code-hl-string-color: #34d399;
  --md-code-hl-name-color: #b4a8cc;
  --md-code-hl-operator-color: #7c3aed;
  --md-code-hl-punctuation-color: rgba(180, 168, 204, 0.5);
  --md-code-hl-comment-color: rgba(180, 168, 204, 0.35);
  --md-code-hl-generic-color: rgba(180, 168, 204, 0.7);
  --md-code-hl-variable-color: #b4a8cc;

  /* --- Admonitions --- */
  --md-admonition-bg-color: rgba(15, 6, 32, 0.8);

  /* --- Footer --- */
  --md-footer-bg-color: #08020f;
  --md-footer-bg-color--dark: #040010;
  --md-footer-fg-color: rgba(180, 168, 204, 0.6);
  --md-footer-fg-color--light: rgba(180, 168, 204, 0.4);
  --md-footer-fg-color--lighter: rgba(180, 168, 204, 0.25);

  /* --- Tables --- */
  --md-typeset-table-color: rgba(167, 139, 250, 0.1);
  --md-typeset-table-color--light: rgba(167, 139, 250, 0.05);

  /* --- Shadows --- */
  --md-shadow-z1: 0 4px 10px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(124, 58, 237, 0.12);
  --md-shadow-z2: 0 8px 24px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(124, 58, 237, 0.15);
  --md-shadow-z3: 0 16px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(124, 58, 237, 0.18);
}

/* --- Body text color (override Material slate default) --- */
.md-typeset {
  color: #b4a8cc;
}

/* --- Hamburger + header icon buttons ---
   Note: Material places the drawer-toggle label OUTSIDE .md-header in the DOM,
   so we must target .md-header__button globally, not as a descendant of .md-header. */
.md-header__button {
  color: rgba(240, 235, 255, 0.85) !important;
}

.md-header__button:hover {
  color: #ffffff !important;
  opacity: 1;
}

/* --- Nav header --- */
.md-header {
  background: rgba(8, 2, 15, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.18);
  box-shadow: none;
}

.md-header__title {
  color: #c4b5fd;
  font-family: "TASA Orbiter", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- Sidebar nav --- */
.md-nav--primary .md-nav__title {
  color: rgba(180, 168, 204, 0.45);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Drawer header — override Material's primary-color background to stay dark */
.md-nav--primary .md-nav__title[for="__drawer"] {
  background-color: #0f0620;
  color: #c4b5fd;
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.md-nav__link--active,
.md-nav__link:hover {
  color: #a78bfa;
}

.md-nav__link--active {
  font-weight: 600;
}

/* Active indicator pill */
.md-nav__link--active::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #7c3aed;
  border-radius: 2px;
  margin-right: 0.5em;
  vertical-align: middle;
}

/* --- Content area --- */
.md-content {
  background: transparent;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: "TASA Orbiter", sans-serif;
  color: #ddd5f3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.md-typeset h1 {
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

/* --- Horizontal rules --- */
.md-typeset hr {
  border: none;
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  margin: 2em 0;
}

.md-typeset a {
  color: #a78bfa;
  text-decoration: none;
}

.md-typeset a:hover {
  color: #c4b5fd;
  text-decoration: underline;
  text-decoration-color: rgba(167, 139, 250, 0.4);
}

/* --- Inline code --- */
.md-typeset code {
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  color: #c4b5fd;
  padding: 0.1em 0.35em;
}

/* --- Code blocks --- */
.md-typeset pre {
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 8px;
}

.md-typeset pre > code {
  background: #0f0620;
  border: none;
  padding: 0;
}

/* Filename label in code blocks */
.md-typeset .md-code__content .filename {
  background: rgba(124, 58, 237, 0.15);
  border-bottom: 1px solid rgba(124, 58, 237, 0.18);
  color: rgba(196, 181, 253, 0.7);
}

/* --- Search --- */
.md-search__input {
  background: rgba(15, 6, 32, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 6px;
  color: #b4a8cc;
}

.md-search__input::placeholder {
  color: rgba(180, 168, 204, 0.35);
}

.md-search__input:focus {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* --- Table of contents (right sidebar) --- */
.md-nav--secondary .md-nav__link {
  color: rgba(180, 168, 204, 0.55);
  font-size: 0.8rem;
}

.md-nav--secondary .md-nav__link--active,
.md-nav--secondary .md-nav__link:hover {
  color: #a78bfa;
}

/* --- Admonition overrides --- */
.md-typeset .admonition,
.md-typeset details {
  border-left-width: 3px;
  border-radius: 6px;
  background: rgba(15, 6, 32, 0.7);
}

/* --- Tables --- */
.md-typeset table:not([class]) th {
  background: rgba(124, 58, 237, 0.15);
  color: #c4b5fd;
}

.md-typeset table:not([class]) tr:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* --- Tag chips (used in API reference) --- */
.md-tag {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
}

/* --- Tabs (pymdownx) --- */
.md-typeset .tabbed-labels > label {
  color: rgba(180, 168, 204, 0.55);
}

.md-typeset .tabbed-labels > label:hover {
  color: #a78bfa;
}

.md-typeset .tabbed-labels > label[data-md-state~="active"] {
  color: #a78bfa;
  border-bottom-color: #7c3aed;
}

/* --- Copy button --- */
.md-clipboard {
  color: rgba(196, 181, 253, 0.5);
}

.md-clipboard:hover {
  color: #a78bfa;
}
