:root {
    /* Font: Ubuntu Mono (narrow mono) cocok dengan lebar karakter di screenshot.
       Kalau terasa terlalu kecil, ganti urutan jadi 'JetBrains Mono' dulu dan naikkan ukuran ~20%. */
    --font: 'Ubuntu Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --bg: #f8fafc;
    --surface: #ffffff;
    --ink: #0f172a;
    --text: #334155;
    --desc: #64748b;
    --muted: #94a3b8;

    --line: #e2e8f0;          /* border tipis card, search, row */
    --line-strong: #cbd5e1;   /* border tombol & input */
    --hero-border: #1e293b;   /* hanya hero image yang border-nya gelap */
    --badge: #374151;         /* badge GET */
    --panel: #f8fafc;
    --ink-hover: #1e293b;     /* hover tombol utama */
    --on-ink: #ffffff;        /* teks di atas background --ink */
    --danger: #8b2f2f;

    --radius: 0px;

    color-scheme: light;
}

/* ---------- Dark mode (class "dark" di <html>) ---------- */
html.dark {
    --bg: #0b1120;
    --surface: #111a2e;
    --ink: #e2e8f0;
    --text: #cbd5e1;
    --desc: #94a3b8;
    --muted: #64748b;

    --line: #1e293b;
    --line-strong: #334155;
    --hero-border: #475569;
    --badge: #475569;
    --panel: #0f1829;
    --ink-hover: #f8fafc;
    --on-ink: #0b1120;
    --danger: #f87171;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
    border-radius: var(--radius);
}

html {
    background: var(--bg);
}

html, body {
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 100% 0%, color-mix(in srgb, var(--surface) 90%, transparent) 0%, transparent 70%),
        var(--bg);
}

a { color: var(--ink); }

::placeholder {
    color: var(--muted);
    opacity: 1;
}

.page { min-height: 100vh; }

.wrap {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ---------- Topbar ---------- */
.topbar {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

.brand {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
}

.toplinks {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--desc);
}

.toplinks a { text-decoration: none; color: inherit; }
.toplinks a:hover { color: var(--ink); }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    cursor: pointer;
}

.theme-toggle:hover { background: var(--bg); }
.theme-toggle .ico-moon { display: none; }
html.dark .theme-toggle .ico-sun { display: none; }
html.dark .theme-toggle .ico-moon { display: inline; }

.content {
    padding-top: 42px;
    padding-bottom: 48px;
}

.loading {
    padding: 24px 0;
    color: var(--desc);
    font-size: 13px;
}

/* ---------- Hero ---------- */
.hero {
    padding: 0;
    border: 0;
}

.hero-banner {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 1;
    max-height: 200px;
    height: auto;
    object-fit: cover;
    border: 1px solid var(--hero-border);
    margin-bottom: 24px;
}

.eyebrow {
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 12px;
}

.title {
    display: inline-block;           /* garis bawah selebar teks judul */
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ink);
}

.subtitle {
    margin: 0 0 18px 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.hero-links {
    margin: 0;
    font-size: 13px;
}

.hero-links a {
    display: block;
    width: fit-content;
    margin-top: 4px;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* ---------- Search ---------- */
.searchbar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 55px;
    padding: 0 16px 0 22px;
    margin: 28px 0 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.searchbar:focus-within {
    border-color: var(--ink);
}

.search-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--muted);
}

.searchbar input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}

/* ---------- Category (accordion card) ---------- */
.api-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category {
    border: 1px solid var(--line);
    background: var(--surface);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 49px;
    padding: 0 20px 0 18px;
    cursor: pointer;
    background: var(--surface);
    user-select: none;
}

.category-header:hover { background: var(--bg); }

.folder-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 12px;
    color: var(--ink);
}

.category-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--ink);
}

.count-badge {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--desc);
    background: none;
    border: 0;
    padding: 0;
}

.chevron {
    display: inline-flex;
    margin-left: auto;
    color: var(--ink);
    transition: transform 0.15s ease;
}

