/* CEREBRO DOCS - DOCUMENTATION DESIGN SYSTEM */

:root {
  /* Colors - Light Theme */
  --bg-dark: #ffffff;
  --bg-panel: #f8fafc;
  --bg-elevated: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --border: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.05);

  /* Typography */
  --font-sans: 'Inter Tight', 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-display: 'Righteous', cursive;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 60px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-dark: #0a0b0d;
  --bg-panel: #13151b;
  --bg-elevated: #1a1d25;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --accent-hover: #38bdf8;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

/* HEADER */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  height: var(--header-height);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.docs-header-content {
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-link h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .logo-link h1 {
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-badge {
  padding: 4px 10px;
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.header-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-links a:hover {
  color: var(--text-primary);
}

.theme-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  background: rgba(100, 116, 139, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(100, 116, 139, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  padding: 0;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .theme-toggle::before {
  left: 31px;
  background: var(--text-secondary);
}

.theme-toggle svg {
  position: absolute;
  width: 12px;
  height: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theme-toggle .sun-icon {
  left: 5px;
  opacity: 1;
}

.theme-toggle .moon-icon {
  right: 5px;
  opacity: 0.3;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0.3;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
}

/* LAYOUT */
.docs-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
  overflow-x: hidden;
}

/* SIDEBAR */
.docs-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 32px 0;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 32px;
  padding: 0 24px;
}

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

.sidebar-link {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(14, 165, 233, 0.08);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent);
  font-weight: 600;
}

/* MAIN CONTENT */
.docs-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 48px 64px;
  max-width: 900px;
  width: 100%;
  box-sizing: border-box;
}

.docs-content h1 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 16px;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 0.02em;
}

.beta-badge-pill {
  background: rgba(245, 158, 11, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .docs-content h1 {
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-content h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.docs-content h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.docs-content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.docs-content a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.docs-content a:hover {
  opacity: 0.8;
}

.docs-content ul,
.docs-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.docs-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

/* CODE BLOCKS */
.code-block {
  background: #0f1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
  max-width: 100%;
  box-sizing: border-box;
}

.code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e5e7eb;
}

.code-block code {
  display: block;
  background: transparent;
  color: #e5e7eb;
  padding: 0;
}

.code-keyword { color: #c678dd; font-weight: 600; }
.code-string { color: #98c379; }
.code-variable { color: #61afef; }
.code-function { color: #61afef; }
.code-property { color: #e5c07b; }
.code-comment { color: #5c6370; font-style: italic; }
.code-number { color: #d19a66; }

/* CALLOUTS */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 3px solid;
}

.callout-info {
  background: rgba(14, 165, 233, 0.08);
  border-color: var(--accent);
}

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

.callout strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}

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

/* MOBILE */
@media (max-width: 1024px) {
  .docs-sidebar {
    display: none;
  }

  .docs-main {
    margin-left: 0;
    padding: 32px 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .docs-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .code-block {
    max-width: calc(100vw - 40px);
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .docs-main {
    padding: 24px 16px;
    width: 100%;
  }

  .docs-content {
    width: 100%;
  }

  .docs-content h1 {
    font-size: 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .docs-content h2 {
    font-size: 22px;
    margin-top: 40px;
  }

  .docs-content h3 {
    font-size: 18px;
    margin-top: 28px;
  }

  .docs-content p,
  .docs-content li {
    font-size: 14px;
  }

  .code-block {
    padding: 12px;
    margin: 20px 0;
    font-size: 11px;
    max-width: calc(100vw - 32px);
    border-radius: 8px;
  }

  .code-block pre {
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .header-links {
    display: none;
  }

  .docs-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  .beta-badge {
    font-size: 11px;
    padding: 5px 10px;
  }
}
