/* API page inherits from main.css for nav/footer */
.api-layout {
  display: flex; max-width: 1400px; margin: 0 auto;
  padding-top: 64px; min-height: 100vh;
}

/* Sidebar */
.api-sidebar {
  width: 260px; flex-shrink: 0;
  position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto; padding: 24px 16px;
  border-right: 1px solid var(--border);
  transition: border-color 0.3s;
}
.api-sidebar::-webkit-scrollbar { width: 4px; }
.api-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.api-sidebar h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin: 16px 0 8px; padding: 0 8px;
}
.api-sidebar h4:first-child { margin-top: 0; }
.api-sidebar a {
  display: block; padding: 6px 8px; border-radius: 8px;
  font-size: 13px; color: var(--text-secondary);
  transition: all 0.15s;
}
.api-sidebar a:hover { color: var(--text); background: rgba(139,92,246,0.05); }
.api-sidebar a.active { color: var(--accent); background: rgba(139,92,246,0.08); font-weight: 600; }

/* Content */
.api-content {
  flex: 1; padding: 32px 48px; max-width: 900px;
  overflow-x: hidden;
}
.api-content h1 {
  font-size: 32px; font-weight: 800; margin-bottom: 8px;
}
.api-content .api-version {
  font-size: 13px; color: var(--text-muted); margin-bottom: 32px;
}
.api-content h2 {
  font-size: 22px; font-weight: 700; margin-top: 48px; margin-bottom: 16px;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.api-content h2:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.api-content h3 {
  font-size: 16px; font-weight: 600; margin-top: 28px; margin-bottom: 12px;
  color: #fff;
}
.api-content p {
  font-size: 14px; line-height: 1.7; color: var(--text-secondary);
  margin-bottom: 12px;
}
.api-content ul, .api-content ol {
  padding-left: 20px; margin-bottom: 12px;
}
.api-content li {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 4px;
}

/* Endpoint block */
.endpoint {
  margin: 20px 0; padding: 16px 20px; border-radius: 12px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
}
.endpoint-method {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  margin-right: 8px; font-family: 'SF Mono', 'Fira Code', monospace;
}
.endpoint-method.get { background: rgba(16,185,129,0.12); color: #10b981; }
.endpoint-method.post { background: rgba(59,130,246,0.12); color: #3b82f6; }
.endpoint-method.put { background: rgba(245,158,11,0.12); color: #f59e0b; }
.endpoint-method.patch { background: rgba(245,158,11,0.12); color: #f59e0b; }
.endpoint-method.delete { background: rgba(239,68,68,0.12); color: #ef4444; }
.endpoint-path {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px; font-weight: 600; color: #fff;
}
.endpoint-desc {
  margin-top: 8px; font-size: 13px; color: var(--text-secondary);
}

/* Code blocks */
.code-block {
  margin: 12px 0; padding: 14px 18px; border-radius: 10px;
  background: var(--code-bg); border: 1px solid var(--border);
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12.5px; line-height: 1.6; color: var(--text);
  overflow-x: auto; white-space: pre;
  transition: background 0.3s, border-color 0.3s;
  position: relative;
}
.code-block .k { color: #c084fc; }
.code-block .s { color: #67e8f9; }
.code-block .c { color: #94a3b8; }
.code-block .n { color: #fbbf24; }
[data-theme="light"] .code-block .k { color: #7c3aed; }
[data-theme="light"] .code-block .s { color: #0891b2; }
[data-theme="light"] .code-block .c { color: #94a3b8; }

/* Tables */
.api-table {
  width: 100%; margin: 12px 0 20px; border-collapse: collapse;
  font-size: 13px;
}
.api-table th {
  text-align: left; padding: 8px 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  font-weight: 600; color: var(--text);
}
.api-table td {
  padding: 8px 12px; border: 1px solid var(--border);
  color: var(--text-secondary);
}
.api-table code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px; background: rgba(255,255,255,0.05);
  padding: 1px 5px; border-radius: 4px; color: #c084fc;
}

/* Auth badge */
.auth-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: rgba(139,92,246,0.1); color: var(--accent);
  font-size: 11px; font-weight: 600; margin-left: 8px;
}
.auth-badge.none {
  background: rgba(100,116,139,0.1); color: var(--text-muted);
}

/* Info box */
.info-box {
  margin: 12px 0; padding: 12px 16px; border-radius: 10px;
  border-left: 3px solid var(--accent);
  background: rgba(139,92,246,0.05);
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
  .api-sidebar { display: none; }
  .api-content { padding: 24px 16px; }
}
