/* RouteCat API Docs — docs.css */

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --border: #1e1e2e;
  --text: #e4e4ef;
  --dim: #8888a0;
  --accent: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --sidebar-w: 260px;
  --code-bg: #0e0e16;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sidebar ── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-header a:hover { text-decoration: none; }

.sidebar-logo {
  height: 28px;
  filter: invert(1);
}

.sidebar-header .cat {
  color: var(--accent);
}

.sidebar-header .badge {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav .nav-group {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav .nav-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  padding: 0.4rem 0.5rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.35rem 0.75rem;
  color: var(--dim);
  font-size: 0.87rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: rgba(245, 158, 11, 0.08);
  color: var(--text);
  text-decoration: none;
}

.sidebar-nav a.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lang-switcher { position: relative; }
.lang-globe { display: flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--border); color: var(--dim); border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 0.75rem; font-weight: 600; font-family: inherit; transition: all 0.15s; }
.lang-globe:hover { color: var(--text); border-color: var(--accent); }
.lang-globe svg { width: 14px; height: 14px; }
.lang-dropdown { display: none; position: absolute; bottom: calc(100% + 8px); left: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px; min-width: 130px; z-index: 300; box-shadow: 0 -4px 16px rgba(0,0,0,0.4); }
.lang-dropdown.open { display: block; }
.lang-dropdown button { display: block; width: 100%; text-align: left; padding: 6px 10px; background: none; border: none; color: var(--dim); cursor: pointer; border-radius: 5px; font-size: 0.82rem; font-family: inherit; transition: all 0.1s; }
.lang-dropdown button:hover { background: rgba(245,158,11,0.1); color: var(--text); }
.lang-dropdown button.active { color: var(--accent); font-weight: 600; }

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dim);
  font-size: 0.82rem;
}

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

/* ── Mobile nav toggle ── */

.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.mobile-nav-toggle .hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.2rem;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  line-height: 1;
}

.mobile-nav-toggle .hamburger:hover { border-color: var(--accent); }

.mobile-nav-toggle .mobile-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

/* ── Main content ── */

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
}

/* ── Typography ── */

h1, h2, h3, h4 { color: var(--text); font-weight: 700; line-height: 1.3; }

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 3.5rem; margin-bottom: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.15rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; color: var(--dim); }

section:first-child h2 { border-top: none; margin-top: 0; padding-top: 0; }

p { margin-bottom: 1rem; color: var(--text); }
p.dim { color: var(--dim); }

.subtitle {
  font-size: 1.1rem;
  color: var(--dim);
  margin-bottom: 2rem;
  line-height: 1.6;
}

strong { color: var(--text); font-weight: 600; }

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; color: var(--text); }
li::marker { color: var(--dim); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Inline code ── */

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

/* ── Code blocks ── */

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  line-height: 1.6;
  font-size: 0.82rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* Code block header/label */
.code-block {
  margin-bottom: 1.25rem;
}

.code-label {
  display: inline-block;
  background: var(--border);
  color: var(--dim);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 8px 8px 0 0;
  font-family: var(--font-sans);
}

.code-block pre {
  margin-top: 0;
  border-top-left-radius: 0;
}

/* Syntax highlighting */
.str { color: var(--green); }
.cmd { color: var(--blue); }
.comment { color: var(--dim); font-style: italic; }
.key { color: #c084fc; }
.num { color: var(--accent); }
.kw { color: #f472b6; }
.fn { color: #60a5fa; }

/* ── Method badges ── */

.method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.method-get {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.method-post {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* ── Tables ── */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

td code {
  font-size: 0.8em;
}

tr:last-child td { border-bottom: none; }

/* ── Callout boxes ── */

.callout {
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.callout p:last-child { margin-bottom: 0; }

.callout-info {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--blue);
}

.callout-warn {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent);
}

.callout-tip {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--green);
}

.callout-title {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.callout-info .callout-title { color: var(--blue); }
.callout-warn .callout-title { color: var(--accent); }
.callout-tip .callout-title { color: var(--green); }

/* ── Steps ── */

.steps {
  counter-reset: step;
  margin-bottom: 1.5rem;
}

.step {
  position: relative;
  padding-left: 3rem;
  padding-bottom: 1.5rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h4 {
  margin-top: 0.15rem;
  color: var(--text);
}

/* ── Param list ── */

.param {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.param:last-child { border-bottom: none; }

.param-name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.param-type {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
  margin-left: 0.5rem;
}

.param-required {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red);
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.param-optional {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dim);
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.param-desc {
  color: var(--dim);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

/* ── Status codes ── */

.status-row {
  display: flex;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.status-row:last-child { border-bottom: none; }

.status-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  min-width: 3rem;
}

.status-2xx { color: var(--green); }
.status-4xx { color: var(--accent); }
.status-5xx { color: var(--red); }

.status-desc { color: var(--dim); font-size: 0.9rem; }

/* ── Responsive ── */

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

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

  .sidebar-backdrop.open {
    display: block;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding-top: 56px;
  }

  .content {
    padding: 2rem 1.25rem 4rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }

  pre {
    font-size: 0.78rem;
    padding: 0.9rem 1rem;
  }

  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .endpoint-path {
    margin-left: 0;
    font-size: 0.85rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 1.5rem 1rem 3rem;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; margin-top: 2.5rem; }

  .step { padding-left: 2.5rem; }
}

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ── Selection ── */

::selection { background: rgba(245, 158, 11, 0.3); color: var(--text); }
