/* ==========================================================================
   Zoom2u Developer Documentation — Design System
   Modern, technical, Cloudflare-inspired. Themed in Zoom2u brand colors.
   Content is unchanged from the original site; only presentation is refreshed.
   ========================================================================== */

/* ----- Design tokens ----------------------------------------------------- */
:root {
  /* Brand (extracted verbatim from the original z2uDev theme) */
  --brand:            #00a7e2;   /* Zoom2u blue */
  --brand-strong:     #0081af;
  --brand-deep:       #00678b;
  --brand-green:      #76d750;   /* success / "View API Docs" */
  --brand-green-deep: #59c72d;
  --brand-orange:     #f4ac69;   /* numeric accent (from code theme) */
  --ink-900:          #292929;   /* code background / darkest */

  /* Code theme — replicated exactly from original ACE/Enlighter palette */
  --code-bg:      #292929;
  --code-fg:      #f5f7fa;
  --code-key:     #76d750;   /* json keys / variables */
  --code-string:  #00a7e2;   /* strings */
  --code-number:  #f4ac69;   /* numbers */
  --code-punct:   #9aa4ad;
  --code-bool:    #c792ea;

  /* Light theme surfaces */
  --bg:            #ffffff;
  --bg-subtle:     #f7f9fb;
  --bg-elevated:   #ffffff;
  --surface-2:     #f0f4f8;
  --text:          #1c2530;
  --text-muted:    #5b6b7b;
  --text-faint:    #8a99a8;
  --border:        #e3e9ef;
  --border-strong: #cdd7e1;
  --link:          #0081af;
  --link-hover:    #00678b;
  --shadow-sm:     0 1px 2px rgba(16,33,50,.06), 0 1px 3px rgba(16,33,50,.08);
  --shadow-md:     0 4px 12px rgba(16,33,50,.08), 0 2px 4px rgba(16,33,50,.06);
  --shadow-lg:     0 12px 40px rgba(16,33,50,.14);

  /* Type */
  --font-sans: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --nav-h: 60px;
  --sidebar-w: 286px;
  --toc-w: 232px;
  --content-max: 860px;
  --radius: 10px;
  --radius-sm: 7px;
}

:root[data-theme="dark"] {
  --bg:            #0d1117;
  --bg-subtle:     #11161d;
  --bg-elevated:   #161c24;
  --surface-2:     #1b222c;
  --text:          #e6edf3;
  --text-muted:    #9fb0c0;
  --text-faint:    #6b7d8f;
  --border:        #232c38;
  --border-strong: #313d4b;
  --link:          #4cc2f0;
  --link-hover:    #7fd4f5;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
  --shadow-md:     0 4px 14px rgba(0,0,0,.45);
  --shadow-lg:     0 16px 50px rgba(0,0,0,.6);
}

/* ----- Reset ------------------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 18px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ----- Top navigation ---------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { display: inline-flex; align-items: center; }
.z2u-logo { height: 27px; width: auto; display: block; }
.brand .tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-faint); padding: 2px 7px; border: 1px solid var(--border-strong);
  border-radius: 5px; margin-left: 2px;
}
.topbar .spacer { flex: 1; }
.mainnav { display: flex; align-items: center; gap: 4px; }
.mainnav a {
  color: var(--text-muted); font-weight: 600; font-size: 14.5px;
  padding: 7px 13px; border-radius: 7px; transition: color .15s, background .15s;
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.mainnav a.active { color: var(--brand); }

.tool-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.tool-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.tool-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-toggle { display: none; }

/* ----- App shell --------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0,1fr); align-items: start; }
.shell.with-toc .content-col { display: grid; grid-template-columns: minmax(0,1fr) var(--toc-w); gap: 40px; }

/* ----- Sidebar ----------------------------------------------------------- */
.sidebar {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 14px 60px 26px;
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
}
.sidebar::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg-subtle); }
.side-section { margin-bottom: 26px; }
.side-title {
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--text-faint); margin: 0 0 9px 10px;
}
.side-menu { list-style: none; margin: 0; padding: 0; }
.side-menu li { margin: 1px 0; }
.side-menu a {
  display: block; padding: 6.5px 12px; border-radius: 7px;
  color: var(--text-muted); font-size: 14.5px; font-weight: 500;
  border-left: 2px solid transparent; transition: all .13s;
}
.side-menu a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.side-menu a.active {
  color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, transparent);
  font-weight: 600; border-left-color: var(--brand);
}

