/* ============================================================
   ZionGames Docs — Site Styles
   Dark gaming aesthetic · Amber accents · Rajdhani headings
   ============================================================ */

:root {
    --bg:           #080810;
    --bg-surface:   #0f0f1a;
    --bg-elevated:  #14142a;
    --border:       #1e1e38;
    --border-light: #252545;
    --accent:       #f59e0b;
    --accent-dim:   #b45309;
    --accent-glow:  rgba(245, 158, 11, 0.15);
    --text:         #dde1f0;
    --text-muted:   #6272a4;
    --text-dim:     #44475a;
    --code-bg:      #0d0d1f;
    --code-border:  #1e1e38;
    --sidebar-w:    260px;
    --topbar-h:     72px;
    --radius:       6px;
    --font-head:    'Rajdhani', sans-serif;
    --font-body:    'Source Serif 4', Georgia, serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}

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

/* ── Topbar ── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: linear-gradient(180deg, rgba(11, 11, 24, 0.96) 0%, rgba(8, 8, 16, 0.93) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    z-index: 100;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(245, 158, 11, 0.22));
}

.brand-name em { color: var(--accent); font-style: normal; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(20, 20, 42, 0.65);
}
.topbar-link {
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 7px 12px;
    border-radius: 999px;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.topbar-link:hover {
    color: var(--text);
    background: var(--bg-elevated);
    text-decoration: none;
}
.topbar-link.active {
    color: #1a1104;
    background: var(--accent);
}
.topbar-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}
.topbar-links a {
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    background: rgba(20, 20, 42, 0.55);
    border-radius: 999px;
    padding: 6px 10px;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.topbar-links a:hover {
    color: var(--text);
    border-color: var(--accent-dim);
    text-decoration: none;
}

/* ── Page shell ── */
.page-shell {
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 24px 0 40px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-nav { padding: 0 8px; }

.nav-group { margin-bottom: 4px; }

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}
.nav-group-title:hover,
.nav-group-title.active {
    color: var(--accent);
    background: var(--accent-glow);
    text-decoration: none;
}
.nav-icon { font-size: 1rem; }

.nav-items {
    list-style: none;
    padding: 2px 0 6px 32px;
    border-left: 1px solid var(--border);
    margin: 0 0 4px 20px;
}
.nav-items li { margin: 1px 0; }
.nav-items a {
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color 0.12s, background 0.12s;
    text-decoration: none;
}
.nav-items a:hover { color: var(--text); background: var(--bg-elevated); }
.nav-items a.active {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 500;
}

/* ── Main content area ── */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: calc(100vh - var(--topbar-h));
    max-width: 860px;
    padding: 48px 48px 80px;
}

/* ── Home hero ── */
.home-hero {
    position: relative;
    padding: 60px 0 48px;
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    top: -60px; left: -80px;
    width: 500px; height: 400px;
    background: radial-gradient(ellipse at center, rgba(245,158,11,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.hero-title {
    font-family: var(--font-head);
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 20px;
}
.hero-title em {
    font-style: normal;
    color: var(--accent);
}
.hero-sub {
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.65;
    margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: var(--accent);
    color: #000;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    border-radius: var(--radius);
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}
.btn-primary:hover { background: #fbbf24; transform: translateY(-1px); text-decoration: none; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border: 1px solid var(--border-light);
    color: var(--text);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    border-radius: var(--radius);
    transition: border-color 0.15s, color 0.15s;
    text-decoration: none;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Section card grid ── */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 56px;
}
.section-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.section-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    text-decoration: none;
    color: var(--text);
}
.card-icon { font-size: 2rem; margin-bottom: 12px; }
.card-title {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 8px;
}
.card-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; flex: 1; }
.card-pages {
    list-style: none;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--text-dim);
}
.card-pages li { padding: 2px 0; }
.more-pages { color: var(--text-dim); font-style: italic; }
.card-cta {
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-top: auto;
}

/* ── Quick links ── */
.quick-links { border-top: 1px solid var(--border); padding-top: 40px; }
.ql-title {
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 8px;
}
.ql-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.ql-grid { display: flex; flex-direction: column; gap: 8px; }
.ql-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.12s;
    text-decoration: none;
}
.ql-item:hover { border-color: var(--accent-dim); text-decoration: none; color: var(--text); }
.ql-icon { font-size: 1.1rem; }
.ql-ext {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 7px;
    border-radius: 3px;
}

