/* ── Ntradex Developer Docs ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0d1117;
  --bg-sidebar:   #0a0e17;
  --bg-card:      #161b27;
  --bg-code:      #111722;
  --border:       #21293a;
  --border-light: #1e2738;
  --text:         #e2e8f0;
  --text-muted:   #7d8fa8;
  --text-dim:     #4a5568;
  --accent:       #2563eb;
  --accent-light: #3b82f6;
  --accent-glow:  rgba(37,99,235,0.15);
  --green:        #10b981;
  --red:          #ef4444;
  --yellow:       #f59e0b;
  --purple:       #8b5cf6;
  --sidebar-w:    260px;
  --topbar-h:     56px;
  --content-max:  720px;
  --code-max:     420px;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── TOP BAR ── */
.docs-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(10,14,23,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 24px;
}
.docs-topbar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 700; font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.docs-topbar-logo img { flex-shrink: 0; max-height: 24px; width: auto; }
.docs-topbar-logo .logo-sep {
  width: 1px; height: 18px; background: var(--border);
  margin: 0 4px;
}
.docs-topbar-logo .logo-tag {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.docs-topbar-spacer { flex: 1; }
.docs-topbar-links { display: flex; align-items: center; gap: 20px; }
.docs-topbar-links a {
  font-size: 0.82rem; color: var(--text-muted);
  text-decoration: none; font-weight: 500;
  transition: color 0.15s;
}
.docs-topbar-links a:hover { color: var(--text); }
.docs-topbar-cta {
  background: var(--accent); color: #fff !important;
  padding: 6px 14px; border-radius: 6px;
  font-size: 0.78rem !important; font-weight: 600 !important;
  transition: background 0.15s !important;
}
.docs-topbar-cta:hover { background: var(--accent-light) !important; }
.version-badge {
  font-size: 0.68rem; font-weight: 600;
  background: var(--accent-glow); color: var(--accent-light);
  border: 1px solid rgba(59,130,246,0.3);
  padding: 2px 8px; border-radius: 99px;
}

/* ── LAYOUT ── */
.docs-layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.docs-sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section { margin-bottom: 4px; }
.sidebar-section-label {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 20px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px;
  font-size: 0.84rem; color: var(--text-muted);
  text-decoration: none; font-weight: 400;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  cursor: pointer;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar-link.active {
  color: var(--accent-light);
  border-left-color: var(--accent-light);
  background: var(--accent-glow);
  font-weight: 500;
}
.sidebar-link .method-badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 3px;
  text-transform: uppercase; flex-shrink: 0;
}
.badge-get    { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-post   { background: rgba(37,99,235,0.15);  color: var(--accent-light); }
.badge-delete { background: rgba(239,68,68,0.15);  color: var(--red); }
.badge-patch  { background: rgba(245,158,11,0.15); color: var(--yellow); }

/* ── MAIN CONTENT AREA ── */
.docs-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── SECTION PAGES ── */
.docs-section { display: none; }
.docs-section.active { display: block; }

.docs-page {
  display: grid;
  grid-template-columns: 1fr var(--code-max);
  min-height: calc(100vh - var(--topbar-h));
  align-items: start;
}

/* Content col */
.docs-content {
  padding: 48px 48px 80px;
  max-width: var(--content-max);
}
.docs-content h1 {
  font-size: 1.9rem; font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px; line-height: 1.2;
}
.docs-content h2 {
  font-size: 1.15rem; font-weight: 600;
  margin: 40px 0 12px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.docs-content h3 {
  font-size: 0.95rem; font-weight: 600;
  margin: 24px 0 8px; color: var(--text);
}
.docs-content p { color: #a8b8cc; margin-bottom: 14px; font-size: 0.92rem; }
.docs-content ul, .docs-content ol {
  color: #a8b8cc; font-size: 0.92rem;
  margin: 0 0 14px 20px; line-height: 1.8;
}
.docs-content a { color: var(--accent-light); text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }

.lead-text {
  font-size: 1rem !important; color: var(--text-muted) !important;
  margin-bottom: 32px !important; line-height: 1.7;
}

/* Endpoint badge */
.endpoint-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 16px 0 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.endpoint-badge .method {
  font-weight: 700; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 4px;
}
.method-GET    { background: rgba(16,185,129,0.15); color: var(--green); }
.method-POST   { background: rgba(37,99,235,0.15);  color: var(--accent-light); }
.method-DELETE { background: rgba(239,68,68,0.15);  color: var(--red); }
.method-PATCH  { background: rgba(245,158,11,0.15); color: var(--yellow); }
.endpoint-badge .path { color: var(--text); }
.endpoint-badge .version { color: var(--text-dim); font-size: 0.75rem; }

/* Param table */
.param-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.85rem; }
.param-table th {
  text-align: left; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.param-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.param-table td:first-child { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-light); }
.param-table td:nth-child(2) { color: var(--text-dim); font-size: 0.78rem; }
.param-table td:last-child { color: #8fa5be; font-size: 0.82rem; }
.required-badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
  background: rgba(239,68,68,0.12); color: #fc8181;
  padding: 1px 5px; border-radius: 3px; margin-left: 6px;
  text-transform: uppercase;
}
.optional-badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
  background: rgba(125,143,168,0.1); color: var(--text-dim);
  padding: 1px 5px; border-radius: 3px; margin-left: 6px;
  text-transform: uppercase;
}

/* Callout */
.callout {
  border-left: 3px solid;
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-size: 0.875rem;
}
.callout-info  { border-color: var(--accent); background: var(--accent-glow); color: #90b4e8; }
.callout-warn  { border-color: var(--yellow); background: rgba(245,158,11,0.08); color: #f6c35e; }
.callout-success { border-color: var(--green); background: rgba(16,185,129,0.08); color: #5eead4; }
.callout strong { color: inherit; }

/* Status table */
.status-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.85rem; }
.status-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.status-table td:first-child { font-family: var(--font-mono); font-size: 0.8rem; }
.status-ok   { color: var(--green); }
.status-err  { color: var(--red); }
.status-warn { color: var(--yellow); }

/* Code column */
.docs-code-col {
  background: var(--bg-code);
  border-left: 1px solid var(--border);
  padding: 48px 0;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.code-block {
  margin-bottom: 1px;
  border-bottom: 1px solid var(--border);
}
.code-block-label {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 16px 20px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.code-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.code-tab {
  font-size: 0.75rem; font-weight: 500;
  padding: 8px 16px; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.12s; user-select: none;
}
.code-tab.active { color: var(--accent-light); border-bottom-color: var(--accent-light); }
.code-snippet {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem; line-height: 1.7;
  color: #abb2bf; overflow-x: auto;
  white-space: pre;
}
/* Syntax highlight helpers */
.t-key    { color: #e06c75; }
.t-str    { color: #98c379; }
.t-num    { color: #d19a66; }
.t-bool   { color: #56b6c2; }
.t-null   { color: var(--text-dim); }
.t-comment{ color: #5c6370; font-style: italic; }
.t-method { color: #61afef; }
.t-url    { color: #98c379; }
.t-header { color: #c678dd; }

/* Home hero */
.docs-hero {
  padding: 60px 48px 40px;
  border-bottom: 1px solid var(--border);
  grid-column: 1 / -1;
}
.hero-eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-light);
  margin-bottom: 16px;
}
.hero-title {
  font-size: 2.4rem; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 16px;
}
.hero-title span { color: var(--accent-light); }
.hero-sub { font-size: 1.05rem; color: var(--text-muted); max-width: 540px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent); color: #fff;
  padding: 10px 22px; border-radius: 8px;
  font-size: 0.88rem; font-weight: 600;
  text-decoration: none; transition: background 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 22px; border-radius: 8px;
  font-size: 0.88rem; font-weight: 600;
  text-decoration: none; transition: border-color 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-outline:hover { border-color: var(--text-muted); }

/* Quick start cards */
.qs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin: 32px 0;
}
.qs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 22px;
  cursor: pointer; transition: border-color 0.15s;
  text-decoration: none;
}
.qs-card:hover { border-color: var(--accent-light); }
.qs-icon { font-size: 1.4rem; margin-bottom: 10px; }
.qs-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.qs-desc  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* Corridor grid */
.corridor-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin: 16px 0;
}
.corridor-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px;
  font-size: 0.82rem; display: flex; align-items: center; gap: 10px;
}
.corridor-chip .pair { font-family: var(--font-mono); font-weight: 600; color: var(--accent-light); }
.corridor-chip .label { color: var(--text-muted); }
.corridor-chip .status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); margin-left: auto; flex-shrink: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .docs-page { grid-template-columns: 1fr; }
  .docs-code-col { display: none; }
}
@media (max-width: 720px) {
  .docs-sidebar { transform: translateX(-100%); transition: transform 0.2s; z-index: 50; }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-main { margin-left: 0; }
  .docs-content { padding: 32px 20px 60px; }
  .qs-grid { grid-template-columns: 1fr; }
  .corridor-grid { grid-template-columns: 1fr; }
  .docs-topbar { padding: 0 16px; }
}

/* ── CLASS ALIASES (HTML uses these names) ── */
/* .docs-code aliases .docs-code-col */
.docs-code {
  background: var(--bg-code);
  border-left: 1px solid var(--border);
  padding: 32px 0 48px;
}
/* .code-panel aliases .code-snippet */
.code-panel {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem; line-height: 1.7;
  color: #abb2bf; overflow-x: auto;
  white-space: pre-wrap;
  display: none;
}
.code-panel.active { display: block; }
.code-panel pre {
  margin: 0; padding: 0;
  font-family: inherit; font-size: inherit;
  line-height: inherit; color: inherit;
  white-space: pre-wrap; overflow-x: auto;
}
/* code-response block */
.code-response {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem; line-height: 1.7;
  color: #abb2bf; overflow-x: auto;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
}
/* quick-card clickable */
.quick-card {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
/* badge classes used in HTML */
.badge-required {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
  background: rgba(239,68,68,0.12); color: #fc8181;
  padding: 1px 5px; border-radius: 3px;
  text-transform: uppercase;
}
/* method badges inside endpoint-badge */
.method-get    { background: rgba(16,185,129,0.15); color: #34d399; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; margin-right: 8px; }
.method-post   { background: rgba(99,102,241,0.15); color: #818cf8; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; margin-right: 8px; }
.method-patch  { background: rgba(245,158,11,0.15); color: #fbbf24; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; margin-right: 8px; }
.method-delete { background: rgba(239,68,68,0.15);  color: #f87171; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; margin-right: 8px; }
@media (max-width: 1100px) {
  .docs-code { display: none; }
}
