/* Evalytic Docs - Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

html, body {
  overflow-x: hidden;
}

/* Light theme (default) */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-code: #f3f4f6;
  --border-color: #e5e7eb;
  --border-hover: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --header-bg: rgba(255, 255, 255, 0.8);
  --card-bg: rgba(249, 250, 251, 0.5);
  --card-hover: rgba(243, 244, 246, 0.8);
  --code-bg: #1f2937;
  --code-border: #374151;

  /* Evalytic brand colors */
  --blue-400: #3b82f6;
  --blue-500: #2563eb;
  --violet-400: #8b5cf6;
  --violet-500: #7c3aed;
  --green-400: #22c55e;
  --green-500: #16a34a;
  --orange-400: #f97316;
  --cyan-400: #06b6d4;
  --red-400: #ef4444;
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-code: #1f2937;
  --border-color: rgba(31, 41, 55, 0.5);
  --border-hover: #374151;
  --text-primary: #ffffff;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;
  --header-bg: rgba(10, 10, 10, 0.8);
  --card-bg: rgba(17, 24, 39, 0.3);
  --card-hover: rgba(17, 24, 39, 0.5);
  --code-bg: #111827;
  --code-border: #1f2937;

  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --orange-400: #fb923c;
  --cyan-400: #22d3ee;
  --red-400: #f87171;
}

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

::selection {
  background: var(--blue-500);
  color: white;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 64px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 3px;
  overflow: hidden;
}

[data-theme="dark"] .header-logo-icon {
  background: #ffffff;
}

.header-logo-icon svg {
  width: 100%;
  height: 100%;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 32px;
}

.header-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text-primary);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 256px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-primary);
}

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

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 8px;
  padding: 0 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
}

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

.sidebar-link.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.sidebar-badge-new {
  padding: 2px 6px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--green-400);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 256px;
  min-height: calc(100vh - 64px);
}

.content-wrapper {
  max-width: 896px;
  margin: 0 auto;
  padding: 48px 24px;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-faint);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s;
}

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

.breadcrumb-current {
  color: var(--text-muted);
}

/* Typography */
h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

h2, h3 {
  position: relative;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.anchor-link {
  position: absolute;
  left: -1.5em;
  padding-right: 0.5em;
  color: var(--text-faint);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
  transition: opacity 0.15s, color 0.15s;
}

h2:hover .anchor-link,
h3:hover .anchor-link,
.anchor-link:focus {
  opacity: 1;
}

.anchor-link:hover {
  color: var(--blue-400);
}

.subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

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

a {
  color: var(--blue-400);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  color: var(--text-secondary);
  padding-left: 24px;
  margin-bottom: 16px;
}

li {
  margin-bottom: 6px;
}

/* Code Blocks */
.code-block {
  position: relative;
  margin: 16px 0 24px;
}

.code-block pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  color: #e5e7eb;
}

.code-block .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s;
  border-radius: 6px;
}

.code-block .copy-btn:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* Terminal Box */
.terminal-box {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  margin: 16px 0 24px;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--code-border);
}

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

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-box pre {
  padding: 16px;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e5e7eb;
  overflow-x: auto;
}

/* Inline Code */
code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue-400);
}

/* Syntax Highlighting */
.token-keyword { color: var(--violet-400); }
.token-string { color: var(--green-400); }
.token-function { color: var(--blue-400); }
.token-method { color: #fbbf24; }
.token-comment { color: #6b7280; }
.token-number { color: var(--orange-400); }
.token-variable { color: white; }
.token-type { color: var(--cyan-400); }
.token-flag { color: var(--cyan-400); }
.token-dim { color: #9ca3af; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.card {
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-icon.blue {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: var(--blue-400);
}

.card-icon.green {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green-400);
}

.card-icon.violet {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--violet-400);
}

.card-icon.orange {
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
  color: var(--orange-400);
}

.card-icon.cyan {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--cyan-400);
}

.card h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.card a {
  text-decoration: none;
  color: inherit;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--card-bg);
}

