/* ==========================================================================
   ReFlux – Minimal Premium Brand CSS (Dark, Gradient)
   ========================================================================== */

/* ------------------------------
   Brand variables
   ------------------------------ */
:root {
  --reflux-brand-1: #07101F;
  --reflux-brand-2: #13264A;
  --reflux-brand-3: #07101F;

  --reflux-accent: #13264A;
}

/* ------------------------------
   Typography
   ------------------------------ */
:root {
  --md-text-font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  --md-code-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.md-typeset {
  line-height: 1.65;
}

/* Content width */
.md-main__inner {
  max-width: 1200px;
}

/* ------------------------------
   Header + tabs (brand gradient)
   ------------------------------ */
.md-header,
.md-tabs {
  background: linear-gradient(
    90deg,
    var(--reflux-brand-1),
    var(--reflux-brand-2),
    var(--reflux-brand-3)
  ) !important;
}

.md-header__title,
.md-header__button,
.md-tabs__link,
.md-tabs__link--active {
  color: #ffffff !important;
}

.md-tabs__link {
  opacity: 0.9;
}
.md-tabs__link--active {
  opacity: 1;
  font-weight: 600;
}

/* ------------------------------
   Search (dark header)
   ------------------------------ */
.md-search__form {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.10) !important;
}
.md-search__input {
  color: #ffffff !important;
}
.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* ------------------------------
   FULL PAGE DARK MODE + GRADIENT
   ------------------------------ */
[data-md-color-scheme="slate"] body {
  background: linear-gradient(
    135deg,
    var(--reflux-brand-1),
    var(--reflux-brand-2),
    var(--reflux-brand-3)
  ) fixed;
}

/* Main container */
[data-md-color-scheme="slate"] .md-main {
  background: rgba(7, 16, 31, 0.55);
}

/* Content "glass" panel */
[data-md-color-scheme="slate"] .md-content__inner {
  background: rgba(7, 16, 31, 0.45);
  border-radius: 14px;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Typography for dark mode */
[data-md-color-scheme="slate"] .md-typeset,
[data-md-color-scheme="slate"] .md-typeset p,
[data-md-color-scheme="slate"] .md-typeset li {
  color: rgba(255, 255, 255, 0.92);
}

[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4 {
  color: rgba(255, 255, 255, 0.98);
}

/* ------------------------------
   Links
   ------------------------------ */
[data-md-color-scheme="slate"] .md-typeset a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration-color: rgba(255, 255, 255, 0.55);
}
[data-md-color-scheme="slate"] .md-typeset a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

/* ------------------------------
   Sidebar
   ------------------------------ */
[data-md-color-scheme="slate"] .md-sidebar {
  background: rgba(7, 16, 31, 0.30);
}

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

/* ------------------------------
   Tables (change logs shine here)
   ------------------------------ */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  background: rgba(7, 16, 31, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) thead th {
  background: rgba(19, 38, 74, 0.55);
  color: #ffffff;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th,
[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-color: rgba(255, 255, 255, 0.08);
  padding: 0.65rem 0.75rem;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

/* ------------------------------
   Admonitions
   ------------------------------ */
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  background: rgba(7, 16, 31, 0.50);
  border-color: rgba(255, 255, 255, 0.10);
}

.md-typeset .admonition.note > .admonition-title,
.md-typeset details.note > summary {
  background: rgba(19, 38, 74, 0.40);
}

/* ------------------------------
   Code blocks
   ------------------------------ */
.md-typeset pre > code {
  border-radius: 10px;
  background: rgba(7, 16, 31, 0.75);
}

.md-typeset code {
  border-radius: 6px;
  padding: 0.1em 0.3em;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

/* ------------------------------
   Header logo sizing
   ------------------------------ */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 28px;
  width: auto;
}

/* ==========================================================================
   ReFlux – Global gradient background (always on)
   ========================================================================== */

/* Apply the brand gradient to the entire page */
html,
body {
  background: linear-gradient(
    90deg,
    var(--reflux-brand-1),
    var(--reflux-brand-2),
    var(--reflux-brand-3)
  ) fixed !important;
}

/* Remove ALL Material surfaces that block the gradient */
.md-container,
.md-main,
.md-content,
.md-main__inner,
.md-content__inner {
  background: transparent !important;
  border: 0 !important;
}

/* Ensure light readable text on gradient */
.md-typeset,
.md-typeset p,
.md-typeset li {
  color: rgba(255, 255, 255, 0.92) !important;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: rgba(255, 255, 255, 0.98) !important;
}

/* Slight text shadow improves readability on gradients */
.md-typeset p,
.md-typeset li,
.md-typeset a {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

/* Links */
.md-typeset a {
  color: rgba(255, 255, 255, 0.95) !important;
  text-decoration-color: rgba(255, 255, 255, 0.55);
}
.md-typeset a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

/* Tables on gradient */
.md-typeset table:not([class]) {
  background: rgba(7, 16, 31, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.md-typeset table:not([class]) thead th {
  background: rgba(19, 38, 74, 0.70);
  color: #ffffff;
}

/* Code blocks */
.md-typeset pre > code {
  background: rgba(7, 16, 31, 0.80);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   ReFlux – Subtle overlay to calm the global gradient (tabs-safe)
   ========================================================================== */

/* Create a stacking context so z-index works predictably */
html, body {
  position: relative;
}

/* Overlay is BEHIND the entire UI (header/tabs/sidebar/content) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.14); /* tweak 0.10–0.20 */
  pointer-events: none;
  z-index: -1;
}

/* ==========================================================================
   ReFlux – Mobile drawer (sidebar) header gradient
   Material uses a separate header area for the nav drawer on small screens.
   ========================================================================== */

/* The drawer container itself */
.md-nav__source {
  background: linear-gradient(
    90deg,
    var(--reflux-brand-1),
    var(--reflux-brand-2),
    var(--reflux-brand-3)
  ) !important;
}

/* Ensure text/icons in that area stay readable */
.md-nav__source,
.md-nav__source a,
.md-nav__source .md-nav__title,
.md-nav__source .md-nav__button {
  color: #ffffff !important;
}

/* Optional: soften the drawer panel behind the nav list */
.md-sidebar--primary .md-sidebar__scrollwrap {
  background: rgba(7, 16, 31, 0.55) !important;
}