/* WalletPlatform Developer Portal — light/dark theme via [data-theme]
   on <html>. Sidebar is fixed; main content scrolls. */

:root {
    --docs-sidebar-width: 260px;
    --docs-topbar-height: 56px;
    --docs-bg: #ffffff;
    --docs-sidebar-bg: #f8f9fa;
    --docs-text: #1a1a2e;
    --docs-muted: #6c757d;
    --docs-accent: #7c3aed;
    --docs-accent-soft: rgba(124, 58, 237, .08);
    --docs-code-bg: #1e1e2e;
    --docs-border: #dee2e6;
}

[data-theme="dark"] {
    --docs-bg: #0d1117;
    --docs-sidebar-bg: #161b22;
    --docs-text: #e6edf3;
    --docs-muted: #8b949e;
    --docs-accent: #a78bfa;
    --docs-accent-soft: rgba(167, 139, 250, .12);
    --docs-border: #30363d;
}

body.docs-layout {
    background: var(--docs-bg);
    color: var(--docs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
    margin: 0;
    line-height: 1.6;
}

a { color: var(--docs-accent); }

/* Topbar */
.docs-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--docs-topbar-height);
    background: var(--docs-bg);
    border-bottom: 1px solid var(--docs-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 100;
}
.docs-logo {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--docs-text);
    text-decoration: none;
}
.docs-badge {
    font-size: .7rem;
    background: var(--docs-accent);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: .04em;
}
.docs-base-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8rem;
    color: var(--docs-muted);
}

/* Layout */
.docs-container {
    display: flex;
    margin-top: var(--docs-topbar-height);
    min-height: calc(100vh - var(--docs-topbar-height));
}
.docs-sidebar {
    width: var(--docs-sidebar-width);
    min-width: var(--docs-sidebar-width);
    background: var(--docs-sidebar-bg);
    border-right: 1px solid var(--docs-border);
    padding: 24px 0;
    position: fixed;
    top: var(--docs-topbar-height);
    bottom: 0;
    overflow-y: auto;
}
.docs-nav-section {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--docs-muted);
    padding: 16px 20px 6px;
}
.docs-nav-link {
    display: block;
    padding: 7px 20px;
    color: var(--docs-text);
    text-decoration: none;
    font-size: .9rem;
    border-left: 2px solid transparent;
    transition: all .15s ease;
}
.docs-nav-link:hover,
.docs-nav-link.active {
    color: var(--docs-accent);
    border-left-color: var(--docs-accent);
    background: var(--docs-accent-soft);
}
.docs-content {
    margin-left: var(--docs-sidebar-width);
    flex: 1;
    padding: 48px 56px;
    max-width: 920px;
}
.docs-content h1 { font-size: 2.2rem; font-weight: 700; margin: 0 0 12px; }
.docs-content h2 {
    font-size: 1.4rem; font-weight: 600; margin: 40px 0 12px;
    padding-top: 16px; border-top: 1px solid var(--docs-border);
}
.docs-content h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 8px; }
.docs-content p { margin: 0 0 16px; }
.docs-content .lead { font-size: 1.1rem; color: var(--docs-muted); }
.docs-content code:not(pre code) {
    background: var(--docs-sidebar-bg);
    color: var(--docs-accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .85em;
}

/* Code tabs */
.docs-code-tabs {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--docs-border);
}
.docs-code-tab-bar {
    display: flex;
    background: #2d2d3d;
    padding: 8px 12px 0;
    gap: 4px;
    flex-wrap: wrap;
}
.docs-code-tab {
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 500;
    color: #aaa;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    border: none;
    background: transparent;
    transition: all .15s;
}
.docs-code-tab.active {
    background: var(--docs-code-bg);
    color: #fff;
}
.docs-code-panel {
    display: none;
    background: var(--docs-code-bg);
}
.docs-code-panel.active { display: block; }
.docs-code-panel pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    font-size: .82rem;
    line-height: 1.6;
}

