@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg-base:    #0a0e1a;
  --bg-card:    #111827;
  --bg-surface: #1a2235;
  --bg-code:    #0d1117;

  --accent-primary: #38bdf8;
  --accent-glow:    rgba(56, 189, 248, 0.15);
  --accent-green:   #34d399;
  --accent-orange:  #fb923c;
  --accent-red:     #f87171;
  --accent-purple:  #a78bfa;

  --text-primary:   #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  --border:       rgba(56, 189, 248, 0.12);
  --border-card:  rgba(255,255,255,0.06);

  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.08);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-brand .badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--accent-primary);
  color: #0a0e1a;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); text-decoration: none; }
.btn-nav {
  padding: 8px 18px;
  background: var(--accent-primary);
  color: #0a0e1a !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-nav:hover { opacity: 0.9; transform: translateY(-1px); text-decoration: none !important; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; min-height: calc(100vh - 64px); }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 20px;
  border-right: 1px solid var(--border-card);
  background: var(--bg-base);
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.15s;
  cursor: pointer;
}
.sidebar-link:hover { background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }
.sidebar-link.active { background: var(--accent-glow); color: var(--accent-primary); border-left: 2px solid var(--accent-primary); }
.method-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.method-get  { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); }
.method-post { background: rgba(56, 189, 248, 0.15); color: var(--accent-primary); }

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content { padding: 48px 48px 80px; overflow-x: hidden; }
.section { margin-bottom: 64px; scroll-margin-top: 80px; }
h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-card); }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }
p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.75; }
ul { color: var(--text-secondary); padding-left: 20px; line-height: 2; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 24px;
  background: var(--accent-glow);
}
.hero h1 {
  font-size: 3.2rem;
  background: linear-gradient(135deg, #f0f6fc 30%, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 1.1rem; max-width: 600px; margin: 16px auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}
.btn-primary { background: var(--accent-primary); color: #0a0e1a; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(56,189,248,0.3); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-card); }
.btn-ghost:hover { background: var(--bg-surface); text-decoration: none; }
.btn-danger { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature-icon {
  width: 40px; height: 40px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

/* ─── Code Blocks ─────────────────────────────────────────────────────────── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-card);
  background: rgba(255,255,255,0.02);
}
.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.copy-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--accent-primary); border-color: var(--border); }
.copy-btn.copied { color: var(--accent-green); border-color: rgba(52,211,153,0.3); }
pre {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #e6edf3;
}
code { font-family: var(--font-mono); }
:not(pre) > code {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: var(--accent-primary);
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-card); margin-bottom: 24px; }
.tab {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Endpoint Docs ──────────────────────────────────────────────────────── */
.endpoint-card {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}
.endpoint-card:hover { border-color: var(--border); }
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  cursor: pointer;
  user-select: none;
}
.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}
.endpoint-desc { font-size: 0.85rem; color: var(--text-secondary); }
.endpoint-body { padding: 24px; background: var(--bg-base); border-top: 1px solid var(--border-card); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin: 16px 0; }
th { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-card); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-secondary); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td code { font-size: 0.8rem; }
.required { color: var(--accent-red); font-size: 0.7rem; font-weight: 600; }
.optional { color: var(--text-muted); font-size: 0.7rem; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  font-size: 0.875rem;
  border: 1px solid;
}
.alert-info { background: rgba(56,189,248,0.08); border-color: rgba(56,189,248,0.2); color: var(--accent-primary); }
.alert-warn { background: rgba(251,146,60,0.08); border-color: rgba(251,146,60,0.2); color: var(--accent-orange); }
.alert-success { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.2); color: var(--accent-green); }

/* ─── Playground ─────────────────────────────────────────────────────────── */
.playground {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: 600px;
}
.playground-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-card);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
}
.panel-body { padding: 20px; flex: 1; overflow: auto; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.05em; text-transform: uppercase; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-card); }
.form-textarea { resize: vertical; min-height: 100px; font-family: var(--font-mono); font-size: 0.8rem; }
.drop-zone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-primary); background: var(--accent-glow); }
.drop-zone .icon { font-size: 2rem; margin-bottom: 8px; }
.response-area {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #e6edf3;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  min-height: 200px;
  white-space: pre;
}
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-card);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.queued   { background: var(--text-muted); }
.status-dot.processing { background: var(--accent-orange); animation: pulse 1.2s infinite; }
.status-dot.success  { background: var(--accent-green); }
.status-dot.error    { background: var(--accent-red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.progress-bar { height: 3px; background: var(--border-card); border-radius: 2px; overflow: hidden; margin-bottom: 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-primary), var(--accent-green)); border-radius: 2px; transition: width 0.4s ease; }

/* ─── Syntax Highlighting ────────────────────────────────────────────────── */
.token-key    { color: #79c0ff; }
.token-str    { color: #a5d6ff; }
.token-num    { color: #f2cc60; }
.token-bool   { color: #ff7b72; }
.token-null   { color: var(--text-muted); }
.token-comment { color: #8b949e; font-style: italic; }

/* ─── Pricing ─────────────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.pricing-card:hover { border-color: var(--border); transform: translateY(-4px); }
.pricing-card.featured { border-color: var(--accent-primary); box-shadow: 0 0 40px rgba(56,189,248,0.1); }
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: #0a0e1a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.08em;
}
.pricing-price { font-size: 2.5rem; font-weight: 800; margin: 12px 0 4px; }
.pricing-period { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.pricing-features { list-style: none; padding: 0; margin-bottom: 28px; }
.pricing-features li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.875rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.pricing-features li:last-child { border-bottom: none; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-card);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a { color: var(--text-secondary); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 32px 20px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .playground { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .nav-links { gap: 16px; }
}

/* ─── Micro-animations ───────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
