/* AgentCop Documentation — Design System */

:root {
  --bg: #0a0f1a;
  --bg-card: #111827;
  --bg-sidebar: #0d1321;
  --bg-code: #0f172a;
  --accent: #10b891;
  --accent-light: #5de8c8;
  --accent-dim: rgba(16, 184, 145, 0.15);
  --accent-border: rgba(16, 184, 145, 0.3);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --border: #1e293b;
  --border-light: #253044;
  --sidebar-w: 260px;
  --right-nav-w: 220px;
  --header-h: 56px;
  --radius: 8px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

/* ─── HEADER ─────────────────────────────────────────── */
.doc-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.header-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  color: #000;
}

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

.header-search {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px 7px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-faint); }

.header-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.header-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.header-links a:hover { color: var(--text); background: var(--bg-card); }

.header-cta {
  background: var(--accent) !important;
  color: #000 !important;
  font-weight: 600;
  padding: 6px 14px !important;
}

.header-cta:hover { background: var(--accent-light) !important; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

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

/* ─── SIDEBAR ────────────────────────────────────────── */
.doc-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  z-index: 50;
  transition: transform 0.25s ease;
}

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

.nav-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 12px 8px 4px;
  display: block;
}

.nav-item {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
  transition: color 0.15s, background 0.15s;
  margin-bottom: 1px;
}

.nav-item:hover {
  color: var(--text);
  background: var(--accent-dim);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  display: inline-block;
  width: 2px;
  height: 12px;
  background: var(--accent);
  border-radius: 1px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ─── MAIN CONTENT ───────────────────────────────────── */
.doc-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-right: var(--right-nav-w);
  min-width: 0;
}

.doc-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* ─── RIGHT NAV (On this page) ───────────────────────── */
.doc-right-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: var(--right-nav-w);
  padding: 28px 16px 40px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  scrollbar-width: none;
}

.doc-right-nav::-webkit-scrollbar { display: none; }

.right-nav-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.right-nav-list {
  list-style: none;
}

.right-nav-list li { margin-bottom: 2px; }

.right-nav-list a {
  display: block;
  font-size: 12.5px;
  color: var(--text-faint);
  text-decoration: none;
  padding: 3px 8px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.right-nav-list a:hover { color: var(--text-muted); border-left-color: var(--border); }
.right-nav-list a.active { color: var(--accent); border-left-color: var(--accent); }
.right-nav-list .indent { padding-left: 20px; }

/* ─── BREADCRUMBS ────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 24px;
}

.breadcrumbs a { color: var(--text-faint); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--border); }

/* ─── PAGE HEADER ────────────────────────────────────── */
.page-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.page-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.page-lead {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 600px;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────── */
.doc-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.doc-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 10px;
}

.doc-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

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

.doc-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
  transition: border-color 0.15s;
}

.doc-content a:hover { border-bottom-color: var(--accent); }

.doc-content ul, .doc-content ol {
  margin: 0 0 16px 20px;
  color: var(--text-muted);
}

.doc-content li { margin-bottom: 6px; }

.doc-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ─── INLINE CODE ────────────────────────────────────── */
.doc-content code:not([class]) {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--accent-light);
}

/* ─── CODE BLOCKS ────────────────────────────────────── */
.code-block {
  position: relative;
  margin: 24px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d1421;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-faint);
  font-size: 11px;
  font-family: var(--font-body);
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--accent); color: var(--accent); }

.code-block pre {
  background: var(--bg-code);
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.code-block pre::-webkit-scrollbar { height: 4px; }
.code-block pre::-webkit-scrollbar-track { background: transparent; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--border); }

.code-block pre code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  background: none;
  border: none;
  padding: 0;
}