/* Method Reference */
.method-block {
  margin: 32px 0;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.method-signature {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.method-description {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.params-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.param-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.param-item:last-child {
  border-bottom: none;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--blue-400);
  min-width: 120px;
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-faint);
  min-width: 100px;
}

.param-desc {
  color: var(--text-muted);
}

.param-required {
  color: var(--orange-400);
  font-size: 11px;
  margin-left: 4px;
}

/* Callouts */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  display: flex;
  gap: 12px;
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.callout-content {
  font-size: 14px;
}

.callout-content p {
  margin: 0;
}

.callout.info {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.callout.info .callout-icon {
  color: var(--blue-400);
}

.callout.warning {
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
}

.callout.warning .callout-icon {
  color: var(--orange-400);
}

.callout.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.callout.success .callout-icon {
  color: var(--green-400);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green-400);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-gray {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-orange {
  background: rgba(249, 115, 22, 0.15);
  color: var(--orange-400);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--violet-400);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-400);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-400);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Search Modal */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.search-modal.active {
  display: block;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.search-dialog {
  position: relative;
  top: 20%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

[data-theme="dark"] .search-dialog {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.search-input {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

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

.search-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.search-section-title {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.search-result:hover {
  background: var(--bg-tertiary);
  text-decoration: none;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  margin-top: 64px;
}

.footer-content {
  max-width: 896px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.pagination-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.pagination-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

/* Scrollbar dark mode */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #374151;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  transition: all 0.15s;
}

.mobile-menu-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
  opacity: 1;
}

.sidebar.mobile-open {
  display: block;
  z-index: 50;
  transform: translateX(0);
}

/* Hero section */
.hero-box {
  padding: 24px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  margin: 24px 0;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* Step boxes */
.step {
  display: flex;
  gap: 16px;
  margin: 24px 0;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-500);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.step-content {
  flex: 1;
}

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

/* Flag table for CLI docs */
.flag-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--cyan-400);
  white-space: nowrap;
}

.flag-table td:nth-child(2) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-faint);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    padding-top: 80px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .mobile-menu-overlay {
    display: block;
    pointer-events: none;
  }

  .mobile-menu-overlay.active {
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    display: flex;
  }

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

  .header-nav {
    display: none;
  }

  .header {
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .docs-layout {
    padding-top: 56px;
  }

  .header {
    height: 56px;
  }

  .sidebar {
    top: 0;
    padding-top: 72px;
  }

  .content-wrapper {
    padding: 32px 16px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 20px; margin-top: 36px; }
  h3 { font-size: 16px; margin-top: 24px; }
  .subtitle { font-size: 16px; }

  .search-btn-text,
  .search-btn-kbd { display: none; }

  .code-block pre {
    font-size: 12px;
    padding: 12px;
    border-radius: 8px;
  }

  .code-block .copy-btn {
    top: 8px;
    right: 8px;
    padding: 6px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card { padding: 16px; }

  .table-wrapper {
    margin: 16px -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  table { font-size: 13px; }
  th, td { padding: 10px 12px; }

  .method-block { padding: 16px; }
  .method-signature { font-size: 13px; word-break: break-all; }
  .param-item { flex-direction: column; gap: 4px; }
  .param-name, .param-type { min-width: auto; }

  .callout { padding: 12px 16px; }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 24px 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination {
    flex-direction: column;
    gap: 12px;
  }

  .pagination-link {
    justify-content: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
  }

  .search-dialog {
    top: 10%;
    margin: 0 16px;
    max-width: none;
  }

  .breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .anchor-link {
    position: relative;
    left: auto;
    padding-right: 0;
    padding-left: 8px;
    opacity: 0.5;
  }
}

@media (max-width: 480px) {
  .content-wrapper { padding: 24px 12px; }
  h1 { font-size: 24px; }

  .code-block pre {
    font-size: 11px;
    padding: 10px;
  }

  th, td { padding: 8px 10px; }
}
