/* ==========================================================================
   x64dbg-mcp Documentation Design System
   Architecture: High-density 3-column layout (Stripe / Mintlify / Tailwind)
   Strict Monochrome / Slate Dark Mode (WCAG compliant, zero AI gradient/glow)
   ========================================================================== */

:root {
  --bg-canvas: #090a0f;
  --bg-sidebar: #06070a;
  --bg-surface: #0e1117;
  --bg-surface-elevated: #141821;
  --bg-surface-subtle: #181d28;
  --bg-code: #030406;
  --bg-input: #10141d;

  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-muted: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);

  --text-primary: #f0f6fc;
  --text-secondary: #c9d1d9;
  --text-muted: #8b949e;
  --text-faint: #484f58;

  --accent-cyan: #39c5cf;
  --accent-cyan-subtle: rgba(57, 197, 207, 0.12);
  --accent-blue: #58a6ff;
  --accent-blue-subtle: rgba(88, 166, 255, 0.12);
  --accent-green: #3fb950;
  --accent-orange: #d29922;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Geist Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --header-height: 56px;
  --sidebar-left-width: 280px;
  --sidebar-right-width: 240px;
  --content-max-width: 820px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background-color: rgba(6, 7, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-symbol {
  width: 28px;
  height: 28px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.brand-text {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-divider {
  color: var(--text-faint);
  font-weight: 300;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.header-search {
  flex: 0 1 420px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 34px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 0 40px 0 34px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}

.header-search input:focus {
  border-color: var(--border-strong);
  background-color: #121824;
}

.search-icon-svg {
  position: absolute;
  left: 10px;
  top: 9px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-kbd-shortcut {
  position: absolute;
  right: 8px;
  top: 7px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.version-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 3px 8px;
  border-radius: 12px;
}

.github-link,
.discord-link {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
  text-decoration: none;
}

.github-link:hover {
  color: var(--text-primary);
}

.discord-link:hover {
  color: #5865F2;
}

/* 3-Column Layout */
.docs-container {
  display: flex;
  width: 100%;
  min-height: calc(100vh - var(--header-height));
}

/* 1. Left Navigation */
.left-sidebar {
  width: var(--sidebar-left-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-hairline);
  overflow-y: auto;
  padding: 24px 16px 40px;
  flex-shrink: 0;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-tree {
  list-style: none;
  border-left: 1px solid var(--border-hairline);
  margin-left: 14px;
  padding-left: 8px;
}

.nav-item {
  position: relative;
  margin: 2px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 13.5px;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: var(--accent-cyan);
  background-color: var(--accent-cyan-subtle);
  font-weight: 500;
}

.nav-tag-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 1px 5px;
  border-radius: 10px;
  color: var(--text-faint);
}

/* 2. Center Content */
.center-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 48px 48px 120px;
}

.prose-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.doc-article {
  display: none;
}

.doc-article.active {
  display: block;
}

/* 3. Right Table of Contents */
.right-toc {
  width: var(--sidebar-right-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  padding: 32px 20px 40px;
  overflow-y: auto;
  flex-shrink: 0;
}

.toc-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  border-left: 1px solid var(--border-hairline);
  padding-left: 12px;
}

.toc-link {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.4;
  transition: color 0.12s ease;
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--accent-cyan);
  font-weight: 500;
}

/* Typography */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 14px;
}

.lead-paragraph {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 32px;
}

h2 {
  font-size: 21px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 48px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 12px;
}

p {
  margin-bottom: 18px;
  color: var(--text-secondary);
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0 36px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 16px 18px;
}

.stat-num {
  font-size: 24px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Code Snippets */
.code-container {
  background-color: var(--bg-code);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  margin: 20px 0 24px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0c0f15;
  border-bottom: 1px solid var(--border-hairline);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

pre {
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #e6edf3;
}

code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

pre code {
  background-color: transparent;
  border: none;
  padding: 0;
}

/* Callout */
.callout {
  border-left: 3px solid var(--accent-cyan);
  background-color: var(--bg-surface);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
}

.callout-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout p {
  margin-bottom: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Steps Flow */
.stepper {
  margin: 32px 0;
}

.stepper-item {
  display: flex;
  gap: 20px;
  position: relative;
  padding-bottom: 32px;
}

.stepper-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 1px;
  background-color: var(--border-hairline);
}

.stepper-index {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.stepper-content {
  flex: 1;
}

.stepper-content h3 {
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Tabs */
.client-tabs {
  margin: 24px 0;
}

.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-hairline);
  overflow-x: auto;
}

.tab-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.tab-pill:hover {
  color: var(--text-primary);
}

.tab-pill.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.tab-pane {
  display: none;
  padding-top: 16px;
}

.tab-pane.active {
  display: block;
}

/* Tool Explorer 234 */
.explorer-search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.explorer-input {
  flex: 1;
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}

.explorer-input:focus {
  border-color: var(--border-strong);
}

.category-filter-select {
  height: 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tool-entry {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 14px 18px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.tool-entry:hover {
  border-color: var(--border-muted);
  background-color: var(--bg-surface-elevated);
}

.tool-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.tool-entry-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
}

.tool-entry-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  padding: 2px 7px;
  border-radius: 4px;
}

.tool-entry-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.tool-entry-params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.param-token {
  font-family: var(--font-mono);
  font-size: 11px;
  background-color: #0b0e14;
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: 3px;
  color: #79c0ff;
}

.param-type-token {
  color: var(--text-faint);
}

/* Responsive */
@media (max-width: 1180px) {
  .right-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .left-sidebar {
    display: none;
  }
  .center-content {
    padding: 32px 20px 80px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