/* ----- Content ----------------------------------------------------------- */
.content-col { min-width: 0; padding: 0; }
.main {
  min-width: 0; max-width: var(--content-max);
  margin: 0 auto; padding: 40px 40px 100px;
}
.shell.with-toc .main { margin: 0; padding: 40px 8px 100px 40px; }

.breadcrumbs { font-size: 13px; color: var(--text-faint); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .sep { color: var(--border-strong); }

.page-header { margin: 0 0 22px; padding: 0 0 18px; border-bottom: 1px solid var(--border); }
.page-header h1 { margin: 0; }

/* Typography */
.main h1 { font-size: 2.35rem; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 .4em; }
.main h2 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.3px; margin: 2.2em 0 .7em; padding-top: .2em; }
.main h3 { font-size: 1.28rem; font-weight: 700; margin: 1.9em 0 .6em; }
.main h4 { font-size: 1.08rem; font-weight: 700; margin: 1.6em 0 .5em; color: var(--text); }
.main h5 { font-size: .97rem; font-weight: 700; margin: 1.4em 0 .5em; color: var(--text-muted); }
.main h2, .main h3, .main h4 { scroll-margin-top: calc(var(--nav-h) + 16px); }
.main p { margin: 0 0 1.05em; }
.main ul, .main ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.main li { margin: .3em 0; }
.main li > ul, .main li > ol { margin: .3em 0; }
.main strong, .main b { font-weight: 700; }

/* anchor link on hover for headings */
.heading-anchor {
  opacity: 0; margin-left: 8px; color: var(--text-faint); font-weight: 400;
  text-decoration: none; transition: opacity .15s;
}
.main h2:hover .heading-anchor, .main h3:hover .heading-anchor, .main h4:hover .heading-anchor { opacity: 1; }