.category.open > .category-header .chevron {
    transform: rotate(180deg);
}

.category-body {
    display: none;
    border-top: 1px solid var(--line);
}

.category.open > .category-body {
    display: block;
}

/* ---------- Endpoint row ---------- */
.endpoint {
    border-top: 1px solid var(--line);
}

.endpoint:first-child {
    border-top: none;
}

.endpoint-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 57px;
    padding: 0 20px 0 16px;
    cursor: pointer;
    background: var(--surface);
}

.endpoint-row:hover { background: var(--bg); }

.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 39px;
    height: 23px;
    padding: 0 8px;
    background: var(--badge);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 0;
    white-space: nowrap;
}

.endpoint-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.endpoint-path {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.endpoint-desc {
    display: block;
    font-size: 11px;
    color: var(--desc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.endpoint-arrow {
    display: inline-flex;
    flex-shrink: 0;
    margin-left: 4px;
    color: var(--ink);
    transition: transform 0.15s ease;
}

.endpoint.open .endpoint-arrow {
    transform: rotate(180deg);
}

/* ---------- Endpoint detail ---------- */
.endpoint-detail {
    display: none;
    padding: 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.endpoint.open .endpoint-detail { display: block; }

.endpoint-detail > p {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 12px;
}

.detail-section { margin-bottom: 14px; }

.detail-label {
    font-size: 11px;
    color: var(--desc);
    margin-bottom: 6px;
    font-weight: 700;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
}

.params-table th,
.params-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
    font-size: 12px;
}

.params-table th {
    background: var(--panel);
    font-size: 11px;
    color: var(--desc);
    font-weight: 700;
}

.params-table tr:last-child td { border-bottom: none; }

.param-name { font-weight: 700; color: var(--ink); }
.param-req { font-size: 11px; color: var(--danger); }
.param-opt { font-size: 11px; color: var(--desc); }

.code-block {
    margin: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 10px;
    overflow-x: auto;
    white-space: pre;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink);
}

.button-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    padding: 7px 14px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.btn:hover { background: var(--bg); }

.btn-primary {
    background: var(--ink);
    color: var(--on-ink);
    border-color: var(--ink);
}

.btn-primary:hover {
    background: var(--ink-hover);
    border-color: var(--ink-hover);
}

.btn:disabled { opacity: 0.6; cursor: wait; }

.try-panel {
    display: none;
    margin-top: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 12px;
}

.endpoint.open .try-panel.open { display: block; }

.try-panel .code-block,
.try-panel .btn { margin-top: 10px; }

.try-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.try-inputs input,
.try-textarea {
    flex: 1;
    min-width: 160px;
    border: 1px solid var(--line-strong);
    padding: 7px 9px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    outline: none;
}

.try-inputs input:focus,
.try-textarea:focus { border-color: var(--ink); }

.try-textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    margin-top: 8px;
}

.terminal {
    display: none;
    margin-top: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 10px;
    font-size: 12px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: var(--ink);
    color: var(--on-ink);
    padding: 8px 12px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Footer (berisi statistik + Base URL) ---------- */
.footer {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.footer > * + * { margin-top: 12px; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--desc);
    font-size: 12px;
}

.baseurl {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px solid var(--line);
    padding: 10px 12px;
    background: var(--surface);
}

.baseurl-label {
    font-size: 11px;
    color: var(--desc);
    font-weight: 700;
}

.baseurl code {
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    word-break: break-all;
}

.copy-btn {
    margin-left: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    padding: 3px 10px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    color: var(--ink);
}

.copy-btn:hover { background: var(--bg); }

/* ---------- Responsive ---------- */
@media (max-width: 360px) {
    .wrap { padding: 0 20px; }
    .title { font-size: 26px; }
}
@media (min-width: 901px) {
  html, body { font-size: 15px; }
  :root { --line: #cbd5e1; --line-strong: #94a3b8; }
  html.dark { --line: #334155; --line-strong: #475569; }
}

