/* MiaSocial Help Center - unified design system.
   One shared stylesheet for the index (grid+search), the article template,
   and the in-chat article viewer inside Mia's widget. Per-article accent
   color is a CSS variable (--help-accent / --help-accent-soft), not a
   separate theme. All custom properties are namespaced (--help-*) and
   scoped to .help-body/.help-chat-panel (not :root) so this file is safe
   to load inside the main app without colliding with its own theme vars. */

.help-body, .help-chat-panel {
    --help-accent: #6366f1;
    --help-accent-soft: #eef2ff;
    --help-ink: #0f172a;
    --help-muted: #64748b;
    --help-border: #e2e8f0;
    --help-success: #10B981;
    --help-danger: #EF4444;
    --help-warning: #F59E0B;
    --help-body-bg: #F9FAFB;
}

.help-body {
    background: var(--help-body-bg);
    color: var(--help-ink);
}

[dir="rtl"] .help-body { direction: rtl; }

.help-nav {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--help-border);
    z-index: 50;
    padding: 14px 24px;
}
.help-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.help-logo {
    width: 40px; height: 40px; border-radius: 14px;
    background: linear-gradient(135deg, var(--help-accent), #a855f7);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 20px;
    box-shadow: 0 8px 16px -6px rgba(99,102,241,0.35);
    flex-shrink: 0;
}
.help-back {
    font-size: 13px; font-weight: 700; color: var(--help-muted);
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    white-space: nowrap;
}
.help-back:hover { color: var(--help-accent); }

.help-hero {
    padding: 56px 24px 44px;
    background: #fff;
    border-bottom: 1px solid var(--help-border);
    text-align: center;
}
.help-hero-inner { max-width: 720px; margin: 0 auto; }
.help-badge {
    display: inline-block;
    background: var(--help-accent-soft); color: var(--help-accent);
    font-size: 11px; font-weight: 800; padding: 6px 16px;
    border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
}
.help-title {
    font-size: 2rem; font-weight: 900; margin: 16px 0 12px;
    color: var(--help-ink); line-height: 1.25;
}
@media (min-width: 640px) { .help-title { font-size: 2.5rem; } }
.help-subtitle { color: var(--help-muted); font-size: 1.05rem; line-height: 1.6; max-width: 560px; margin: 0 auto; }

/* Search (index page) */
.help-search-wrap { max-width: 520px; margin: 28px auto 0; position: relative; }
.help-search-input {
    width: 100%; padding: 14px 44px; border-radius: 16px;
    border: 1px solid var(--help-border); font-size: 14px; outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.help-search-input:focus { border-color: var(--help-accent); box-shadow: 0 0 0 3px var(--help-accent-soft); }
.help-search-icon { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 16px; color: var(--help-muted); }
.help-search-results {
    position: absolute; top: calc(100% + 8px); inset-inline: 0;
    background: #fff; border: 1px solid var(--help-border); border-radius: 16px;
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.15); overflow: hidden; z-index: 40;
    text-align: start; display: none;
}
.help-search-results.show { display: block; }
.help-search-result {
    display: block; padding: 12px 16px; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--help-border);
}
.help-search-result:last-child { border-bottom: none; }
.help-search-result:hover { background: var(--help-accent-soft); }
.help-search-result-title { font-weight: 700; font-size: 13px; color: var(--help-ink); }
.help-search-result-snippet { font-size: 12px; color: var(--help-muted); margin-top: 2px; }
.help-search-empty { padding: 16px; font-size: 13px; color: var(--help-muted); text-align: center; }

/* Category grid (index page) */
.help-grid {
    max-width: 960px; margin: 0 auto; padding: 44px 24px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px;
}
.help-card {
    background: #fff; border: 1px solid var(--help-border); border-radius: 24px;
    padding: 28px; text-decoration: none; color: inherit; display: block;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.help-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -12px rgba(0,0,0,0.1); }
