/* Public API docs in the dashboard's theme (Sneat, as used across ChaosPay):
   navy sidebar with an indigo active item, light grey page, white cards,
   Public Sans. Values are taken from public/assets/css/theme-default.css. */

:root {
    --primary: #696cff;
    --primary-soft: #e7e7ff;
    --primary-shadow: 0 2px 4px 0 rgba(105, 108, 255, .4);
    --success: #71dd37;
    --success-soft: #e8fadf;
    --warning: #ffab00;
    --warning-soft: #fff2d6;
    --danger: #ff3e1d;
    --page: #f5f5f9;
    --card: #ffffff;
    --heading: #566a7f;
    --text: #697a8d;
    --muted: #a1acb8;
    --border: #d9dee3;
    --menu: #233446;
    --menu-text: #c4cdd5;
    --menu-muted: #8592a3;
    --code-bg: #1e2a38;
    --code-head: #253445;
    --code-text: #e6ebf1;
    --code-inline: #e83e8c;
    --card-shadow: 0 2px 6px 0 rgba(67, 89, 113, .12);
    --sidebar-w: 260px;
    --topbar-h: 62px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 20px); }

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font: 400 15px/1.6 "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: #5f61e6; }

code, pre { font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 13px; }

:not(pre) > code {
    color: var(--code-inline);
    background: #fdf1f6;
    padding: 1px 6px;
    border-radius: 4px;
    word-break: break-word;
}

/* ---------- Sidebar (navy, like the dashboard menu) ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    overflow-y: auto;
    background: var(--menu);
    color: var(--menu-text);
    z-index: 40;
    padding-bottom: 40px;
    scrollbar-width: thin;
    scrollbar-color: #3b4c60 transparent;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 20px 14px;
}

.sidebar-brand img { width: 128px; height: auto; }

.sidebar-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
    padding: 3px 12px;
    box-shadow: var(--primary-shadow);
}

.sidebar nav { padding: 0 14px; }

.nav-group {
    margin: 22px 10px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--menu-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-group::after { content: ""; flex: 1; height: 1px; background: rgba(196, 205, 213, .12); }

.sidebar a:not(.sidebar-brand) {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--menu-text);
    font-size: 14px;
    transition: background-color .2s, color .2s;
}

.sidebar a:not(.sidebar-brand):hover { background: rgba(196, 205, 213, .08); color: #fff; }

.sidebar a.active {
    background: var(--primary) !important;
    color: #fff !important;
    box-shadow: var(--primary-shadow);
}

/* ---------- Top navbar (white, detached, beside the menu) ---------- */
.topbar {
    position: fixed;
    top: 12px;
    left: calc(var(--sidebar-w) + 26px);
    right: 26px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: saturate(200%) blur(6px);
    border-radius: 8px;
    box-shadow: 0 0 .375rem .25rem rgba(161, 172, 184, .15);
    z-index: 30;
}

.brand { display: none; align-items: center; gap: 8px; color: var(--heading); font-weight: 700; }
.brand-mark {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    background: var(--primary); color: #fff; font-size: 15px; box-shadow: var(--primary-shadow);
}
.brand-tag { font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; }

.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.version {
    font-size: 12px; font-weight: 600; color: var(--text);
    background: var(--page); border-radius: 6px; padding: 3px 10px;
}

