/* ═══════════════════════════════════════════════════════════
   Restaurateur.ch — API Documentation
   Inspiré Stripe / Resend / Cloudflare docs
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-code: #0b1622;
  --bg-code-soft: #f3f4f8;
  --text: #0a2540;
  --text-soft: #425466;
  --text-muted: #8898aa;
  --border: #e6ebf1;
  --border-soft: #f0f3f8;
  --primary: #6366f1;
  --primary-soft: #eef2ff;
  --accent: #0ea5e9;
  --success: #1ea672;
  --warn: #d97706;
  --error: #df1b41;
  --shadow-sm: 0 2px 5px rgba(50,50,93,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(50,50,93,.1), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(50,50,93,.12), 0 4px 12px rgba(0,0,0,.08);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 280px;
  --header-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

code, pre, kbd { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; }

/* ─── TOP HEADER ──────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 32px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.topbar-brand:hover { text-decoration: none; }
.topbar-logo {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.topbar-version {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
  padding: 2px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
}
.topbar-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.topbar-nav a {
  font-size: 14px;
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 6px;
}
.topbar-nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.topbar-cta {
  background: var(--text);
  color: #fff !important;
  padding: 7px 14px !important;
  font-weight: 600;
  margin-left: 8px;
}
.topbar-cta:hover { background: #1a3a5c !important; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: 1440px;
  margin: 0 auto;
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg);
  padding: 28px 24px 60px;
  border-right: 1px solid var(--border-soft);
}

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--text-muted);
  margin: 24px 0 6px;
}
.nav-section:first-child { margin-top: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 1px -10px;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 13.5px;
  transition: all .12s;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }

/* HTTP method badge */
.m {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.m-get    { background: #def7ec; color: #057a55; }
.m-post   { background: #dbeafe; color: #1e40af; }
.m-put    { background: #fef3c7; color: #92400e; }
.m-patch  { background: #ede9fe; color: #6d28d9; }
.m-delete { background: #fee2e2; color: #991b1b; }

/* ─── CONTENT ─────────────────────────────────────────────── */
.content {
  padding: 56px 64px 80px;
  max-width: 920px;
  min-width: 0;
}

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.tag {
  display: inline-block;
  padding: 5px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}

h1 {
  font-size: 44px;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -.025em;
  background: linear-gradient(135deg, var(--text), var(--primary) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}
.lead {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 680px;
  line-height: 1.5;
  margin: 0;
}

.cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #5856e8; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--bg); color: var(--text) !important; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; }

/* ─── SECTIONS ───────────────────────────────────────────── */
section { padding: 24px 0; scroll-margin-top: 80px; }

h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 36px 0 16px;
  letter-spacing: -.015em;
  color: var(--text);
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text);
}
h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
}

p { color: var(--text-soft); margin: 0 0 14px; }
strong { color: var(--text); font-weight: 600; }

ul, ol { color: var(--text-soft); padding-left: 22px; }
ul li, ol li { margin: 4px 0; }

.sep { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* ─── CODE ────────────────────────────────────────────────── */
:not(pre) > code {
  background: var(--bg-code-soft);
  color: #4f46e5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-soft);
}

pre.code {
  background: var(--bg-code);
  color: #e7eaee;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
  line-height: 1.55;
  font-size: 13px;
  position: relative;
}
pre.code code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 13px;
  border: none;
  font-weight: 400;
}

/* Code syntax tokens */
.tok-k  { color: #c792ea; }     /* keyword */
.tok-s  { color: #c3e88d; }     /* string */
.tok-n  { color: #f78c6c; }     /* number */
.tok-c  { color: #546e7a; font-style: italic; }  /* comment */
.tok-p  { color: #89ddff; }     /* property */
.tok-m  { color: #ffcb6b; font-weight: 600; }    /* HTTP method */

/* Lang label */
.code-wrap { position: relative; margin: 16px 0; }
.code-wrap pre.code { margin: 0; padding-top: 36px; }
.code-lang {
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #6f7d8a;
  background: rgba(255,255,255,.05);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: .04em;
}

/* Inline endpoint (e.g. GET /bookings) */
.inline-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ─── ENDPOINT HEAD ───────────────────────────────────────── */
.endpoint {
  margin: 48px 0 32px;
  scroll-margin-top: 80px;
}
.endpoint-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}
.endpoint-head .m { font-size: 11px; padding: 4px 9px; min-width: 50px; }
.endpoint-path {
  color: var(--text);
  font-weight: 500;
}
.endpoint-head .copy-btn {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}
.endpoint-head .copy-btn:hover { background: var(--bg); color: var(--text); }

/* ─── TABLES ──────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}
.table thead { background: var(--bg-soft); }
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.table th {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table td { color: var(--text-soft); }
.table td code { font-size: 12px; }
.table tr:hover td { background: rgba(99,102,241,.025); }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}
.badge-ok      { background: #def7ec; color: #057a55; }
.badge-warn    { background: #fef3c7; color: #92400e; }
.badge-err     { background: #fee2e2; color: #991b1b; }
.badge-required{ background: #fee2e2; color: #991b1b; }
.badge-optional{ background: var(--bg-code-soft); color: var(--text-muted); }

/* ─── CALLOUTS ────────────────────────────────────────────── */
.callout {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  border-left: 4px solid;
  font-size: 14px;
}
.callout p { margin: 4px 0; }
.callout strong { color: var(--text); }
.callout-info { background: #eff6ff; border-color: #3b82f6; }
.callout-warn { background: #fef3c7; border-color: #d97706; }
.callout-tip  { background: #ecfdf5; border-color: #10b981; }
.callout-danger { background: #fef2f2; border-color: #ef4444; }

/* ─── TABS ────────────────────────────────────────────────── */
.tabs {
  margin: 16px 0;
}
.tabs-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.tabs-nav button {
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tabs-nav button:hover { color: var(--text); }
.tabs-nav button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tabs-panel { display: none; }
.tabs-panel.active { display: block; }

/* ─── CARDS ───────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card {
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all .2s;
  display: block;
  color: var(--text);
}
.card:hover {
  text-decoration: none;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.card-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.card-desc { font-size: 13px; color: var(--text-soft); line-height: 1.5; }

/* ─── CHECK LIST ──────────────────────────────────────────── */
.check-list { list-style: none; padding: 0; margin: 12px 0; }
.check-list li {
  padding: 6px 0 6px 28px;
  position: relative;
  color: var(--text-soft);
}
.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.footer p { margin: 4px 0; }
.footer a { color: var(--text-soft); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content { padding: 32px 24px 56px; }
  h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  .topbar { padding: 0 20px; }
  .topbar-nav a:not(.topbar-cta) { display: none; }
}