/* Inline code */
.main :not(pre) > code {
  font-family: var(--font-mono); font-size: .86em;
  background: var(--surface-2); color: var(--brand-deep);
  padding: .15em .42em; border-radius: 5px;
  border: 1px solid var(--border);
  word-break: break-word;
}
:root[data-theme="dark"] .main :not(pre) > code { color: #7fd4f5; }

/* ----- Code blocks (replicates original Enlighter/ACE palette) ----------- */
.code-block {
  position: relative; margin: 0 0 1.4em;
  background: var(--code-bg); border-radius: var(--radius);
  border: 1px solid #000; box-shadow: var(--shadow-md);
  overflow: hidden;
}
.code-block .code-head {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.code-block .dots { display: flex; gap: 6px; }
.code-block .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-block .dots i:nth-child(1) { background: #ff5f56; }
.code-block .dots i:nth-child(2) { background: #ffbd2e; }
.code-block .dots i:nth-child(3) { background: #27c93f; }
.code-block .lang {
  margin-left: 6px; font-family: var(--font-mono); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .6px; color: #8a96a3; font-weight: 600;
}
.code-block .copy-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.06); color: #c5cdd6; border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans); transition: all .15s;
}
.code-block .copy-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.code-block .copy-btn.copied { color: var(--brand-green); border-color: var(--brand-green); }
.code-block .copy-btn svg { width: 14px; height: 14px; }
.code-block pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  color: var(--code-fg); tab-size: 2;
}
.code-block pre code { font-family: inherit; background: none; border: 0; padding: 0; color: inherit; }
.code-block pre::-webkit-scrollbar { height: 9px; }
.code-block pre::-webkit-scrollbar-thumb { background: #4a525c; border-radius: 6px; }
/* token colors (applied by app.js highlighter) */
.tok-key    { color: var(--code-key); }
.tok-string { color: var(--code-string); }
.tok-number { color: var(--code-number); }
.tok-bool,
.tok-null   { color: var(--code-bool); }
.tok-punct  { color: var(--code-punct); }

/* ----- Tables (replaces TablePress styling) ------------------------------ */
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.tablepress, .main table {
  width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--bg-elevated);
}
.main table thead th {
  text-align: left; font-weight: 700; color: var(--text);
  background: var(--surface-2); padding: 11px 15px;
  border-bottom: 2px solid var(--border-strong); white-space: nowrap;
}
.main table td { padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text); }
.main table tbody tr:last-child td { border-bottom: 0; }
.main table tbody tr:nth-child(even) { background: var(--bg-subtle); }
.main table tbody tr:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.main table code { white-space: nowrap; }

/* ----- Callouts ---------------------------------------------------------- */
.callout {
  display: flex; gap: 12px; padding: 14px 16px; margin: 0 0 1.4em;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-subtle); border-left: 3px solid var(--brand);
}
.callout .ic { flex-shrink: 0; color: var(--brand); }

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; padding: 11px 22px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer; transition: all .16s; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(0,167,226,.32); }
.btn-primary:hover { background: var(--brand-strong); color: #fff; box-shadow: 0 6px 20px rgba(0,167,226,.42); }
.btn-green { background: var(--brand-green); color: #0a2b00; box-shadow: 0 4px 14px rgba(118,215,80,.34); }
.btn-green:hover { background: var(--brand-green-deep); color: #0a2b00; }
.btn-ghost { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* HTTP method pills */
.method { font-family: var(--font-mono); font-weight: 700; font-size: .82em; padding: .12em .5em; border-radius: 5px; letter-spacing: .4px; }
.method-post   { background: rgba(118,215,80,.16);  color: var(--brand-green-deep); }
.method-get    { background: rgba(0,167,226,.16);   color: var(--brand-deep); }
.method-put,
.method-patch  { background: rgba(244,172,105,.2);  color: #b9711f; }
.method-delete { background: rgba(207,46,46,.14);   color: #cf2e2e; }

/* ----- On-this-page TOC -------------------------------------------------- */
.toc { position: sticky; top: var(--nav-h); align-self: start; height: calc(100vh - var(--nav-h)); overflow-y: auto; padding: 40px 24px 60px 0; }
.toc-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.1px; color: var(--text-faint); margin: 0 0 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
  display: block; padding: 4px 0 4px 14px; margin-left: -1px;
  border-left: 2px solid transparent; color: var(--text-muted);
  font-size: 13px; line-height: 1.4; transition: all .13s;
}
.toc li a:hover { color: var(--text); text-decoration: none; }
.toc li a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.toc li.lvl-3 a { padding-left: 26px; font-size: 12.5px; }
.toc li.lvl-4 a { padding-left: 38px; font-size: 12.5px; }

/* ----- Footer ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-subtle);
  padding: 30px 26px; margin-top: 0;
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.site-footer .copyright { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; color: var(--text-faint); font-size: 13.5px; }
.site-footer .foot-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; }
.site-footer .foot-brand .z2u-logo { height: 22px; width: auto; display: block; }
.site-footer .foot-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-faint); }
.action_button { display: flex; justify-content: center; padding: 8px 0 4px; }

/* ----- Home / hero — theme-aware (light: clean / dark: Neo-Tokyo) -------- */
.hero {
  position: relative; overflow: hidden;
  padding: 112px 24px 100px; text-align: center;
  /* LIGHT (default): white with a soft blue glow */
  background:
    radial-gradient(900px 380px at 50% -80px, rgba(0,167,226,.12), transparent 70%),
    radial-gradient(700px 500px at 85% 120%, rgba(0,167,226,.06), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f4f9fd 100%);
  border-bottom: 1px solid var(--border);
}
/* particle canvas sits behind hero content */
#hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
/* scanline sheen — dark mode only (set below) */
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero > *:not(#hero-fx) { position: relative; z-index: 2; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--brand-deep);
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent);
  padding: 7px 16px; border-radius: 999px;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -1.5px; margin: 0 0 .35em; color: var(--text); }
.hero h1 .text-primary { color: var(--brand); }
.hero h2 { font-size: clamp(1.05rem, 2.2vw, 1.4rem); font-weight: 400; color: var(--text-muted); max-width: 720px; margin: 0 auto 2.4em; line-height: 1.5; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* DARK: Neo-Tokyo cyberpunk panel */
:root[data-theme="dark"] .hero {
  background:
    radial-gradient(900px 380px at 50% -80px, rgba(0,167,226,.22), transparent 70%),
    radial-gradient(700px 500px at 85% 120%, rgba(0,167,226,.10), transparent 70%),
    linear-gradient(180deg, #070b11 0%, #0a0f17 55%, #0b1018 100%);
  border-bottom: 1px solid #16202c;
}
:root[data-theme="dark"] .hero::after {
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.015) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
:root[data-theme="dark"] .hero .eyebrow {
  color: #8be4ff; background: rgba(0,167,226,.10); border-color: rgba(0,167,226,.45);
  box-shadow: 0 0 18px rgba(0,167,226,.25), inset 0 0 12px rgba(0,167,226,.12);
}
:root[data-theme="dark"] .hero h1 { color: #f4f8fc; }
:root[data-theme="dark"] .hero h1 .text-primary { text-shadow: 0 0 24px rgba(0,167,226,.55), 0 0 48px rgba(0,167,226,.25); }
:root[data-theme="dark"] .hero h2 { color: #9fb2c4; }
:root[data-theme="dark"] .hero .btn-ghost { background: rgba(255,255,255,.04); color: #e6edf3; border-color: rgba(255,255,255,.18); }
:root[data-theme="dark"] .hero .btn-ghost:hover { background: rgba(255,255,255,.09); color: #fff; }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
  max-width: 1080px; margin: 0 auto; padding: 70px 24px;
}
.feature-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.feature-card .fic {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 13%, transparent); color: var(--brand); margin-bottom: 16px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.feature-card a.card-link { color: inherit; text-decoration: none; }

/* ----- Forms (contact) --------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--text); }
.form-control, .main input[type=text], .main input[type=email], .main textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--text);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .main input:focus, .main textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.form-feedback { margin-top: 14px; font-weight: 600; font-size: 14.5px; }
.form-feedback.ok { color: var(--brand-green-deep); }
.form-feedback.err { color: #cf2e2e; }

/* ----- Mobile sidebar backdrop ------------------------------------------- */
.backdrop { display: none; }

/* ----- Responsive -------------------------------------------------------- */
@media (max-width: 1180px) {
  .shell.with-toc .content-col { grid-template-columns: minmax(0,1fr); }
  .toc { display: none; }
  .shell.with-toc .main { margin: 0 auto; padding: 40px 40px 100px; }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: minmax(0,1fr); }
  .nav-toggle { display: inline-grid; }
  .sidebar {
    position: fixed; top: var(--nav-h); left: 0; z-index: 95;
    width: 300px; max-width: 86vw; height: calc(100vh - var(--nav-h));
    transform: translateX(-104%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .backdrop { display: block; position: fixed; inset: var(--nav-h) 0 0 0; z-index: 90; background: rgba(0,0,0,.45); }
  .mainnav { display: none; }
  .main, .shell.with-toc .main { padding: 28px 20px 80px; }
}
@media (max-width: 520px) {
  .brand .tag { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }
  .main h1 { font-size: 1.9rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
