/* ============================================================
   TrustNest Internal Documentation — Thales Quantum Design
   Source: trustnest-new-portal/src/index.css + HomePage.jsx
   ============================================================ */

:root {
  /* Primary palette — from TrustNest Quantum tokens */
  --md-primary-fg-color:        #25286b;
  --md-primary-fg-color--light: #729bcd;
  --md-primary-fg-color--dark:  #041295;
  --md-accent-fg-color:         #b91c1c;
  --md-typeset-a-color:         #2970c1;

  /* Font stack — from TrustNest */
  --md-text-font: "Inter", "Segoe UI", sans-serif;
  --md-code-font: "JetBrains Mono", "Fira Code", monospace;

  /* Extended palette */
  --tn-surface: #f8fafc;
  --tn-border: #e2e8f0;
  --tn-text-secondary: #64748b;
}

/* ---- Global ---- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Header — bold gradient ---- */
.md-header {
  background: linear-gradient(135deg, #0f172a 0%, #25286b 60%, #041295 100%);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
}

.md-header__title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-header[data-md-state="shadow"] {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.35);
}

/* ---- Navigation tabs ---- */
.md-tabs {
  background: linear-gradient(90deg, #25286b, #1e206a);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
}

.md-tabs__link {
  font-weight: 500;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  opacity: 1;
}

/* ---- Sidebar — sticky while scrolling ---- */
.md-sidebar {
  border-right: 1px solid var(--tn-border);
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.md-nav__item--active > .md-nav__link {
  color: #25286b;
  font-weight: 700;
  border-left: 3px solid #25286b;
  padding-left: 0.65rem;
}

.md-nav__link {
  transition: color 0.15s, padding-left 0.15s;
  border-left: 3px solid transparent;
}

.md-nav__link:hover {
  color: var(--md-typeset-a-color);
}

/* ---- Content typography ---- */
.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.md-typeset h2 {
  font-weight: 700;
  color: #25286b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.3rem;
}

.md-typeset h3 {
  font-weight: 600;
  color: #1e293b;
}

/* ---- Links ---- */
.md-typeset a {
  color: var(--md-typeset-a-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.md-typeset a:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

/* ---- Code blocks — bold styling ---- */
.md-typeset pre {
  border-radius: 8px;
  border: 1px solid var(--tn-border);
}

.highlight {
  border-left: 4px solid #25286b;
  border-radius: 0 8px 8px 0;
}

.md-typeset code {
  border-radius: 4px;
  font-size: 0.82em;
  padding: 0.15em 0.4em;
}

/* ---- Tables — modern ---- */
.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--tn-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.md-typeset table:not([class]) th {
  background: linear-gradient(135deg, #25286b, #041295);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.md-typeset table:not([class]) td {
  border-color: var(--tn-border);
}

.md-typeset table:not([class]) tr:hover td {
  background: #f0f7ff;
}

/* ---- Admonitions — refined ---- */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  border-width: 0 0 0 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.md-typeset .admonition.note,
.md-typeset details.note {
  border-left-color: #25286b;
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-left-color: #b91c1c;
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-left-color: #059669;
}

.md-typeset .admonition.info,
.md-typeset details.info {
  border-left-color: #0284c7;
}

/* ---- Footer — bold ---- */
.md-footer {
  background: linear-gradient(135deg, #0f172a 0%, #25286b 100%);
}

.md-footer-meta {
  background: rgba(0, 0, 0, 0.2);
}

/* ---- Search — refined ---- */
.md-search__input {
  border-radius: 8px;
  font-size: 0.9rem;
}

.md-search-result__meta {
  color: var(--tn-text-secondary);
}

/* ---- Content action buttons ---- */
.md-content__button {
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---- Responsive refinements ---- */
@media (max-width: 768px) {
  .md-header__title {
    font-size: 0.9rem;
  }
}

/* ============================================================
   Dark mode (scheme: slate)
   ============================================================ */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #25286b;
  --md-primary-fg-color--light: #729bcd;
  --md-primary-fg-color--dark:  #041295;
  --md-accent-fg-color:         #f87171;
  --md-typeset-a-color:         #60a5fa;
  --tn-surface: #1e1e2e;
  --tn-border: #313244;
  --tn-text-secondary: #94a3b8;
}

[data-md-color-scheme="slate"] .md-typeset h1 {
  color: #e2e8f0;
}

[data-md-color-scheme="slate"] .md-typeset h2 {
  color: #93c5fd;
  border-bottom-color: #313244;
}

[data-md-color-scheme="slate"] .md-typeset h3 {
  color: #cbd5e1;
}

[data-md-color-scheme="slate"] .md-typeset a:hover {
  color: #93c5fd;
  border-bottom-color: #93c5fd;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tr:hover td {
  background: rgba(96, 165, 250, 0.08);
}

[data-md-color-scheme="slate"] .md-nav__item--active > .md-nav__link {
  color: #93c5fd;
  border-left-color: #93c5fd;
}

[data-md-color-scheme="slate"] .highlight {
  border-left-color: #729bcd;
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background: #475569;
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
