/* File: static/docs/styles.css */

:root {
  /* Palette tuned to your logo: deep navy + icy blue */
  --rw-navy: #0C1523;
  --rw-navy-2: #0A1220;
  --rw-ink: #101827;
  --rw-slate: #1B2A40;

  --rw-ice: #7FC8EE;
  --rw-ice-2: #5BB7E8;
  --rw-ice-3: #A9DDF5;

  --bg: #F6F9FC;
  --panel: #FFFFFF;
  --text: #0F172A;
  --muted: rgba(15, 23, 42, .70);
  --border: rgba(2, 6, 23, .10);
  --shadow: 0 14px 40px rgba(2, 6, 23, .08);

  --link: #155E75;
  --accent: var(--rw-ice-2);
  --accent-strong: var(--rw-ice);

  --code-bg: rgba(2, 6, 23, .05);
  --code-border: rgba(2, 6, 23, .08);

  --radius: 18px;
  --radius-sm: 12px;

  --sidebar-w: 320px;
  --topbar-h: 68px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

html[data-theme="dark"] {
  --bg: #070B12;
  --panel: #0B1220;
  --text: #EAF2FF;
  --muted: rgba(234, 242, 255, .72);
  --border: rgba(234, 242, 255, .10);
  --shadow: 0 18px 55px rgba(0, 0, 0, .45);

  --link: var(--rw-ice-3);

  --code-bg: rgba(234, 242, 255, .06);
  --code-border: rgba(234, 242, 255, .10);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #070B12;
    --panel: #0B1220;
    --text: #EAF2FF;
    --muted: rgba(234, 242, 255, .72);
    --border: rgba(234, 242, 255, .10);
    --shadow: 0 18px 55px rgba(0, 0, 0, .45);
    --link: var(--rw-ice-3);
    --code-bg: rgba(234, 242, 255, .06);
    --code-border: rgba(234, 242, 255, .10);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 15% 0%, rgba(127, 200, 238, .16), transparent 55%),
              radial-gradient(900px 500px at 85% 10%, rgba(91, 183, 232, .12), transparent 50%),
              var(--bg);
  color: var(--text);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}
.skip:focus { left: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .topbar { background: rgba(11,18,32,.60); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .topbar { background: rgba(11,18,32,.60); }
}

.topbar__left, .topbar__right { display: flex; align-items: center; gap: 12px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--panel);
}
.brand__title { font-weight: 800; letter-spacing: .2px; }
.brand__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.iconbtn {
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.iconbtn:hover { transform: translateY(-1px); }
.iconbtn__bars {
  width: 18px; height: 12px;
  border-top: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  position: relative;
  opacity: .9;
}
.iconbtn__bars::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: 2px solid var(--text);
}

.search { position: relative; display: flex; align-items: center; }
.search__input {
  width: min(420px, 42vw);
  height: 42px;
  padding: 0 12px 0 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
}
.search__input:focus {
  border-color: rgba(127, 200, 238, .65);
  box-shadow: 0 0 0 4px rgba(127, 200, 238, .18);
}
.search__hint {
  position: absolute;
  right: 8px;
  font-size: 12px;
  color: var(--muted);
}
kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--code-bg);
}

.pill {
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.pill:hover { transform: translateY(-1px); }
.pill__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(127, 200, 238, .18);
}
.pill__text { font-weight: 700; font-size: 13px; }
.pill--ghost { box-shadow: none; background: transparent; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.45);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .sidebar { background: rgba(11,18,32,.45); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .sidebar { background: rgba(11,18,32,.45); }
}

.sidebar__title {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 10px;
}
.sidebar__section { margin-bottom: 16px; }

.nav { display: grid; gap: 6px; }
.nav__link {
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
}
.nav__link:hover {
  text-decoration: none;
  background: rgba(127, 200, 238, .10);
  border-color: rgba(127, 200, 238, .20);
}