.help-card-icon {
    width: 48px; height: 48px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    margin-bottom: 22px;
}
.help-card-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.help-card-desc { color: var(--help-muted); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.help-card-cta { font-weight: 700; font-size: 13px; color: var(--help-accent); }
.help-card-cta i { margin-inline-start: 4px; }

/* Article body */
.help-article-main { max-width: 720px; margin: 0 auto; padding: 44px 24px 80px; }

.help-quote {
    background: linear-gradient(135deg, var(--help-accent-soft), #fdf4ff);
    border: 1px solid var(--help-border); border-radius: 24px; padding: 30px;
    margin-bottom: 36px; position: relative;
}
.help-quote-mark { position: absolute; top: 22px; inset-inline-start: 22px; font-size: 2.4rem; color: var(--help-accent); opacity: 0.25; }
.help-quote-body { position: relative; z-index: 1; padding-inline-start: 22px; border-inline-start: 4px solid var(--help-accent); }
.help-quote-body p { font-style: italic; font-weight: 500; color: #334155; line-height: 1.7; margin-bottom: 14px; font-size: 1.05rem; }
.help-quote-body p:last-child { margin-bottom: 0; }
.help-quote-author { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.help-quote-avatar {
    width: 38px; height: 38px; border-radius: 999px; background-size: cover; background-position: center;
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.12); flex-shrink: 0;
}
.help-quote-author-name { font-weight: 800; font-size: 13px; display: block; }
.help-quote-author-role { font-size: 12px; color: var(--help-muted); }

.help-checklist {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 20px;
    padding: 22px 24px; margin-bottom: 32px;
}
.help-checklist h3 { color: #92400e; font-weight: 800; font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.help-checklist ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.help-checklist li { font-size: 13px; color: #78350f; display: flex; align-items: center; gap: 8px; }
.help-checklist li i { color: #d97706; }

.help-section {
    background: #fff; border: 1px solid var(--help-border); border-radius: 24px;
    padding: 30px; margin-bottom: 24px; position: relative; overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.help-section:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(0,0,0,0.08); }
.help-section-bar { position: absolute; top: 0; inset-inline-start: 0; width: 4px; height: 100%; background: var(--help-accent); }
.help-section-inner { display: flex; gap: 16px; align-items: flex-start; }
.help-section-icon {
    width: 34px; height: 34px; border-radius: 999px; background: var(--help-accent-soft); color: var(--help-accent);
    display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; font-size: 14px;
}
.help-section-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.help-section-body { color: #475569; font-size: 14px; line-height: 1.75; }
.help-section-body p { margin-bottom: 12px; }
.help-section-body p:last-child { margin-bottom: 0; }
.help-section-body ul, .help-section-body ol { margin: 10px 0; padding-inline-start: 20px; }
.help-section-body li { margin-bottom: 6px; }
.help-section-body strong { color: #1e293b; }
.help-section-body code { font-family: monospace; background: #F1F5F9; color: #db2777; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

/* Two-up comparison / info cards inside a section body */
.help-grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0; }
@media (min-width: 640px) { .help-grid-2 { grid-template-columns: 1fr 1fr; } }
.help-mini-card { background: #f8fafc; border: 1px solid var(--help-border); border-radius: 14px; padding: 16px; }
.help-mini-card.good { background: #ecfdf5; border-color: #a7f3d0; }
.help-mini-card.bad { background: #fff1f2; border-color: #fecdd3; }
.help-mini-card-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.help-mini-card.good .help-mini-card-label { color: var(--help-success); }
.help-mini-card.bad .help-mini-card-label { color: var(--help-danger); }

.help-callout {
    border-radius: 14px; padding: 14px 16px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
    margin: 14px 0;
}
.help-callout.tip { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.help-callout.warn { background: #fff1f2; border: 1px solid #fecdd3; color: #881337; }
.help-callout i { margin-top: 2px; flex-shrink: 0; }

.help-dark-block {
    background: #0f172a; color: #fff; border-radius: 24px; padding: 30px; margin-bottom: 24px;
    position: relative; overflow: hidden; box-shadow: 0 20px 40px -20px rgba(0,0,0,0.4);
}
.help-dark-block .help-section-icon { background: #1e293b; color: #fff; }
.help-dark-block .help-section-title { color: #fff; }
.help-dark-block .help-section-body { color: #cbd5e1; }
.help-dark-block .help-section-body strong { color: #fff; }
.help-dark-block code { background: rgba(255,255,255,0.08); color: #f472b6; }

/* Troubleshooter */
.help-trouble {
    background: #0f172a; color: #fff; border-radius: 24px; padding: 30px; margin: 32px 0;
}
.help-trouble-title { font-size: 1.4rem; font-weight: 900; display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.help-trouble-icon {
    width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--help-accent), #a855f7);
    display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.help-trouble-sub { color: #94a3b8; font-size: 13px; margin-bottom: 20px; }
.help-trouble-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .help-trouble-grid { grid-template-columns: 1fr 1fr; } }
.help-trouble-btn {
    text-align: start; background: #1e293b; border: 1px solid #334155; border-radius: 14px;
    padding: 14px; font-size: 12px; font-weight: 700; color: #fff; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 8px; transition: background 0.2s;
}
.help-trouble-btn:hover { background: #334155; }
.help-trouble-btn i { color: #64748b; flex-shrink: 0; }
.help-trouble-answer {
    margin-top: 20px; background: rgba(255,255,255,0.06); border: 1px solid #334155; border-radius: 18px;
    padding: 22px; font-size: 13px; display: none;
}
.help-trouble-answer.show { display: block; }
.help-trouble-answer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.help-trouble-answer-title { font-weight: 800; color: var(--help-accent); font-size: 15px; }
.help-trouble-answer-reset { font-size: 11px; color: #94a3b8; background: none; border: none; cursor: pointer; }
.help-trouble-answer-reset:hover { color: #fff; }
.help-trouble-answer-body { color: #cbd5e1; line-height: 1.7; font-size: 13px; }
.help-trouble-answer-body b, .help-trouble-answer-body strong { color: #fff; }
.help-trouble-answer-body code { background: rgba(255,255,255,0.08); color: #f472b6; padding: 2px 6px; border-radius: 4px; }

.help-footer { text-align: center; font-size: 12px; color: var(--help-muted); border-top: 1px solid var(--help-border); padding-top: 28px; margin-top: 32px; }

/* Language switcher (index + article) */
.help-lang-select {
    font-size: 12px; font-weight: 700; color: var(--help-muted); border: 1px solid var(--help-border);
    border-radius: 10px; padding: 6px 10px; background: #fff; cursor: pointer;
}

/* ---- In-chat help viewer (rendered inside Mia's chat widget) ---- */
.help-chat-panel {
    position: absolute; inset: 0; background: #fff; z-index: 30;
    display: none; flex-direction: column;
}
.help-chat-panel.show { display: flex; }
.help-chat-panel-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px;
    border-bottom: 1px solid var(--help-border); flex-shrink: 0;
}
.help-chat-panel-back {
    width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--help-border); background: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--help-ink);
}
.help-chat-panel-title { font-weight: 800; font-size: 13px; flex: 1; }
.help-chat-panel-open {
    font-size: 11px; font-weight: 700; color: var(--help-accent); text-decoration: none; white-space: nowrap;
}
.help-chat-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.help-chat-panel .help-quote { padding: 18px; margin-bottom: 20px; border-radius: 18px; }
.help-chat-panel .help-quote-body p { font-size: 13px; }
.help-chat-panel .help-section { padding: 18px; border-radius: 18px; margin-bottom: 14px; }
.help-chat-panel .help-section-title { font-size: 14px; }
.help-chat-panel .help-section-body { font-size: 12.5px; }
.help-chat-panel .help-trouble { padding: 18px; border-radius: 18px; margin: 20px 0 0; }
.help-chat-panel .help-trouble-title { font-size: 15px; }
