/* ============================================
   SnapAPI Docs — Monochrome Dark Theme
   ============================================ */

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

:root {
  --bg: #09090b;
  --bg-raised: #111113;
  --bg-card: #18181b;
  --bg-sidebar: #0c0c0e;
  --border: #27272a;
  --border-light: #3f3f46;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --transition: 150ms ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
}

/* Inline code */
p code, td code, li code {
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.82em;
}

/* --- TOPBAR --- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 100%;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.topbar-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-link {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.topbar-link:hover {
  color: var(--text);
}

.topbar-cta {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.topbar-cta:hover {
  background: #d4d4d8;
}

/* --- LAYOUT --- */

.layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* --- SIDEBAR --- */

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 8px;
}

.sidebar-link {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 20px;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.sidebar-link.active {
  color: var(--text);
  border-left-color: var(--text);
  background: rgba(255,255,255,0.04);
}

/* --- MAIN CONTENT --- */

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  max-width: 820px;
  padding: 48px 56px 120px;
}

.content section {
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--border);
}
.content section:last-child {
  border-bottom: none;
}

.content h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.content h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 32px;
  margin-bottom: 12px;
}

.content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 640px;
}

.intro-text {
  font-size: 17px;
  line-height: 1.7;
}

/* --- CALLOUT --- */

.callout {
  padding: 16px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 20px 0;
}

.callout-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.callout-code {
  font-size: 15px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-weight: 500;
}

/* --- METHOD BADGES --- */

.method-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', monospace;
}

.method-post {
  background: #27272a;
  color: #e4e4e7;
}

.method-get {
  background: #1c1c1f;
  color: #a1a1aa;
  border: 1px solid var(--border);
}

.method-err {
  background: #1c1c1f;
  color: #71717a;
  border: 1px solid var(--border);
}

/* --- ENDPOINT HEADER --- */

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.endpoint-path {
  font-size: 20px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  letter-spacing: -0.01em;
}

/* --- REQUIRED BADGE --- */

.required {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 3px;
}

/* --- PARAM TABLE --- */

.param-table-wrapper {
  margin: 16px 0 24px;
  overflow-x: auto;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.param-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.param-table thead th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}
.param-table thead th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

.param-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.param-table tbody tr:last-child td {
  border-bottom: none;
}

.param-table tbody td:first-child {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

/* --- CODE EXAMPLES --- */

.code-example {
  margin: 20px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
}

.code-example-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}

.code-example > pre {
  padding: 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: #d4d4d8;
}

/* --- TABS --- */

.code-tabs {
  overflow: hidden;
}

.code-tab-buttons {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.code-tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
}
.code-tab-btn:hover {
  color: var(--text-secondary);
}
.code-tab-btn.active {
  color: var(--text);
}
.code-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--text);
}

.code-tab-panel {
  display: none;
}
.code-tab-panel.active {
  display: block;
}

.code-tab-panel pre {
  padding: 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: #d4d4d8;
}

/* --- CHANGELOG --- */

.changelog-list {
  margin-top: 20px;
}

.changelog-entry {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.changelog-entry:last-child {
  border-bottom: none;
}

.changelog-date {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  padding-top: 2px;
  min-width: 100px;
}

.changelog-content {
  flex: 1;
}

.changelog-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #27272a;
  color: #d4d4d8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.changelog-improved {
  background: #1c1c1f;
  color: #a1a1aa;
}

.changelog-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* --- RESPONSIVE --- */

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .content {
    margin-left: 0;
    padding: 32px 20px 80px;
    max-width: 100%;
    overflow-x: hidden;
  }
  .content p,
  .content li,
  .intro-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  .param-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .code-example pre,
  .code-tab-panel pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-link {
    display: none;
  }
}

@media (max-width: 600px) {
  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .endpoint-path {
    font-size: 16px;
  }
  .param-table {
    font-size: 12px;
  }
  .param-table thead th,
  .param-table tbody td {
    padding: 8px 10px;
  }
}