.sidebar__footer {
  margin-top: 18px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.mini { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; }
.mini__label { color: var(--muted); font-size: 12px; }
.mini__value { font-weight: 700; font-size: 12px; }

.main {
  padding: 28px 22px 40px;
  max-width: 1100px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  margin-bottom: 22px;
  align-items: start;
}
.hero__content, .hero__panel { min-width: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
html[data-theme="dark"] .badge { background: rgba(11,18,32,.55); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .badge { background: rgba(11,18,32,.55); } }
.badge__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(127, 200, 238, .18);
}

.h1 { margin: 14px 0 8px; font-size: 40px; letter-spacing: -0.02em; }
.lead { margin: 0 0 14px; color: var(--muted); font-size: 16px; line-height: 1.55; }

.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(127, 200, 238, .35);
  background: linear-gradient(135deg, rgba(127,200,238,.22), rgba(91,183,232,.10));
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  box-shadow: none;
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 14px;
}
.card__title { font-weight: 900; margin-bottom: 6px; }
.card__text { color: var(--muted); margin: 0; line-height: 1.45; }

.panel {
  border-radius: var(--radius);
  border: 1px solid rgba(127, 200, 238, .22);
  background: linear-gradient(180deg, rgba(127,200,238,.08), transparent 55%), var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}
.panel__title { font-weight: 900; margin: 8px 0 8px; }
.note {
  margin-top: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
  padding: 12px 14px;
  color: var(--muted);
}
html[data-theme="dark"] .note { background: rgba(11,18,32,.55); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .note { background: rgba(11,18,32,.55); } }

.section { margin-top: 22px; }
.h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.01em; }
.muted { color: var(--muted); }

.list { margin: 8px 0 0 18px; color: var(--muted); }
.list li { margin: 6px 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -110%; width: min(var(--sidebar-w), 92vw); transition: left .22s ease; z-index: 40; }
  .sidebar.open { left: 0; }
  .hero { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .search__input { width: min(360px, 46vw); }
}

.callout {
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(127,200,238,.25);
  background: linear-gradient(135deg, rgba(127,200,238,.12), rgba(91,183,232,.06));
  padding: 12px 14px;
}
.callout__title { font-weight: 900; margin-bottom: 6px; }
.callout--small { font-size: 14px; }

.endpoint {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.endpoint__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(127,200,238,.08);
}
.method {
  font-family: var(--mono);
  font-weight: 900;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.method--get { border-color: rgba(91,183,232,.30); }
.method--post { border-color: rgba(127,200,238,.38); }
.path { font-family: var(--mono); font-weight: 800; font-size: 13px; }
.endpoint__body { padding: 14px; }

.subhead { margin: 12px 0 8px; font-weight: 900; }

.codewrap { position: relative; margin: 10px 0 0; }
.code {
  margin: 0;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
}
.copybtn {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
}
.copybtn:hover { transform: translateY(-1px); }
code { font-family: var(--mono); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.footer {
  margin-top: 34px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.footer__wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer__links { display: flex; gap: 12px; }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* === PATCH: codewrap + copy button spacing (single-line friendly) === */

/* Let the code block reserve space for the copy button */
.codewrap { position: relative; margin: 10px 0 0; }

.code{
  /* keep your existing styles, but add right padding to clear the button */
  padding: 12px 56px 12px 12px; /* ← 56px reserves room for copybtn */
}

/* Position the button centered vertically, not hard-top, so it looks good on 1-liners */
.copybtn{
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  padding: 7px 10px;  /* slightly tighter */
  line-height: 1;     /* prevents weird vertical padding */
}

/* Keep hover lift, but don’t “stack” transforms */
.copybtn:hover{
  transform: translateY(-50%) translateY(-1px);
}

/* Optional: if the code block is very short, ensure button never overlaps scrollbars */
.code{
  scrollbar-gutter: stable both-edges; /* safe in modern browsers */
}