/* ── Doc article ── */
.doc-article { max-width: 800px; }

.doc-header { margin-bottom: 32px; }
.doc-breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 12px;
}
.doc-breadcrumb a { color: var(--text-muted); }
.doc-breadcrumb a:hover { color: var(--accent); }
.doc-title {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 8px;
}
.doc-subtitle { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem; }

/* ── Tabs ── */
.doc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}
.tab {
    padding: 8px 14px;
    font-family: var(--font-head);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s, border-color 0.12s;
    text-decoration: none;
    white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Doc content typography ── */
.doc-content h2 {
    font-family: var(--font-head);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    margin: 36px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.doc-content h2:first-child { margin-top: 0; }
.doc-content h3, .doc-content h4 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 10px;
    letter-spacing: 0.03em;
}
.doc-content h3 { font-size: 1.15rem; }
.doc-content h4 { font-size: 0.95rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.doc-content p { margin-bottom: 14px; color: var(--text); }
.doc-content ul, .doc-content ol { margin: 0 0 16px 20px; }
.doc-content li { margin-bottom: 6px; }
.doc-content code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 3px;
    padding: 1px 5px;
    color: #7dd3fc;
}

/* ── Code blocks ── */
.code-block {
    margin: 16px 0 24px;
    border: 1px solid var(--code-border);
    border-radius: 8px;
    overflow: hidden;
}
.code-label {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--code-border);
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}
.code-block pre {
    background: var(--code-bg);
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0;
}
.code-block code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: #a6e3a1;
    font-family: var(--font-mono);
    line-height: 1.65;
}

/* ── Callouts ── */
.callout {
    padding: 14px 18px;
    border-radius: var(--radius);
    border-left: 3px solid;
    margin: 20px 0;
    font-size: 0.9rem;
}
.callout-info {
    background: rgba(96, 165, 250, 0.06);
    border-color: #60a5fa;
    color: #93c5fd;
}
.callout-info a { color: #60a5fa; }
.callout-warn {
    background: rgba(251, 191, 36, 0.06);
    border-color: var(--accent);
    color: #fde68a;
}

/* ── API entries ── */
.api-entry {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 20px 0;
}
.api-class {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #7dd3fc;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.api-tag {
    font-family: var(--font-head);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    padding: 2px 8px;
    border-radius: 3px;
}

/* ── Tables ── */
.api-table-wrap {
    overflow-x: auto;
    margin: 14px 0 20px;
}
.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}
.api-table th {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.api-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.api-table tr:last-child td { border-bottom: none; }
.api-table code { font-size: 0.82em; }

/* ── System cards (overview grid) ── */
.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}
.system-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.system-card h4 {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: 0.03em;
}
.system-card p { font-size: 0.84rem; color: var(--text-muted); margin: 0; }

/* ── Download banner ── */
.download-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: var(--text);
    flex-wrap: wrap;
}
.btn-download {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: var(--accent);
    color: #000;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 4px;
    white-space: nowrap;
    text-decoration: none;
}
.btn-download:hover { background: #fbbf24; text-decoration: none; }

/* ── Badges ── */
.badge-new {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--accent);
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

/* ── Footer ── */
.site-footer {
    margin-left: var(--sidebar-w);
    border-top: 1px solid var(--border);
    padding: 20px 48px;
}
.footer-inner {
    font-size: 0.82rem;
    color: var(--text-dim);
    display: flex;
    gap: 10px;
    align-items: center;
}
.footer-inner a { color: var(--text-dim); }
.footer-inner a:hover { color: var(--accent); }
.footer-sep { color: var(--border-light); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .topbar-inner { padding: 0 14px; }
    .brand { gap: 10px; font-size: 1.05rem; }
    .brand-logo { width: 44px; height: 44px; }
    .topbar-nav { display: none; }
    .topbar-right { gap: 10px; }
    .topbar-links { gap: 6px; }
    .topbar-links a { padding: 5px 8px; font-size: 0.75rem; }
    .sidebar { display: none; }
    .content-area, .site-footer { margin-left: 0; padding: 24px 20px 48px; }
    .section-grid { grid-template-columns: 1fr; }
}
