/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: #e4e4e7;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: 280px;
  min-width: 280px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: #0f0f15;
  border-right: 1px solid #1e1e2a;
  overflow-y: auto;
  padding: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1e1e2a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}
.sidebar-logo span { color: #00d4a1; }
.sidebar-badge {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(0,212,161,0.15);
  color: #00d4a1;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.sidebar-nav { padding: 12px 0; }
.sidebar-section { padding: 0; }
.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  padding: 16px 20px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px 7px 28px;
  color: #999;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: #e4e4e7; background: rgba(255,255,255,0.03); }
.sidebar-link.active {
  color: #00d4a1;
  border-left-color: #00d4a1;
  background: rgba(0,212,161,0.05);
}
.sidebar-link .method-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}
.method-get { background: rgba(59,130,246,0.2); color: #60a5fa; }
.method-post { background: rgba(0,212,161,0.2); color: #00d4a1; }

/* ── Main Content ─────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 56px;
  border-bottom: 1px solid #1e1e2a;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 12px;
  background: #0f0f15;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-breadcrumb {
  font-size: 0.82rem;
  color: #666;
}
.topbar-breadcrumb a { color: #888; text-decoration: none; }
.topbar-breadcrumb a:hover { color: #00d4a1; }
.topbar-breadcrumb .sep { margin: 0 6px; color: #444; }
.topbar-breadcrumb .current { color: #e4e4e7; }
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #1e1e2a;
  border-radius: 6px;
  padding: 4px;
}
.lang-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.lang-btn:hover { color: #e4e4e7; }
.lang-btn.active {
  background: rgba(0,212,161,0.15);
  color: #00d4a1;
}

/* ── Product Switcher ─────────────────────────────── */
.product-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #1e1e2a;
  border-radius: 6px;
  padding: 4px;
}
.product-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.product-btn:hover { color: #e4e4e7; }
.product-btn.active {
  background: rgba(0,212,161,0.15);
  color: #00d4a1;
}

.content {
  max-width: 900px;
  padding: 40px 48px 80px;
  width: 100%;
  align-self: center;
}

/* ── Headings ─────────────────────────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e1e2a;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e4e4e7;
  margin-top: 32px;
  margin-bottom: 12px;
}
h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ccc;
  margin-top: 24px;
  margin-bottom: 8px;
}

.page-desc {
  font-size: 1rem;
  color: #999;
  margin-bottom: 24px;
  line-height: 1.7;
}

/* ── Endpoint Block ───────────────────────────────── */
.endpoint-block {
  background: #13131d;
  border: 1px solid #1e1e2a;
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.endpoint-method {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.endpoint-method.get { background: rgba(59,130,246,0.2); color: #60a5fa; }
.endpoint-method.post { background: rgba(0,212,161,0.2); color: #00d4a1; }
.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: #e4e4e7;
  font-weight: 500;
  word-break: break-all;
}
.endpoint-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.endpoint-desc {
  font-size: 0.88rem;
  color: #888;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ── Code Blocks ──────────────────────────────────── */
.code-block {
  background: #0a0a12;
  border: 1px solid #1a1a28;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #111119;
  border-bottom: 1px solid #1a1a28;
}
.code-lang {
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-copy {
  background: none;
  border: 1px solid #333;
  color: #888;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.code-copy:hover { color: #e4e4e7; border-color: #555; }
.code-copy.copied { color: #00d4a1; border-color: rgba(0,212,161,0.3); }
.code-body {
  padding: 16px;
  overflow-x: auto;
}
.code-body pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c9d1d9;
  white-space: pre;
  margin: 0;
}
/* Syntax highlights */
.hl-key { color: #79c0ff; }
.hl-str { color: #a5d6ff; }
.hl-num { color: #d2a8ff; }
.hl-comment { color: #555; font-style: italic; }
.hl-method { color: #00d4a1; font-weight: 600; }
.hl-url { color: #d2a8ff; }

/* ── Tabs ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1e1e2a;
  margin: 16px 0 0;
}
.tab-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.tab-btn:hover { color: #aaa; }
.tab-btn.active {
  color: #e4e4e7;
  border-bottom-color: #00d4a1;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Tables ────────────────────────────────────────── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.85rem;
}
.param-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  padding: 8px 12px;
  border-bottom: 1px solid #1e1e2a;
}
.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.param-table tr:hover td { background: rgba(255,255,255,0.02); }
.param-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #79c0ff;
  font-weight: 500;
}
.param-type {
  font-size: 0.75rem;
  color: #888;
  font-family: 'JetBrains Mono', monospace;
}
.param-required {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.param-required.yes { background: rgba(239,68,68,0.15); color: #f87171; }
.param-required.no { background: rgba(255,255,255,0.05); color: #666; }
.param-desc { color: #999; line-height: 1.5; }

/* ── Info / Callout boxes ─────────────────────────── */
.callout {
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.callout-warn {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  color: #fbbf24;
}
.callout-info {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  color: #60a5fa;
}
.callout-success {
  background: rgba(0,212,161,0.08);
  border: 1px solid rgba(0,212,161,0.2);
  color: #00d4a1;
}
.callout strong { color: inherit; }

/* ── Status badges ─────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.status-200 { background: rgba(0,212,161,0.15); color: #00d4a1; }
.status-400 { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-403 { background: rgba(239,68,68,0.15); color: #f87171; }
.status-404 { background: rgba(239,68,68,0.15); color: #f87171; }
.status-409 { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-500 { background: rgba(239,68,68,0.15); color: #f87171; }

/* ── Section anchors ───────────────────────────────── */
.section-anchor {
  scroll-margin-top: 72px;
}

/* ── Response section ──────────────────────────────── */
.response-group { margin: 12px 0; }
.response-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.response-label span {
  font-size: 0.85rem;
  color: #999;
}

/* ── Flow diagram ─────────────────────────────────── */
.flow-block {
  background: #13131d;
  border: 1px solid #1e1e2a;
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0;
  overflow-x: auto;
}
.flow-block pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  color: #999;
  white-space: pre;
}

/* ── Mobile sidebar toggle ────────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #00d4a1;
  color: #000;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,212,161,0.3);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -300px;
    transition: left 0.3s ease;
    z-index: 110;
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay.open { display: block; }
  .content { padding: 24px 20px 60px; }
  .topbar { padding: 0 16px; }
}

/* ── Hash link anchors ─────────────────────────────── */
h2 .hash-link, h3 .hash-link {
  color: #444;
  text-decoration: none;
  margin-left: 6px;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity 0.15s;
}
h2:hover .hash-link, h3:hover .hash-link { opacity: 1; }

/* ── First heading spacing fix ─────────────────────── */
.content > h1:first-of-type,
.content > h2:first-of-type {
  margin-top: 0;
}

/* ── Chip / Inline code ────────────────────────────── */
code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #c9d1d9;
}
