/* =====================================================================
   Telbox brand theme for MkDocs Material — matches telbox.ai (dark navy +
   cyan->electric->violet gradient, display-weight headings). The site is
   forced dark (single slate scheme in mkdocs.yml) to mirror the marketing
   site's always-dark identity.
   ===================================================================== */

:root {
  --tb-cyan:     #24D7FF;
  --tb-electric: #176BFF;
  --tb-violet:   #7A5CFF;
  --tb-navy:     #050813;
  --tb-navy-2:   #070B18;
  --tb-surface:  #0E1530;
  --tb-line:     #2A2F4A;
  --tb-ink:      #F0EEFA;
  --tb-gradient: linear-gradient(90deg, #24D7FF 0%, #176BFF 50%, #7A5CFF 100%);
}

/* Re-color Material's slate scheme to the exact Telbox palette. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:           #050813;
  --md-default-bg-color--light:    #070B18;
  --md-default-bg-color--lighter:  #0B1331;
  --md-default-bg-color--lightest: #151936;

  --md-default-fg-color:           rgba(240, 238, 250, 0.92);
  --md-default-fg-color--light:    rgba(240, 238, 250, 0.64);
  --md-default-fg-color--lighter:  rgba(240, 238, 250, 0.38);
  --md-default-fg-color--lightest: rgba(240, 238, 250, 0.10);

  /* header + footer = deep navy, light text */
  --md-primary-fg-color:        #070B18;
  --md-primary-fg-color--light: #0B1331;
  --md-primary-fg-color--dark:  #050813;
  --md-primary-bg-color:        rgba(240, 238, 250, 0.96);
  --md-primary-bg-color--light: rgba(240, 238, 250, 0.66);
  --md-footer-bg-color:          #070B18;
  --md-footer-bg-color--dark:    #050813;
  --md-footer-fg-color:          rgba(240, 238, 250, 0.88);
  --md-footer-fg-color--light:   rgba(240, 238, 250, 0.52);
  --md-footer-fg-color--lighter: rgba(240, 238, 250, 0.32);

  /* accents + links */
  --md-accent-fg-color:              #24D7FF;
  --md-accent-fg-color--transparent: rgba(36, 215, 255, 0.10);
  --md-typeset-a-color:              #9F8FFF;

  /* code */
  --md-code-bg-color: #0B1230;
  --md-code-fg-color: #d8dff5;

  /* misc surfaces */
  --md-typeset-kbd-color:        #151936;
  --md-typeset-kbd-accent-color: #1C213B;
  --md-typeset-table-color:      rgba(240, 238, 250, 0.12);
  --md-typeset-mark-color:       rgba(36, 215, 255, 0.22);
}

/* Light scheme (toggle fallback) — brand palette on a light surface. The
   header + footer stay navy so the gradient mark and tab bar read identically
   in both schemes. */
[data-md-color-scheme="default"] {
  --md-default-bg-color:           #FFFFFF;
  --md-default-bg-color--light:    #FAFAFC;
  --md-default-bg-color--lighter:  #F4F5FB;
  --md-default-bg-color--lightest: #EEF0F8;

  --md-default-fg-color:           rgba(15, 14, 26, 0.90);
  --md-default-fg-color--light:    rgba(15, 14, 26, 0.62);
  --md-default-fg-color--lighter:  rgba(15, 14, 26, 0.38);
  --md-default-fg-color--lightest: rgba(15, 14, 26, 0.07);

  --md-primary-fg-color:        #070B18;
  --md-primary-fg-color--light: #0B1331;
  --md-primary-fg-color--dark:  #050813;
  --md-primary-bg-color:        rgba(240, 238, 250, 0.96);
  --md-primary-bg-color--light: rgba(240, 238, 250, 0.66);
  --md-footer-bg-color:          #070B18;
  --md-footer-bg-color--dark:    #050813;
  --md-footer-fg-color:          rgba(240, 238, 250, 0.88);
  --md-footer-fg-color--light:   rgba(240, 238, 250, 0.52);
  --md-footer-fg-color--lighter: rgba(240, 238, 250, 0.32);

  --md-accent-fg-color:              #176BFF;
  --md-accent-fg-color--transparent: rgba(23, 107, 255, 0.10);
  --md-typeset-a-color:              #5A3FE8;

  --md-code-bg-color: #F4F5FB;
  --md-code-fg-color: #1b2440;

  --md-typeset-table-color: rgba(15, 14, 26, 0.12);
  --md-typeset-mark-color:  rgba(23, 107, 255, 0.18);
}

/* Header: dark, with a thin brand-gradient hairline under the tab bar. */
.md-header {
  border-bottom: 1px solid var(--tb-line);
  box-shadow: none;
}
.md-tabs {
  border-bottom: 2px solid transparent;
  border-image: var(--tb-gradient) 1;
}

/* Display-weight headings to echo the marketing site. Heading color follows
   the active scheme's default fg (light on dark, ink on light) — do not pin it,
   or the light scheme gets a near-white H1 on white. */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Brand-gradient accent for the landing page title. */
.tb-hero h1,
.md-typeset h1#telbox-agents {
  background: var(--tb-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Primary buttons + active nav pick up the brand. */
.md-typeset .md-button--primary {
  background: var(--tb-gradient);
  border: 0;
  color: #ffffff;
}
.md-nav__link--active,
.md-nav__link:focus,
.md-nav__link:hover {
  color: var(--tb-cyan);
}

/* Search field tuned for the dark surface. */
.md-search__form {
  background: rgba(240, 238, 250, 0.08);
  border-radius: 999px;
}
.md-search__form:hover { background: rgba(240, 238, 250, 0.12); }

/* Code blocks read as elevated panels; border adapts to the active scheme. */
.md-typeset pre > code,
.md-typeset .highlight {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
}
.md-typeset code {
  border-radius: 5px;
}

/* Admonitions + collapsible details: rounded cards. The dark navy fill is
   slate-only; the light scheme keeps Material's light tint. */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 12px;
  border-left-width: 3px;
}
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  background: rgba(14, 21, 48, 0.55);
}

/* ---- existing functional rules (kept) ---------------------------------- */

/* Full-bleed embedded API reference (Scalar in an iframe). The reference
   pages set `hide: [navigation, toc]`, so the content column spans the page;
   we stretch the iframe to fill the viewport below the header. */
.api-frame {
  width: 100%;
  height: calc(100vh - 3.6rem);
  border: 0;
  display: block;
}

/* Let the reference pages use the full width Material would otherwise cap. */
.md-content__inner.api-reference {
  margin: 0;
  padding: 0;
}
.md-content__inner.api-reference::before {
  display: none;
}

/* Tidy the hero on the landing page. */
.tb-hero {
  padding: 1.2rem 0 0.4rem;
}
.tb-hero h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.tb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.4rem;
}
