/* ReadHaven Developer Guide - dark/purple tema (Scalar ile uyumlu) */

:root {
    --bg: #0c0d11;
    --bg-panel: #14161d;
    --bg-elev: #1a1d26;
    --bg-code: #16181f;
    --border: #262a35;
    --border-soft: #1f2330;
    --text: #cbd0da;
    --text-strong: #f3f5f9;
    --text-muted: #868d9c;
    --accent: #8b5cf6;
    --accent-2: #a78bfa;
    --accent-soft: rgba(139, 92, 246, 0.14);
    --green: #34d399;
    --amber: #fbbf24;
    --red: #f87171;
    --blue: #60a5fa;
    --radius: 10px;
    --sidebar-w: 268px;
    --content-max: 880px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    padding: 56px 48px 96px;
}

.content-inner { max-width: var(--content-max); margin: 0 auto; }

/* ---------- Brand ---------- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { color: var(--text-strong); font-weight: 650; font-size: 15px; }
.brand-sub { color: var(--text-muted); font-size: 12px; letter-spacing: 0.3px; }

/* ---------- Nav ---------- */
.nav { padding: 14px 12px; flex: 1; }
.nav-group {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    padding: 16px 12px 6px;
    font-weight: 600;
}
.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
}
.nav-link:hover { background: var(--bg-elev); text-decoration: none; }
.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-2);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--accent);
}
.nav-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 1px 6px;
    border-radius: 20px;
}

/* ---------- Sidebar footer / env chip ---------- */
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border-soft); }
.env-chip {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
}
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; box-shadow: 0 0 8px var(--green); }
.env-chip.env-empty .env-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.env-label { color: var(--text-muted); font-weight: 600; }
.env-url { color: var(--text); font-family: var(--mono); font-size: 11px; word-break: break-all; }

/* ---------- Mobile nav toggle ---------- */
.nav-toggle { display: none; }
.nav-open, .nav-close { display: none; cursor: pointer; user-select: none; }

/* ---------- Typography ---------- */
h1, h2, h3 { color: var(--text-strong); line-height: 1.25; font-weight: 680; }
h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -0.3px; }
h2 { font-size: 21px; margin: 42px 0 14px; padding-top: 8px; }
h3 { font-size: 16px; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.lead { font-size: 17px; color: var(--text); margin-bottom: 22px; }
.eyebrow {
    text-transform: uppercase; letter-spacing: 1px; font-size: 12px;
    font-weight: 700; color: var(--accent-2); margin: 0 0 10px;
}

/* ---------- Code ---------- */
code {
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 1.5px 6px;
    color: #e6c9ff;
}
pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 18px;
    line-height: 1.55;
}
pre code {
    background: none;
    border: none;
    padding: 0;
    color: #d7dce6;
    font-size: 13px;
}
.code-label {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px;
}

/* ---------- Method pills ---------- */
.pill {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 9px;
    border-radius: 6px;
    vertical-align: middle;
}
.pill.get { color: var(--green); background: rgba(52, 211, 153, 0.13); border: 1px solid rgba(52, 211, 153, 0.3); }
.pill.post { color: var(--amber); background: rgba(251, 191, 36, 0.13); border: 1px solid rgba(251, 191, 36, 0.3); }
.pill.auth { color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, 0.3); }
.pill.anon { color: var(--blue); background: rgba(96, 165, 250, 0.13); border: 1px solid rgba(96, 165, 250, 0.3); }

.route { font-family: var(--mono); font-size: 13px; color: var(--text-strong); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { background: var(--bg-elev); color: var(--text-strong); font-weight: 600; font-size: 12.5px; }
tr:last-child td { border-bottom: none; }
td code { font-size: 12px; }

/* ---------- Callouts ---------- */
.callout {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 18px;
    font-size: 14px;
}
.callout.warn { border-left-color: var(--amber); background: rgba(251, 191, 36, 0.09); }
.callout.danger { border-left-color: var(--red); background: rgba(248, 113, 113, 0.09); }
.callout .callout-title { font-weight: 700; color: var(--text-strong); display: block; margin-bottom: 3px; }

/* ---------- Cards / steps ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 22px; }
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: block;
    color: var(--text);
}
a.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); transition: 0.15s; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

.step { display: flex; gap: 16px; margin: 0 0 18px; }
.step-num {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: var(--accent-2);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin-top: 3px; }

/* ---------- Hero ---------- */
.hero {
    background: radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, 0.16) 0%, transparent 55%), var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 34px 32px;
    margin: 0 0 30px;
}
.hero h1 { font-size: 32px; }
.hero p { color: var(--text-muted); font-size: 16px; max-width: 620px; margin-bottom: 0; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: 14px;
    border: 1px solid var(--border);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #7c3aed; text-decoration: none; }
.btn.ghost { color: var(--text-strong); background: var(--bg-elev); }
.btn.ghost:hover { border-color: var(--accent); text-decoration: none; }

.field-list { margin: 0 0 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 50;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }
    .nav-toggle:checked ~ .layout .sidebar { transform: translateX(0); }
    .content { margin-left: 0; padding: 20px 20px 72px; }
    .nav-open {
        display: inline-flex; align-items: center; gap: 8px;
        background: var(--bg-panel); border: 1px solid var(--border);
        border-radius: 8px; padding: 8px 14px; color: var(--text-strong);
        font-size: 14px; margin-bottom: 18px;
    }
    .nav-close { display: inline-flex; margin-left: auto; font-size: 24px; color: var(--text-muted); line-height: 1; }
}
