/* Rasepi Developer Docs — Consistent with Marketing Design */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #22C55E;
  --brand-light: #4ADE80;
  --brand-pale: #F0FDF4;
  --brand-glow: rgba(34, 197, 94, 0.15);
  --navy: #0F1B2D;
  --text: #1A1A2E;
  --text-secondary: #4A5568;
  --text-muted: #94A3B8;
  --bg: #FAFAF8;
  --bg-warm: #F5F3EF;
  --surface: #FFFFFF;
  --border: #E2E0DC;
  --border-light: #EEECE8;
  --green: #16A34A;
  --yellow: #CA8A04;
  --red: #DC2626;
  --orange: #EA580C;
  --blue: #2563EB;
  --purple: #7C3AED;
  --r: 12px;
  --r-lg: 20px;
  --r-pill: 999px;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-mono: "DM Mono", "Fira Code", "Consolas", monospace;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
  --sidebar-w: 280px;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 15px; border-radius: var(--r); padding: 12px 24px; cursor: pointer; transition: all .2s ease; white-space: nowrap; border: none; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-light); transform: translateY(-1px); box-shadow: 0 4px 20px var(--brand-glow); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--brand); }
.btn-sm { font-size: 13px; padding: 8px 16px; }

/* ── Nav ─────────────────────────────────────────────────────── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; height: 64px; padding: 0 24px; max-width: 1600px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark { width: 32px; height: 32px; background: #404040; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; position: relative; }
.logo-mark::after { content: ''; position: absolute; bottom: 4px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #22C55E; }
.logo-wordmark { font-family: var(--font-body); font-weight: 700; font-size: 22px; color: var(--navy); letter-spacing: -0.3px; }
.logo-img { height: 28px; width: auto; display: block; }
.logo-i { position: relative; display: inline-block; }
.logo-i::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: #22C55E; }
.logo-text { font-family: var(--font-display); font-size: 20px; color: var(--navy); }
.logo-divider { width: 1px; height: 24px; background: var(--border); margin: 0 16px; }
.logo-sub { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); padding: 8px 14px; border-radius: var(--r-pill); transition: all .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); background: var(--brand-pale); }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── Layout ──────────────────────────────────────────────────── */
.layout { display: flex; margin-top: 64px; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); padding: 24px 0; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-section { padding: 0 20px; margin-bottom: 28px; }
.sidebar-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; padding: 0 8px; }
.sidebar-link { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-secondary); padding: 7px 12px; border-radius: 8px; transition: all .15s; }
.sidebar-link:hover { color: var(--text); background: var(--bg-warm); }
.sidebar-link.active { color: var(--brand); background: var(--brand-pale); font-weight: 600; }
.sidebar-link .method { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; font-family: var(--font-mono); }
.main { flex: 1; min-width: 0; padding: 48px 56px 120px; }

/* ── Hero ────────────────────────────────────────────────────── */
.docs-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 56px; }
.docs-hero .eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--brand); margin-bottom: 16px; }
.docs-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px); color: var(--navy); line-height: 1.15; margin-bottom: 16px; }
.docs-hero p { font-size: 17px; color: var(--text-secondary); max-width: 640px; line-height: 1.7; margin-bottom: 28px; }
.hero-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 32px; }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; transition: all .2s; }
.hero-card:hover { border-color: var(--brand); box-shadow: 0 4px 16px var(--brand-glow); transform: translateY(-2px); }
.hero-card .card-icon { font-size: 24px; margin-bottom: 10px; }
.hero-card h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.hero-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 0; }