/* HTTP boxes */
.docs-http-example { margin: 24px 0; }
.docs-http-box {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--docs-border);
}
.docs-http-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: .8rem; font-weight: 600;
}
.docs-http-header.request  { background: #14321c; color: #4ade80; }
.docs-http-header.response { background: #1a2a3a; color: #60a5fa; }
.docs-http-header pre { all: unset; }
.method-badge {
    background: #4ade80; color: #06160c;
    padding: 2px 8px; border-radius: 4px;
    font-size: .72rem; font-weight: 700;
}
.method-badge.post   { background: #4ade80; }
.method-badge.get    { background: #60a5fa; color: #07172a; }
.method-badge.patch  { background: #fbbf24; color: #2c1f00; }
.method-badge.delete { background: #f87171; color: #2c0808; }
.docs-http-box pre {
    margin: 0; padding: 16px 18px;
    background: var(--docs-code-bg); color: #e6edf3;
    overflow-x: auto; font-size: .8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    line-height: 1.55;
}

/* Endpoint badge */
.docs-endpoint {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--docs-code-bg); color: #e6edf3;
    padding: 10px 16px; border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .9rem; margin: 12px 0;
}
.docs-endpoint .method { color: #4ade80; font-weight: 700; }

/* Parameter tables */
.docs-params {
    width: 100%; border-collapse: collapse;
    font-size: .88rem; margin: 16px 0 24px;
}
.docs-params th {
    text-align: left; padding: 9px 12px;
    background: var(--docs-sidebar-bg);
    border-bottom: 2px solid var(--docs-border);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--docs-muted);
}
.docs-params td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--docs-border);
    vertical-align: top;
}
.docs-params .param-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--docs-accent);
    font-size: .85rem;
}
.docs-params .param-required {
    font-size: .68rem; color: #ef4444; font-weight: 700; text-transform: uppercase;
}
.docs-params .param-optional {
    font-size: .68rem; color: var(--docs-muted); text-transform: uppercase;
}
.docs-params .param-type {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .78rem; color: #a78bfa;
}

/* Cards on Overview */
.docs-card {
    padding: 22px;
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    height: 100%;
    background: var(--docs-bg);
    transition: border-color .15s;
}
.docs-card:hover { border-color: var(--docs-accent); }
.docs-card h5 { margin: 0 0 8px; font-weight: 600; }
.docs-card p { color: var(--docs-muted); margin: 0 0 12px; font-size: .9rem; }

@@media (max-width: 768px) {
    .docs-sidebar { display: none; }
    .docs-content { margin-left: 0; padding: 24px 18px; }
    .docs-base-url { display: none; }
}

/* ── docs-d1: wp-native Helfer — ersetzen die Bootstrap-Utilities/-Klassen ──────────
   data-ui="wp" liegt auf <body>, damit wp-btn/wp-note auflösen. wp-base bringt dabei
   [data-ui="wp"] a { color: wp-blue } — hier neutralisiert, damit die Docs ihre eigene
   Link-/Nav-Palette behalten. KEIN Eingriff in wp-components (Success-Note ist docs-lokal). */
[data-ui="wp"] a { color: var(--docs-accent); }
[data-ui="wp"] .docs-nav-link { color: var(--docs-text); }

/* Topbar-Aktionsgruppe — ersetzt: ms-auto d-flex gap-2 align-items-center */
.docs-topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* kompakter wp-btn in der Topbar — ersetzt btn-sm; nutzt wp-Tokens (docs-lokaler Modifier) */
[data-ui="wp"] .wp-btn.docs-btn-sm { padding: 4px 10px; font-size: var(--wp-fs-label); }

/* Feature-Grid — ersetzt: row g-4 my-4 + col-md-4 (Index-Feature-Cards) */
.docs-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 24px 0; }

/* Success-Note — docs-LOKAL (kein wp-note--success in wp-components); nutzt wp-Success-Tokens,
   reuse der .wp-note-Basis (flex/padding/radius). Ersetzt: alert alert-success */
[data-ui="wp"] .wp-note.docs-note--success {
    background: var(--wp-success-bg); color: var(--wp-success-text); border-color: var(--wp-success-line);
}

/* Abstand oben — ersetzt: mt-4 */
.docs-mt-4 { margin-top: 1.5rem; }

/* docs-d1: eigenes (korrektes) @media für die migrierten Responsive-Regeln. Das bestehende
   @@media oben ist ein vorbestehender Tippfehler (doppeltes @ in statischer CSS = tote Regel,
   NICHT von d1 verursacht) — separat zu fixen; hier bewusst unangetastet gelassen. */
@media (max-width: 768px) {
    .docs-feature-grid { grid-template-columns: 1fr; }
    .docs-base-url { display: none; }
}
