/* css/docs.css — API Documentation page styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;600;700;800&family=DM+Mono&display=swap');

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

:root {
  --bg:        #0a0f1e;
  --surface:   #111827;
  --surface2:  #1a2235;
  --border:    #1e2d40;
  --accent:    #3b82f6;
  --accent2:   #60a5fa;
  --text:      #f1f5f9;
  --muted:     #94a3b8;
  --green:     #34d399;
  --yellow:    #fbbf24;
  --red:       #f87171;
  --mono:      'DM Mono', 'Fira Code', monospace;
  --radius:    8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--surface2); padding: 2px 6px; border-radius: 4px; color: var(--accent2); }

/* ── Docs layout ──────────────────────────────────────────────────────────── */
.docs-header {
  background: rgba(10,15,30,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.docs-header img { height: 28px; }
.docs-header-links { display: flex; gap: 1.25rem; align-items: center; }
.docs-header-links a { color: var(--muted); font-size: 13px; }
.docs-header-links .btn-signin {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  gap: 3rem;
  min-height: calc(100vh - 60px);
}

/* ── Sidebar TOC ──────────────────────────────────────────────────────────── */
.docs-toc {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-group { margin-bottom: 1.5rem; }
.toc-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.toc-link {
  display: block;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.toc-link:hover { color: var(--text); text-decoration: none; border-color: var(--border); }
.toc-link.active { color: var(--accent2); border-color: var(--accent); }

/* ── Docs content ─────────────────────────────────────────────────────────── */
.docs-content { min-width: 0; }

.docs-section { margin-bottom: 3.5rem; }
.docs-section h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.docs-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.docs-section h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.docs-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
}
.docs-section p { color: var(--muted); margin-bottom: 0.75rem; font-size: 14px; }
.docs-section ul { color: var(--muted); font-size: 14px; padding-left: 1.25rem; margin-bottom: 0.75rem; }
.docs-section li { margin-bottom: 0.25rem; }

/* ── Endpoint block ───────────────────────────────────────────────────────── */
.endpoint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow: hidden;
}
.endpoint-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.method-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(59,130,246,0.15);
  color: var(--accent2);
  border: 1px solid rgba(59,130,246,0.3);
}
.endpoint-action {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.endpoint-desc {
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
}
.endpoint-body { padding: 1.25rem; }

pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-x: auto;
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: #e2e8f0;
}
pre .key   { color: #93c5fd; }
pre .str   { color: #86efac; }
pre .num   { color: #fcd34d; }
pre .bool  { color: #f9a8d4; }

.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 1rem;
}
.params-table th {
  text-align: left;
  padding: 6px 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.params-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.params-table td:first-child { font-family: var(--mono); font-size: 12px; color: var(--accent2); }
.params-table td:nth-child(2) { color: var(--muted); font-size: 12px; }
.required-badge { color: var(--red); font-size: 10px; font-weight: 700; }
.optional-badge { color: var(--muted); font-size: 10px; }

/* ── Hamburger toggle (hidden on desktop) ─────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.22s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { display: none; }
  .docs-header { padding: 0 1rem; }
  .nav-toggle { display: flex; }
  .docs-header-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10,15,30,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    z-index: 99;
  }
  .docs-header-links.open { display: flex; }
  .docs-header-links a {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    color: var(--muted);
  }
  .docs-header-links a:last-child { border-bottom: none; }
  .docs-header-links .btn-signin {
    background: none;
    border: none;
    padding: 13px 0;
    border-radius: 0;
    font-size: 15px;
    font-weight: 400;
    color: var(--accent2);
  }
}