/* ── Base URL Banner ─────────────────────────────────────────── */
.base-url-banner { display: flex; align-items: center; gap: 16px; background: var(--navy); color: #fff; padding: 16px 24px; border-radius: var(--r); margin-bottom: 40px; font-size: 14px; }
.base-url-banner code { font-family: var(--font-mono); font-size: 15px; color: #7DD3FC; background: rgba(255,255,255,0.1); padding: 4px 12px; border-radius: 6px; }
.base-url-banner .label { font-weight: 600; color: var(--text-muted); flex-shrink: 0; }

/* ── Auth Section ────────────────────────────────────────────── */
.auth-section { background: var(--brand-pale); border: 1px solid rgba(34,197,94,0.15); border-radius: var(--r-lg); padding: 32px; margin-bottom: 56px; }
.auth-section h2 { font-family: var(--font-display); font-size: 24px; color: var(--navy); margin-bottom: 12px; }
.auth-section p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.auth-section .code-block { background: var(--navy); }

/* ── Section Headings ────────────────────────────────────────── */
.api-section { margin-bottom: 72px; scroll-margin-top: 80px; }
.api-section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.api-section-header h2 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); color: var(--navy); }
.api-section-header .section-icon { font-size: 28px; }
.api-section > .section-description { font-size: 15px; color: var(--text-secondary); max-width: 680px; line-height: 1.7; margin-bottom: 32px; }

/* ── Endpoint Cards ──────────────────────────────────────────── */
.endpoint { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.endpoint:hover { border-color: var(--brand-light); box-shadow: var(--shadow-sm); }
.endpoint-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; user-select: none; }
.endpoint-header:hover { background: var(--bg-warm); }
.method { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; padding: 4px 10px; border-radius: 6px; font-family: var(--font-mono); flex-shrink: 0; text-transform: uppercase; }
.method-get { background: rgba(37,99,235,0.1); color: var(--blue); }
.method-post { background: rgba(22,163,74,0.1); color: var(--green); }
.method-put { background: rgba(202,138,4,0.1); color: var(--yellow); }
.method-patch { background: rgba(124,58,237,0.1); color: var(--purple); }
.method-delete { background: rgba(220,38,38,0.1); color: var(--red); }
.endpoint-path { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--navy); flex: 1; word-break: break-all; }
.endpoint-path .param { color: var(--brand); }
.endpoint-summary { font-size: 13px; color: var(--text-muted); flex-shrink: 0; max-width: 300px; text-align: right; }
.endpoint-toggle { font-size: 14px; color: var(--text-muted); flex-shrink: 0; transition: transform .2s; padding: 4px; }
.endpoint.open .endpoint-toggle { transform: rotate(180deg); }

.endpoint-body { display: none; border-top: 1px solid var(--border-light); padding: 20px; background: var(--bg); }
.endpoint.open .endpoint-body { display: block; }

