/* ============================================================
   STOCKBELL HELP CENTRE — CSS
   Supports light + dark mode with toggle
   Brand color: #8b5cf6 (purple)
   ============================================================ */

:root {
    --brand:        #8b5cf6;
    --brand-dark:   #7c3aed;
    --brand-light:  #ede9fe;

    --bg:           #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card:      #ffffff;
    --border:       #e5e7eb;
    --text:         #111827;
    --text-secondary: #6b7280;
    --text-muted:   #9ca3af;
    --hero-bg:      #8b5cf6;
    --hero-text:    #ffffff;
    --code-bg:      #f3f4f6;
    --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --radius:       10px;
}

[data-theme="dark"] {
    --bg:           #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card:      #1c1c1c;
    --border:       #2d2d2d;
    --text:         #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted:   #6b7280;
    --hero-bg:      #4c1d95;
    --hero-text:    #ffffff;
    --code-bg:      #1f1f1f;
    --shadow:       0 1px 3px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:           #0f0f0f;
        --bg-secondary: #1a1a1a;
        --bg-card:      #1c1c1c;
        --border:       #2d2d2d;
        --text:         #f9fafb;
        --text-secondary: #9ca3af;
        --text-muted:   #6b7280;
        --hero-bg:      #4c1d95;
        --hero-text:    #ffffff;
        --code-bg:      #1f1f1f;
        --shadow:       0 1px 3px rgba(0,0,0,0.3);
        --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background 0.2s, color 0.2s;
}

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

/* ── Navbar ── */
.help-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.help-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
}

.help-nav-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.help-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.help-nav-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
}

.help-nav-link:hover { color: var(--text); text-decoration: none; }

/* Dark mode toggle */
.help-theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}

.help-theme-toggle:hover { background: var(--border); }
.help-theme-toggle .icon-light { display: inline; }
.help-theme-toggle .icon-dark  { display: none; }
[data-theme="dark"] .help-theme-toggle .icon-light { display: none; }
[data-theme="dark"] .help-theme-toggle .icon-dark  { display: inline; }

/* ── Hero ── */
.help-hero {
    background: var(--hero-bg);
    padding: 64px 24px;
    text-align: center;
}

.help-hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--hero-text);
    margin-bottom: 10px;
}

.help-hero p {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
}

.help-search-wrap { max-width: 560px; margin: 0 auto; }

.help-search-form {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    gap: 8px;
}

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

.help-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: var(--text);
    padding: 8px 0;
}

.help-search-input::placeholder { color: var(--text-muted); }

.help-search-btn {
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 7px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.help-search-btn:hover { background: var(--brand-dark); }

/* ── Container ── */
.help-container { max-width: 1100px; margin: 0 auto; }

/* ── Collections grid ── */
.help-collections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

@media (max-width: 768px) {
    .help-collections { grid-template-columns: 1fr; }
    .help-hero h1 { font-size: 26px; }
}

.help-collection {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    gap: 16px;
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: var(--shadow);
}

.help-collection:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
    text-decoration: none;
}

.help-collection-icon { font-size: 28px; flex-shrink: 0; }

.help-collection-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.help-collection-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.help-collection-count {
    font-size: 12px;
    color: var(--brand);
    font-weight: 500;
}

/* ── Contact strip ── */
.help-contact-strip {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 32px;
}

@media (max-width: 600px) {
    .help-contact-strip { flex-direction: column; align-items: flex-start; }
    .help-contact-divider { display: none; }
}

.help-contact-item { display: flex; align-items: flex-start; gap: 14px; flex: 1; }
.help-contact-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.help-contact-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.help-contact-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.help-contact-link { font-size: 13px; color: var(--brand); font-weight: 500; }
.help-contact-link:hover { text-decoration: underline; }
.help-contact-divider { width: 1px; height: 60px; background: var(--border); flex-shrink: 0; }

/* ── Collection page ── */
.help-collection-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 768px) {
    .help-collection-page { grid-template-columns: 1fr; }
}

/* Sidebar */
.help-sidebar { position: sticky; top: 80px; }

.help-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.help-sidebar-list { list-style: none; }