/* ─── CALLOUTS ───────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
  border-left: 3px solid;
}

.callout-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.callout p { margin-bottom: 0; font-size: 14px; }

.callout.info {
  background: rgba(16, 184, 145, 0.06);
  border-color: var(--accent);
}
.callout.info .callout-title { color: var(--accent); }

.callout.warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: #f59e0b;
}
.callout.warning .callout-title { color: #f59e0b; }

.callout.danger {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
}
.callout.danger .callout-title { color: #ef4444; }

.callout.sentinel {
  background: rgba(139, 92, 246, 0.06);
  border-color: #8b5cf6;
  font-style: italic;
}
.callout.sentinel .callout-title { color: #8b5cf6; font-style: normal; }

/* ─── TABLES ─────────────────────────────────────────── */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.doc-content table th {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-content table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.doc-content table tr:nth-child(even) td { background: rgba(255,255,255,0.01); }
.doc-content table tr:hover td { background: var(--accent-dim); }

.check { color: var(--accent); font-weight: 700; }
.cross { color: #ef4444; }

/* ─── BADGES / TAGS ──────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-green { background: rgba(16,184,145,0.12); color: var(--accent); border: 1px solid var(--accent-border); }
.tag-yellow { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.tag-red { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.tag-purple { background: rgba(139,92,246,0.12); color: #8b5cf6; border: 1px solid rgba(139,92,246,0.3); }
.tag-blue { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* ─── STEP LIST ──────────────────────────────────────── */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  color: var(--text-muted);
}

.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ─── CARDS ──────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text-muted);
  transition: border-color 0.2s, background 0.2s;
  display: block;
}

.card:hover {
  border-color: var(--accent-border);
  background: rgba(16,184,145,0.03);
  color: var(--text-muted);
}

.card-icon {
  font-size: 22px;
  margin-bottom: 10px;
  display: block;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.card-desc { font-size: 13px; line-height: 1.5; }

/* ─── PREV/NEXT NAV ──────────────────────────────────── */
.page-nav {
  display: flex;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.page-nav-link {
  flex: 1;
  display: block;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s;
}

.page-nav-link:hover { border-color: var(--accent-border); }

.page-nav-dir {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.page-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.page-nav-link.next { text-align: right; }

/* ─── CVE CHIP ────────────────────────────────────────── */
.cve-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
}

/* ─── MOBILE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .doc-right-nav { display: none; }
  .doc-main { margin-right: 0; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .header-search { display: none; }

  .doc-sidebar {
    transform: translateX(-100%);
  }

  .doc-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .doc-main {
    margin-left: 0;
  }

  .doc-content {
    padding: 24px 20px 60px;
  }

  .page-nav { flex-direction: column; }
}

/* ─── HLJS THEME OVERRIDE ────────────────────────────── */
.hljs {
  background: var(--bg-code) !important;
  color: #abb2bf;
}

.hljs-keyword, .hljs-selector-tag { color: #c678dd; }
.hljs-string, .hljs-attr { color: #98c379; }
.hljs-number, .hljs-literal { color: #d19a66; }
.hljs-comment { color: #5c6370; font-style: italic; }
.hljs-function, .hljs-title { color: #61afef; }
.hljs-class, .hljs-type { color: #e5c07b; }
.hljs-variable { color: #e06c75; }
.hljs-built_in { color: #56b6c2; }
.hljs-params { color: var(--text-muted); }
.hljs-meta { color: var(--accent-light); }

/* ─── HERO (homepage) ────────────────────────────────── */
.doc-hero {
  background: linear-gradient(135deg, rgba(16,184,145,0.05) 0%, transparent 60%);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 36px;
  margin-bottom: 40px;
}

.doc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ─── COMPARISON TABLE ────────────────────────────────── */
.comparison-table th:first-child { width: 220px; }
.comparison-table td:first-child { font-weight: 600; color: var(--text); }
.comparison-table th.highlight-col { color: var(--accent); }
.comparison-table td.highlight-col { background: rgba(16,184,145,0.04); }

/* ─── TERMINAL BLOCK ─────────────────────────────────── */
.terminal {
  background: #050a12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
}

.terminal-bar {
  background: #0d1421;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot:nth-child(1) { background: #ef4444; }
.terminal-dot:nth-child(2) { background: #f59e0b; }
.terminal-dot:nth-child(3) { background: #22c55e; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 6px;
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--text-faint); }
.terminal-body .success { color: var(--accent-light); }
.terminal-body .error { color: #ef4444; }

/* ─── OWASP PILL ─────────────────────────────────────── */
.owasp-ref {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  color: #f87171;
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-mono);
}

/* ─── SIDEBAR OVERLAY ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 49;
}

.sidebar-overlay.visible { display: block; }