.endpoint-description { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

/* ── Param Tables ────────────────────────────────────────────── */
.param-group { margin-bottom: 20px; }
.param-group-title { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.param-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.param-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.param-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.param-name { font-family: var(--font-mono); font-weight: 600; color: var(--navy); font-size: 13px; }
.param-type { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.param-required { font-size: 10px; font-weight: 700; color: var(--red); background: rgba(220,38,38,0.08); padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.param-optional { font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--bg-warm); padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.param-desc { color: var(--text-secondary); line-height: 1.5; }

/* ── Auth Badge ──────────────────────────────────────────────── */
.auth-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
.auth-badge--required { background: rgba(234,88,12,0.08); color: var(--orange); border: 1px solid rgba(234,88,12,0.2); }
.auth-badge--admin { background: rgba(220,38,38,0.06); color: var(--red); border: 1px solid rgba(220,38,38,0.15); }
.auth-badge--public { background: rgba(22,163,74,0.08); color: var(--green); border: 1px solid rgba(22,163,74,0.2); }
.auth-badge--role { background: rgba(124,58,237,0.08); color: var(--purple); border: 1px solid rgba(124,58,237,0.15); }

/* ── Code Blocks ─────────────────────────────────────────────── */
.code-block { background: var(--navy); color: #E2E8F0; border-radius: 10px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; overflow-x: auto; margin: 12px 0; position: relative; }
.code-block .comment { color: var(--text-muted); }
.code-block .string { color: #7DD3FC; }
.code-block .key { color: #A78BFA; }
.code-block .number { color: #FCA5A5; }
.code-block .keyword { color: #F9A8D4; }
.code-block pre { margin: 0; padding: 20px; overflow-x: auto; }
.code-block code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: inherit; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.code-header .code-lang { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.code-header .copy-btn { position: static; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-warm); padding: 2px 6px; border-radius: 4px; color: var(--brand); }

/* ── Response Tags ───────────────────────────────────────────── */
.response-codes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.response-code { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; font-family: var(--font-mono); }
.response-code--2xx { background: rgba(22,163,74,0.1); color: var(--green); }
.response-code--4xx { background: rgba(202,138,4,0.1); color: var(--yellow); }
.response-code--5xx { background: rgba(220,38,38,0.1); color: var(--red); }

/* ── Concept Cards ───────────────────────────────────────────── */
.concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 56px; }
.concept-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; transition: all .2s; }
.concept-card:hover { border-color: var(--brand); box-shadow: 0 4px 20px var(--brand-glow); }
.concept-card h3 { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.concept-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }

/* ── Enum/Model Reference ────────────────────────────────────── */
.model-ref { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; margin-bottom: 20px; }
.model-ref h4 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.model-ref h4 code { font-size: 14px; }
.enum-values { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.enum-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; background: var(--bg-warm); color: var(--navy); border: 1px solid var(--border-light); }

/* ── Footer ──────────────────────────────────────────────────── */
.docs-footer { background: var(--navy); padding: 48px 24px 32px; }
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-inner p { font-size: 14px; color: var(--text-muted); }
.footer-inner a { color: var(--brand-light); }
.footer-inner a:hover { text-decoration: underline; }

/* ── Search Box ──────────────────────────────────────────────── */
.search-box { position: relative; margin-bottom: 20px; padding: 0 20px; }
.search-box input { width: 100%; padding: 10px 12px 10px 36px; font-size: 13px; font-family: var(--font-body); border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); outline: none; transition: border-color .15s; }
.search-box input:focus { border-color: var(--brand); }
.search-box .search-icon { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--text-muted); pointer-events: none; }

/* ── Copy Button ─────────────────────────────────────────────── */
.copy-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.1); border: none; color: var(--text-muted); font-size: 12px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: var(--font-body); transition: all .15s; }
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main { padding: 32px 24px 80px; }
  .endpoint-summary { display: none; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .nav-hamburger { display: flex; }
  .nav-links { display: none; }
  .hero-cards { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .base-url-banner { flex-direction: column; gap: 8px; align-items: flex-start; }
  .endpoint-header { flex-wrap: wrap; gap: 8px; }

  .sidebar.mobile-open {
    display: block; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    width: 100%; z-index: 99; border-right: none;
  }
}

/* ── Dark Mode Toggle ────────────────────────────────────────── */
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text-secondary); transition: all .15s; display: flex; align-items: center; justify-content: center; margin-left: 8px; flex-shrink: 0; }
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }
.theme-toggle .icon-dark, .theme-toggle .icon-light { display: none; }
.theme-toggle .icon-light { display: inline; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: inline; }

/* ── Dark Mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
  --brand-pale: rgba(34, 197, 94, 0.15);
  --brand-glow: rgba(74, 222, 128, 0.25);
  --navy: #E2E8F0;
  --text: #D1D5DB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --bg: #0F1117;
  --bg-warm: #161922;
  --surface: #1A1D2B;
  --border: #2A2D3A;
  --border-light: #23263A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
}
[data-theme="dark"] .nav { background: rgba(15, 17, 23, 0.95); border-bottom-color: var(--border); }
[data-theme="dark"] .code-block { background: #0D0F17; border: 1px solid var(--border); }
[data-theme="dark"] code { background: rgba(255,255,255,0.06); color: #86EFAC; }
[data-theme="dark"] .base-url-banner { background: #0D0F17; border: 1px solid var(--border); }
[data-theme="dark"] .auth-section { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.2); }
[data-theme="dark"] .method-get { background: rgba(37,99,235,0.15); }
[data-theme="dark"] .method-post { background: rgba(22,163,74,0.15); }
[data-theme="dark"] .method-put { background: rgba(202,138,4,0.15); }
[data-theme="dark"] .method-patch { background: rgba(124,58,237,0.15); }
[data-theme="dark"] .method-delete { background: rgba(220,38,38,0.15); }
[data-theme="dark"] .param-table th { border-bottom-color: var(--border); }
[data-theme="dark"] .param-table td { border-bottom-color: var(--border-light); }
[data-theme="dark"] .docs-footer { background: #0A0C12; }
[data-theme="dark"] .logo-img,
[data-theme="dark"] .hero-logo { filter: invert(1) brightness(2); }