.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.lang-switch a { padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.lang-switch a:hover { color: var(--primary); }
.lang-switch a.active { background: var(--primary); color: #fff; }

.btn-login {
    background: var(--primary);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 .125rem .25rem 0 rgba(105, 108, 255, .4);
    transition: transform .15s, box-shadow .15s;
}

.btn-login:hover { transform: translateY(-1px); box-shadow: 0 .25rem 1rem rgba(105, 108, 255, .45); }

.menu-toggle {
    display: none;
    border: 0; background: var(--page); color: var(--heading);
    width: 38px; height: 38px; border-radius: 8px; font-size: 18px; cursor: pointer;
}

/* ---------- Layout ---------- */
.content {
    margin-left: var(--sidebar-w);
    padding: calc(var(--topbar-h) + 40px) 26px 60px;
    max-width: calc(var(--sidebar-w) + 1060px);
    min-width: 0;
}

/* Every section is a dashboard card. */
section {
    background: var(--card);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 26px 28px;
    margin-bottom: 24px;
}

h1, h2, h3 { color: var(--heading); font-weight: 600; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; font-weight: 700; color: #2b2c40; }
h2 { font-size: 21px; margin: 0 0 14px; }
h3 { margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; color: var(--muted); }
p { margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 34px 32px 30px;
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(105, 108, 255, .14), transparent 70%),
        radial-gradient(400px 200px at 0% 100%, rgba(3, 195, 236, .08), transparent 70%),
        var(--card);
}

.hero-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 14px;
}

.hero .accent {
    background: linear-gradient(90deg, #696cff, #8f57ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead { font-size: 16px; color: var(--text); max-width: 760px; }

.hero-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }

.hero-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.hero-card:hover { transform: translateY(-2px); border-color: transparent; box-shadow: 0 .25rem 1rem rgba(161, 172, 184, .45); color: var(--text); }
.hero-card strong { color: var(--heading); font-size: 15px; font-weight: 600; }
.hero-card span:last-child { font-size: 13.5px; }

.hero-icon {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--primary-soft); color: var(--primary);
    font-size: 21px; margin-bottom: 6px;
}

.hero-card:nth-child(2) .hero-icon { background: var(--success-soft); color: #5cb82a; }
.hero-card:nth-child(3) .hero-icon { background: var(--warning-soft); color: var(--warning); }

/* ---------- Endpoint ---------- */
.endpoint-line {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin: 4px 0 18px;
    background: var(--page); border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.endpoint-line code { background: none; padding: 0; color: var(--heading); font-size: 14px; font-weight: 600; }

.m {
    display: inline-block; min-width: 46px; text-align: center;
    font: 700 11px/1 "Public Sans", sans-serif; letter-spacing: .04em;
    padding: 5px 7px; border-radius: 4px;
}

.m.get { background: var(--success-soft); color: #5cb82a; }
.m.post { background: var(--primary-soft); color: var(--primary); }
.sidebar .m { min-width: 38px; font-size: 10px; padding: 3px 5px; }
.sidebar .m.get { background: rgba(113, 221, 55, .16); color: #8be05a; }
.sidebar .m.post { background: rgba(105, 108, 255, .22); color: #b3b5ff; }
.sidebar a.active .m { background: rgba(255, 255, 255, .22); color: #fff; }

.badge-v2 {
    margin-left: auto; font-size: 12px; font-weight: 600;
    color: #e09b00; background: var(--warning-soft); border-radius: 4px; padding: 3px 9px;
}

.req, .opt { font-size: 12px; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 4px; }
.req { color: var(--danger); background: #ffe5e0; }
.opt { color: var(--muted); background: #f0f2f4; }

/* ---------- Tables (dashboard style) ---------- */
table {
    width: 100%; border-collapse: collapse; margin: 12px 0 18px;
    font-size: 14px; display: block; overflow-x: auto;
}

thead th {
    text-align: left; white-space: nowrap;
    font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--heading); background: #fafbfc;
    padding: 11px 14px; border-bottom: 1px solid var(--border);
}

td { padding: 11px 14px; border-bottom: 1px solid #eceef1; vertical-align: top; }
tbody tr:hover td { background: #fafbff; }
td:first-child { white-space: nowrap; }

/* ---------- Notes ---------- */
.note {
    padding: 12px 16px; border-radius: 6px; font-size: 14px;
    background: var(--primary-soft); color: #5a5dd9;
}

.note a { color: #4b4ec7; font-weight: 600; }

.callout {
    padding: 14px 18px; margin: 16px 0; border-radius: 6px; font-size: 14px;
    background: var(--warning-soft); color: #b77c00;
}

.callout strong { color: #a36f00; }
.callout ul { margin: 8px 0 0; }
.callout :not(pre) > code { background: rgba(255, 255, 255, .6); }

.steps { padding-left: 22px; }
.steps li { margin-bottom: 8px; }
.steps li::marker { color: var(--primary); font-weight: 700; }

/* ---------- Code blocks ---------- */
.code-block {
    margin: 12px 0 18px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--code-bg);
    box-shadow: 0 2px 6px 0 rgba(30, 42, 56, .25);
    min-width: 0;
}

.code-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 10px 0 4px; min-height: 42px;
    background: var(--code-head);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.code-tabs { display: flex; overflow-x: auto; }

.code-tabs button, .copy-btn {
    background: none; border: 0; cursor: pointer;
    color: #9fb0c3; font: 600 13px/1 "Public Sans", sans-serif;
    padding: 14px 12px; white-space: nowrap;
}

.code-tabs button.active { color: #fff; box-shadow: inset 0 -2px 0 var(--primary); }
.code-tabs button:hover { color: #fff; }

.code-label { color: #9fb0c3; font-size: 13px; font-weight: 600; padding: 0 12px; }

.copy-btn {
    padding: 6px 12px; border-radius: 6px; font-size: 12px;
    background: rgba(105, 108, 255, .18); color: #c7c8ff;
}

.copy-btn:hover { background: var(--primary); color: #fff; }

.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--code-text); line-height: 1.6; tab-size: 4; }
.code-block pre code { background: none; padding: 0; color: inherit; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 .code-block { margin: 6px 0; }

.docs-footer { padding: 6px 4px 0; color: var(--muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
    .menu-toggle { display: inline-grid; place-items: center; }
    .brand { display: flex; }
    .topbar { left: 12px; right: 12px; top: 10px; padding: 0 12px; }
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    .sidebar.open { transform: none; }
    .content { margin-left: 0; padding: calc(var(--topbar-h) + 30px) 12px 50px; }
    section { padding: 20px 18px; }
    .hero { padding: 26px 20px; }
    .hero-cards { grid-template-columns: 1fr; }
    h1 { font-size: 27px; }
}

@media (max-width: 575.98px) {
    .version, .brand-tag, .brand-name { display: none; }
    .btn-login { padding: 7px 12px; font-size: 13px; }
}
