/* Public API documentation page — clean light theme, RTL, self-contained (CSP-safe). */

/* ===== Cairo — self-hosted Arabic UI font (served from /fonts, CSP-safe) ===== */
@font-face { font-family:'Cairo'; font-style:normal; font-weight:400; font-display:swap;
  src:url('/fonts/cairo-arabic-400-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41; }
@font-face { font-family:'Cairo'; font-style:normal; font-weight:400; font-display:swap;
  src:url('/fonts/cairo-latin-400-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Cairo'; font-style:normal; font-weight:600; font-display:swap;
  src:url('/fonts/cairo-arabic-600-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41; }
@font-face { font-family:'Cairo'; font-style:normal; font-weight:600; font-display:swap;
  src:url('/fonts/cairo-latin-600-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Cairo'; font-style:normal; font-weight:700; font-display:swap;
  src:url('/fonts/cairo-arabic-700-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41; }
@font-face { font-family:'Cairo'; font-style:normal; font-weight:700; font-display:swap;
  src:url('/fonts/cairo-latin-700-normal.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+2215,U+FEFF,U+FFFD; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: 'Cairo', "Segoe UI", Tahoma, system-ui, sans-serif;
  background: #f8fafc; color: #0f172a; line-height: 1.7;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
/* visible keyboard focus (was missing — light theme) */
:where(a, button, input, select, textarea, .tab, .toc a):focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 6px; }
/* back-to-dashboard link in the top bar */
.topbar .backlink { display: inline-block; color: #94a3b8; font-size: 13px; margin-bottom: 8px; }
.topbar .backlink:hover { color: #e2e8f0; text-decoration: none; }
code, pre, .mono { font-family: "Cascadia Code", "Consolas", ui-monospace, monospace; }

/* sticky top bar with live Base URL + Token inputs */
.topbar {
  position: sticky; top: 0; z-index: 20; background: #0f172a; color: #e2e8f0;
  padding: 14px 20px; box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.topbar h1 { font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.topbar .live { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.topbar label { font-size: 12px; color: #94a3b8; display: block; }
.topbar input {
  width: 100%; margin-top: 3px; padding: 8px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #1e293b; color: #e2e8f0; font-size: 13px; direction: ltr;
}
.topbar .hint { font-size: 12px; color: #94a3b8; margin-top: 6px; }

.wrap { display: grid; grid-template-columns: 240px 1fr; gap: 28px; max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }

/* table of contents */
.toc { position: sticky; top: 120px; align-self: start; font-size: 14px; }
.toc h3 { font-size: 12px; text-transform: uppercase; color: #64748b; letter-spacing: .04em; margin: 0 0 8px; }
.toc a { display: block; padding: 6px 10px; border-radius: 7px; color: #334155; }
.toc a:hover { background: #eef2ff; text-decoration: none; }

main { min-width: 0; }
section { margin-bottom: 40px; scroll-margin-top: 130px; }
h2 { font-size: 22px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0; }
h3 { font-size: 16px; margin: 22px 0 8px; }
p { margin: 8px 0; }
.lead { color: #475569; font-size: 16px; }

/* endpoint card */
.ep { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 18px; margin: 14px 0;
  box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.ep-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.method { font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 6px; color: #fff; letter-spacing: .03em; }
.method.get { background: #16a34a; } .method.post { background: #2563eb; }
.method.delete { background: #dc2626; } .method.patch { background: #d97706; }
.path { font-family: "Cascadia Code", Consolas, monospace; font-size: 14px; direction: ltr; color: #0f172a; }
.ep .desc { color: #475569; margin: 8px 0; }

/* params table */
table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid #e2e8f0; }
th { background: #f1f5f9; font-weight: 600; }
td code, p code, li code, .desc code { background: #eef2ff; color: #1e3a8a; padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* code block + copy */
.code { position: relative; margin: 10px 0; }
.code pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px 16px; overflow-x: auto;
  direction: ltr; text-align: left; font-size: 13px; margin: 0; }
.code .copy {
  position: absolute; top: 8px; left: auto; right: 8px; background: #334155; color: #e2e8f0; border: 0; border-radius: 7px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.code .copy:hover { background: #475569; }
.code .copy.ok { background: #16a34a; }

/* language tabs */
.tabs { display: flex; gap: 6px; margin: 14px 0 0; flex-wrap: wrap; }
.tab { background: #e2e8f0; border: 0; border-radius: 7px 7px 0 0; padding: 7px 16px; cursor: pointer;
  font-size: 13px; font-family: inherit; color: #334155; }
.tab.active { background: #0f172a; color: #fff; }
.tabpane { display: none; } .tabpane.active { display: block; }

.note { background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 10px; padding: 12px 16px; margin: 14px 0; font-size: 14px; }
.warn { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 12px 16px; margin: 14px 0; font-size: 14px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.g { background: #dcfce7; color: #166534; } .pill.r { background: #fee2e2; color: #991b1b; }

@media (max-width: 800px) {
  .wrap { grid-template-columns: 1fr; }
  .toc { position: static; }
  .topbar .live { grid-template-columns: 1fr; }
}