.help-sidebar-list li { margin-bottom: 2px; }

.help-sidebar-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.1s;
}

.help-sidebar-list a:hover { background: var(--bg-secondary); color: var(--text); }
.help-sidebar-list a.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }

[data-theme="dark"] .help-sidebar-list a.active { background: rgba(139,92,246,0.15); }

/* Article list */
.help-article-list { list-style: none; }

.help-article-list li {
    border-bottom: 1px solid var(--border);
}

.help-article-list li:last-child { border-bottom: none; }

.help-article-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 4px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.1s;
    gap: 12px;
}

.help-article-list a:hover { color: var(--brand); text-decoration: none; }

.help-article-list a svg { flex-shrink: 0; color: var(--text-muted); }

.help-article-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Collection header */
.help-collection-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.help-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.help-breadcrumb a:hover { color: var(--brand); }

.help-collection-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-collection-header p { font-size: 15px; color: var(--text-secondary); }

/* ── Article page ── */
.help-article-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px;
    display: grid;
    grid-template-columns: 260px 1fr 200px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .help-article-page { grid-template-columns: 1fr; }
    .help-toc { display: none; }
}

/* Article content */
.help-article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.help-article-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.3;
}

.help-article-header .help-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.help-article-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 32px 0 12px;
    padding-top: 8px;
}

.help-article-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 8px;
}

.help-article-content p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.help-article-content ul,
.help-article-content ol {
    margin: 0 0 16px 24px;
}

.help-article-content li {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.help-article-content strong { color: var(--text); font-weight: 600; }

.help-article-content code {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: monospace;
    color: var(--brand);
}

.help-article-content pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.help-article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
}

/* Callout boxes */
.help-callout {
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.help-callout-icon { flex-shrink: 0; font-size: 18px; }

.help-callout.info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.help-callout.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.help-callout.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.help-callout.tip     { background: var(--brand-light); border: 1px solid #c4b5fd; color: #5b21b6; }

[data-theme="dark"] .help-callout.info    { background: #1e3a5f; border-color: #2563eb; color: #93c5fd; }
[data-theme="dark"] .help-callout.success { background: #14532d; border-color: #16a34a; color: #86efac; }
[data-theme="dark"] .help-callout.warning { background: #451a03; border-color: #d97706; color: #fcd34d; }
[data-theme="dark"] .help-callout.tip     { background: #2e1065; border-color: #7c3aed; color: #c4b5fd; }

/* Steps */
.help-steps { counter-reset: step; margin-bottom: 24px; }

.help-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    counter-increment: step;
}

.help-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.help-step-content { flex: 1; }
.help-step-content strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.help-step-content p { font-size: 14px; color: var(--text-secondary); margin: 0; }

/* TOC */
.help-toc { position: sticky; top: 80px; }

.help-toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.help-toc-list { list-style: none; }

.help-toc-list li { margin-bottom: 4px; }

.help-toc-list a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 3px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: all 0.1s;
}

.help-toc-list a:hover { color: var(--brand); border-left-color: var(--brand); }
.help-toc-list a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 500; }

/* Article feedback */
.help-feedback {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.help-feedback p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.help-feedback-btns { display: flex; gap: 10px; justify-content: center; }

.help-feedback-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.help-feedback-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── Search results ── */
.help-search-results {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px;
}

.help-search-results h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
}

.help-result-item {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.help-result-item:last-child { border-bottom: none; }

.help-result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 4px;
}

.help-result-title a { color: var(--brand); text-decoration: none; }
.help-result-title a:hover { text-decoration: underline; }

.help-result-excerpt { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.help-result-collection { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ── Footer ── */
.help-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    margin-top: 60px;
}

.help-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.help-footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
}

.help-footer-links {
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.help-footer-links a { color: var(--text-secondary); text-decoration: none; }
.help-footer-links a:hover { color: var(--brand); }

.help-footer-copy { font-size: 12px; color: var(--text-muted); }

/* ── Utilities ── */
.help-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--brand-light);
    color: var(--brand);
}

[data-theme="dark"] .help-badge { background: rgba(139,92,246,0.2); }

img.help-screenshot {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 16px 0;
}