/* BramandScript Documentation Portal Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-blue: #2563eb;
  --accent-cyan: #0891b2;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

html.dark {
  /* Dark Theme */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --border-color: #2e384d;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --code-bg: #090d16;
  --code-text: #f1f5f9;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

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

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

html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

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

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Typography & Code */
code, pre, kbd {
  font-family: var(--font-mono);
}

/* Inline Code */
:not(pre) > code {
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 0.375rem;
  background-color: var(--bg-tertiary);
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

/* Code Snippet Blocks */
.code-block-wrapper {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--code-bg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 1.25rem 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--code-text);
}

/* Syntax Highlighting Tokens */
.token-kw { color: #f43f5e; font-weight: 600; }     /* let, const, fn, return, if, etc */
.token-type { color: #38bdf8; font-weight: 500; }   /* Point, Person, etc */
.token-fn { color: #a855f7; font-weight: 500; }     /* function calls, builtins */
.token-str { color: #34d399; }                      /* strings */
.token-num { color: #fb923c; }                      /* numbers */
.token-bool { color: #f59e0b; font-weight: 500; }   /* true, false, null */
.token-op { color: #38bdf8; }                        /* +, -, =, ==, etc */
.token-comment { color: #64748b; font-style: italic; } /* // comments */
.token-punct { color: #94a3b8; }                    /* ;, :, ,, {, } */

/* Copy Button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.copy-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
  background-color: rgba(52, 211, 153, 0.1);
}

/* Callout Cards */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 0.625rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  border-left-width: 4px;
}

.callout-info {
  background-color: rgba(14, 165, 233, 0.08);
  border-left-color: #0284c7;
  color: var(--text-primary);
}

.callout-tip {
  background-color: rgba(16, 185, 129, 0.08);
  border-left-color: #059669;
  color: var(--text-primary);
}

.callout-warning {
  background-color: rgba(245, 158, 11, 0.08);
  border-left-color: #d97706;
  color: var(--text-primary);
}

.callout-danger {
  background-color: rgba(239, 68, 68, 0.08);
  border-left-color: #dc2626;
  color: var(--text-primary);
}

/* Sidebar Navigation Items */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--accent-blue);
  background-color: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent-blue);
  font-weight: 600;
  background-color: rgba(37, 99, 235, 0.08);
  border-left: 3px solid var(--accent-blue);
}

/* Top Navigation Pills */
.nav-pill {
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-pill:hover {
  color: var(--accent-blue);
  background-color: var(--bg-tertiary);
}

.nav-pill.active {
  color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

/* Table styles */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.doc-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.doc-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.doc-table tr:hover td {
  background-color: rgba(0, 0, 0, 0.02);
}

html.dark .doc-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Section Anchor */
.section-anchor {
  scroll-margin-top: 5rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-blue {
  background-color: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-green {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-purple {
  background-color: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.badge-orange {
  background-color: rgba(249, 115, 22, 0.15);
  color: #f97316;
}
