/* API docs page — reuses the design tokens from styles.css */

.docs-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.docs-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.docs-nav .brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
}

.docs-nav .links { display: flex; gap: 4px; }

.docs-nav .links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.docs-nav .links a:hover,
.docs-nav .links a.active { background: var(--bg-hover); color: var(--text-primary); }

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

/* ---------------------------------- Sidebar ---------------------------------- */
.docs-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-right: 8px;
}

.docs-sidebar .group { margin-bottom: 20px; }

.docs-sidebar .group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 10px;
}

.docs-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}

.docs-sidebar a:hover,
.docs-sidebar a.active { background: var(--bg-hover); color: var(--text-primary); }

.docs-sidebar .method { font-size: 9px; min-width: 34px; }

/* ---------------------------------- Main ---------------------------------- */
.docs-main h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
}

.docs-main .lead {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 24px;
}

.docs-main h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 56px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.docs-main h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 28px 0 10px;
  scroll-margin-top: 80px;
}

.docs-main p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.docs-main p code,
.docs-main li code,
.docs-main td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-primary);
}

.docs-main ul,
.docs-main ol {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  padding-left: 22px;
  margin-bottom: 12px;
}

.base-url {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 24px;
}

.base-url .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.base-url code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--accent-soft);
  word-break: break-all;
}

.base-url button,
.try-it button {
  background: var(--accent);
  border: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.base-url button:hover,
.try-it button:hover { background: var(--accent-soft); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card .icon { font-size: 20px; margin-bottom: 8px; }
.card .title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.card .sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* ---------------------------------- Endpoint ---------------------------------- */
.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 12px 0 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.method {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  text-align: center;
}

.method.get    { background: rgba(34, 197, 94, 0.15);  color: #4ade80; }
.method.post   { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.method.delete { background: rgba(239, 68, 68, 0.15);  color: #f87171; }
.method.patch  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent-soft);
  margin-left: 6px;
  vertical-align: middle;
  font-family: 'Inter', sans-serif;
}

.badge.auth { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge.admin { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge.open { background: var(--green-bg); color: var(--green); }

/* ---------------------------------- Tables ---------------------------------- */
.docs-main table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.docs-main th,
.docs-main td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.docs-main th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.docs-main td { color: var(--text-secondary); }
.docs-main tr:last-child td { border-bottom: none; }

/* ---------------------------------- Code blocks ---------------------------------- */
.docs-main pre {
  position: relative;
  background: #0c0c0f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 10px 0 18px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #e4e4e7;
}

.code-tabs {
  margin: 12px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0c0c0f;
}

.code-tabs .tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.code-tabs .tabs button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.code-tabs .tabs button:hover { color: var(--text-primary); }
.code-tabs .tabs button.active { color: var(--text-primary); background: #0c0c0f; }

.code-tabs pre { display: none; border: none; border-radius: 0; margin: 0; }
.code-tabs pre.active { display: block; }

.docs-main pre .copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.docs-main pre:hover .copy { opacity: 1; }
.docs-main pre .copy:hover { background: var(--border-accent); color: var(--text-primary); }

.response-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 14px 0 4px;
}

/* ---------------------------------- Callouts ---------------------------------- */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin: 14px 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.callout.warn { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.callout strong { color: var(--text-primary); }

/* ---------------------------------- Try it ---------------------------------- */
.try-it {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0 20px;
}

.try-it .row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.try-it input,
.try-it select {
  flex: 1;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
  transition: border-color var(--transition);
}

.try-it input:focus,
.try-it select:focus { border-color: var(--accent); }

.try-it button:active { transform: scale(0.98); }
.try-it button.secondary { background: var(--bg-hover); color: var(--text-primary); }
.try-it button.secondary:hover { background: var(--border-accent); }
.try-it button:disabled { opacity: 0.5; cursor: wait; }

.try-it .hint { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.try-it pre { margin: 10px 0 0; min-height: 60px; max-height: 360px; overflow: auto; }
.try-it pre.ok { border-color: rgba(34, 197, 94, 0.4); }
.try-it pre.err { border-color: rgba(239, 68, 68, 0.4); }

/* ---------------------------------- Footer ---------------------------------- */
.docs-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.docs-footer a { color: var(--accent-soft); text-decoration: none; }

/* ---------------------------------- Responsive ---------------------------------- */
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px 80px; }

  .docs-sidebar {
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .docs-sidebar .group { margin: 0; }
  .docs-sidebar .group-title { padding-left: 0; }
  .docs-sidebar a { padding: 4px 0; }
  .docs-sidebar a:hover,
  .docs-sidebar a.active { background: none; }

  .docs-main h1 { font-size: 26px; }
  .docs-nav { padding: 12px 16px; }
  .docs-nav .links a { padding: 6px 8px; font-size: 12px; }
  .base-url { flex-wrap: wrap; }
}
