/* ══════════════════════════════════════════════════════════════
   aixa.js Docs — Professional dark theme
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg-card: #111118;
  --bg-code: #0d0d14;
  --border: #1e1e2e;
  --border-hover: #2e2e44;
  --text: #f0f0f6;
  --text-secondary: #9090a8;
  --text-muted: #606078;
  --accent: #6366f1;
  --accent-bg: rgba(99,102,241,0.08);
  --green: #22c55e;
  --amber: #f59e0b;
  --amber-bg: rgba(245,158,11,0.08);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 0.15s ease;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ────────────────────────────────────── */
.docs-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────── */
.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-logo {
  padding: 0 24px 20px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo a {
  color: var(--text);
  text-decoration: none;
}

.sidebar-logo .accent { color: var(--accent); }

.nav-section {
  padding: 0 16px;
  margin-bottom: 20px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

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

.nav-link.active {
  color: var(--text);
  background: var(--accent-bg);
  font-weight: 600;
}

.nav-link.demo-link {
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

/* ── Content ──────────────────────────────────── */
.docs-content {
  flex: 1;
  overflow-y: auto;
  padding: 48px 56px;
  max-width: 800px;
}

.docs-content::-webkit-scrollbar { width: 6px; }
.docs-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.docs-content h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.docs-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 8px;
}

.docs-content p {
  margin-bottom: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
  font-size: 14px;
}

.docs-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.docs-content a:hover { text-decoration: underline; }

.docs-content strong { color: var(--text); font-weight: 600; }

/* ── Lists ─────────────────────────────────────── */
.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 20px;
}

.docs-content li {
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Code ──────────────────────────────────────── */
.docs-content :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid var(--border);
}

.docs-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  border: none;
}

.docs-content pre .kw { color: #c084fc; }
.docs-content pre .fn { color: #818cf8; }
.docs-content pre .str { color: #22c55e; }
.docs-content pre .cm { color: var(--text-muted); }

/* ── Tables ────────────────────────────────────── */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}

.docs-content th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.docs-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.docs-content td:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ── Callouts ──────────────────────────────────── */
.callout {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.callout.warning {
  border-left-color: var(--amber);
  background: var(--amber-bg);
}

.callout.danger {
  border-left-color: var(--red);
  background: var(--red-bg);
}

/* ── Concept Cards ─────────────────────────────── */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: all var(--transition);
  display: block;
}

.concept-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.concept-card .card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.concept-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  border: none;
  padding: 0;
}

.concept-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ── Page Nav (prev/next) ──────────────────────── */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
}

.page-nav a:hover { color: var(--text); text-decoration: none; }

.page-nav .direction {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-nav .label {
  color: var(--accent);
  font-weight: 600;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .docs-sidebar { display: none; }
  .docs-content { padding: 24px 20px; max-width: 100%; }
}
