/* PayMeNow Docs — Stripe-ish layout */

:root {
  --fg: #1a1a2e;
  --fg-muted: #64748b;
  --fg-dim: #94a3b8;
  --bg: #fff;
  --bg-page: #fafbfc;
  --bg-alt: #f8fafc;
  --bg-active: #f1f5f9;
  --border: #e8ecf0;
  --accent: #635bff;
  --accent-dark: #4b44c9;
  --code-bg: #0a2540;
  --code-fg: #e3e8ee;
  --code-inline-bg: #f1f3f6;
  --code-inline-fg: #0a2540;
  --note-bg: #eff6ff;
  --note-border: #93c5fd;
  --warning-bg: #fef3c7;
  --warning-border: #fcd34d;
  --sidebar-w: 260px;
  --toc-w: 220px;
  --topbar-h: 53px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

/* --- Topbar — aligned with dashboard nav --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700;
  font-size: 17px;
  margin-right: 36px;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); position: relative; top: -1px; }
.brand em {
  font-style: normal;
  font-weight: 500;
  color: var(--fg-muted);
  margin-left: 8px;
  font-size: 14px;
}
.topnav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.topnav a {
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all .15s;
}
.topnav a:hover {
  color: var(--fg);
  background: var(--bg-alt);
  text-decoration: none;
}

/* --- Layout grid --- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
}

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 16px 48px 24px;
  border-right: 1px solid var(--border);
}
.sidebar .section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  margin: 16px 0 6px;
  padding: 0 8px;
}
.sidebar ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.sidebar li a {
  display: block;
  padding: 6px 8px;
  margin: 1px 0;
  font-size: 14px;
  color: var(--fg-muted);
  border-radius: 4px;
}
.sidebar li a:hover {
  background: var(--bg-alt);
  text-decoration: none;
  color: var(--fg);
}
.sidebar li a.active {
  color: var(--accent);
  background: var(--bg-active);
  font-weight: 500;
}

/* --- Content --- */
.content {
  min-width: 0;
  padding: 32px 48px 96px;
}
.prose { max-width: 760px; line-height: 1.6; }
.prose h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.prose h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 48px 0 12px;
  color: var(--fg);
  letter-spacing: -0.005em;
}
.prose h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 8px;
  color: var(--fg);
}
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose strong { font-weight: 600; }

.prose .heading-anchor {
  opacity: 0;
  margin-left: 8px;
  font-weight: 400;
  color: var(--fg-dim);
  text-decoration: none;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor { opacity: 1; }

/* --- Inline code --- */
.prose :not(pre) > code {
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

/* --- Code blocks --- */
.prose pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--code-fg);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  opacity: 0;
  transition: opacity .15s;
}
.prose pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,0.15); }
.copy-btn.copied { color: #34d399; }

/* --- Tables --- */
.prose table {
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
  width: 100%;
}
.prose th, .prose td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.prose th {
  background: var(--bg-alt);
  font-weight: 600;
}

/* --- Callouts --- */
.callout {
  padding: 12px 16px;
  border-left: 3px solid;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 20px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-note { background: var(--note-bg); border-color: var(--note-border); }
.callout-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.callout-title {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* --- Tabs --- */
.tabs {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 20px;
  overflow: hidden;
}
.tabs-nav {
  display: flex;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.tabs-nav button {
  background: none;
  border: none;
  padding: 10px 16px;
  font: inherit;
  font-size: 13px;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs-nav button.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.tabs-panels > div { display: none; }
.tabs-panels > div.active { display: block; }
.tabs-panels pre { margin: 0; border-radius: 0; }

/* --- TOC --- */
.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 32px 20px;
  font-size: 13px;
}
.toc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 4px 0; }
.toc li.depth-3 { padding-left: 12px; }
.toc a { color: var(--fg-muted); display: block; padding: 2px 0; }
.toc a:hover { color: var(--fg); text-decoration: none; }
.toc a.active { color: var(--accent); font-weight: 500; }

/* --- Responsive --- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .toc { display: none; }
}
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 24px; }
}
