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

:root {
  --primary: #f06060;
  --primary-soft: #f8a4a4;
  --secondary: #0f1629;
  --secondary-soft: #1a2340;
  --bg: #ffffff;
  --bg-warm: #fef7f4;
  --bg-warm-2: #fdf0ec;
  --bg-dark: #0f1629;
  --bg-code: #0c1220;
  --text: #374151;
  --text-heading: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #f0f0f0;
  --border-soft: #f5f0ee;
  --sidebar-w: 264px;
  --radius: 10px;
  --radius-sm: 6px;
  --get: #34d399;
  --get-bg: rgba(52, 211, 153, 0.1);
  --post: #60a5fa;
  --post-bg: rgba(96, 165, 250, 0.1);
  --put: #fbbf24;
  --put-bg: rgba(251, 191, 36, 0.1);
  --delete: #f87171;
  --delete-bg: rgba(248, 113, 113, 0.1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.65;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ─────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--secondary);
  color: #fff;
  overflow-y: auto;
  z-index: 100;
  padding: 0 0 40px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 20px;
}

.sidebar-logo img {
  width: 140px;
  height: auto;
}

.sidebar-api-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 10px;
}

.sidebar-section {
  padding: 12px 0 6px 28px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 8px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 28px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.sidebar a:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar a.active {
  color: #fff;
  border-left-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar .method-badge-sm {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* ── Main content ────────────────────────────────── */

.main {
  margin-left: var(--sidebar-w);
}

.section {
  display: grid;
  grid-template-columns: 55% 45%;
  min-height: auto;
  border-bottom: 1px solid var(--border);
}

.section-desc {
  padding: 52px 52px 52px 60px;
}

.section-code {
  padding: 52px 44px;
  background: var(--bg-dark);
  color: #c9d1d9;
}

/* ── Typography ──────────────────────────────────── */

h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

h2 {
  font-size: 21px;
  font-weight: 650;
  color: var(--text-heading);
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
  margin-top: 24px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.section-desc p {
  margin-bottom: 14px;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.7;
}

.endpoint-url {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-warm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 11px 16px;
  margin-bottom: 22px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-heading);
  word-break: break-all;
}

.method-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.method-get { background: var(--get-bg); color: #059669; }
.method-post { background: var(--post-bg); color: #2563eb; }
.method-put { background: var(--put-bg); color: #b45309; }
.method-delete { background: var(--delete-bg); color: #dc2626; }

/* ── Parameter tables ────────────────────────────── */

.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 8px;
  margin-bottom: 22px;
}

.params-table th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.params-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.params-table code {
  background: var(--bg-warm);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--secondary);
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}

.param-required {
  color: var(--primary);
  font-weight: 600;
  font-size: 11px;
}

.param-optional {
  color: var(--text-light);
  font-size: 11px;
}

/* ── Code blocks (right column) ──────────────────── */

.code-block {
  position: relative;
  margin-bottom: 28px;
}

.code-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 10px;
}

.code-block pre {
  background: var(--bg-code);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.75;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
}

.code-block .copy-btn {
  position: absolute;
  top: 32px;
  right: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Code syntax colors - softer palette */
.code-key { color: #7cacf8; }
.code-str { color: #8bd5a0; }
.code-num { color: #f0b078; }
.code-bool { color: #e89090; }
.code-null { color: #636e7b; }
.code-comment { color: #4a5263; font-style: italic; }
.code-kw { color: #b4a0e0; }
.code-fn { color: #80d0e0; }

/* ── Status badges ───────────────────────────────── */

.status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-200 { background: var(--get-bg); color: #059669; }
.status-201 { background: var(--post-bg); color: #2563eb; }
.status-400 { background: var(--put-bg); color: #b45309; }
.status-401 { background: var(--delete-bg); color: #dc2626; }
.status-429 { background: rgba(168, 85, 247, 0.1); color: #7c3aed; }
.status-500 { background: rgba(107, 114, 128, 0.1); color: #4b5563; }

/* ── Info boxes ──────────────────────────────────── */

.info-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border-left: 3px solid;
  line-height: 1.6;
}

.info-box.note {
  background: #f0f7ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.info-box.warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.info-box code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.base-url {
  background: var(--bg-warm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text-heading);
  margin-bottom: 22px;
  font-weight: 500;
}

/* ── Intro section full width ────────────────────── */

.section-full {
  display: block;
  border-bottom: 1px solid var(--border);
}

.section-full .section-desc {
  max-width: 720px;
}

/* ── Section dividers ────────────────────────────── */

.section-divider {
  padding: 20px 60px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
}

.section-divider h2 {
  margin: 0;
  font-size: 16px;
  color: var(--text-heading);
  letter-spacing: 0.2px;
}

/* ── Mobile hamburger ────────────────────────────── */

.mobile-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--secondary);
  border: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 1024px) {
  .section {
    grid-template-columns: 1fr;
  }

  .section-code {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: flex;
  }

  .main {
    margin-left: 0;
  }

  .section-desc {
    padding: 32px 20px;
  }

  .section-code {
    padding: 24px 20px;
  }

  .section-divider {
    padding: 16px 20px;
  }
}

/* ── Scrollbar (sidebar) ─────────────────────────── */

.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ── Misc ────────────────────────────────────────── */

.inline-code {
  background: var(--bg-warm);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

li {
  font-size: 14.5px;
  margin-bottom: 4px;
}

/* ── Footer ─────────────────────────────────────── */

.site-footer {
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--border);
  padding: 28px 60px;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-inner a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-inner a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-sep {
  color: var(--text-light);
}

@media (max-width: 768px) {
  .site-footer {
    margin-left: 0;
    padding: 20px;
  }
}
