/* ═══════════════════════════════════════════════════════════════
   BrainBuzz Help System
   ═══════════════════════════════════════════════════════════════ */

/* ── Help button ──────────────────────────────────────────────── */
.btn-help-guide {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem 1.1rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    background: white;
    border: 1.5px solid var(--bb-primary, #6473df);
    color: var(--bb-primary, #6473df);
}
.btn-help-guide:hover {
    background: var(--bb-primary, #6473df);
    color: white;
}

/* ── Backdrop ─────────────────────────────────────────────────── */
.help-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1040;
}
.help-backdrop.show { display: block; }

/* ── Panel ────────────────────────────────────────────────────── */
.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 600px;
    max-width: 95vw;
    background: white;
    z-index: 1050;
    box-shadow: -4px 0 30px rgba(0,0,0,.15);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
.help-panel.show { transform: translateX(0); }

/* ── Panel header ─────────────────────────────────────────────── */
.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    min-height: 60px;
}
.help-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
    min-width: 0;
}
.help-panel-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.help-panel-title > i {
    color: var(--bb-primary, #6473df);
    flex-shrink: 0;
}
.help-panel-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #9ca3af;
    cursor: pointer;
    padding: .35rem;
    border-radius: .35rem;
    line-height: 1;
    transition: color .15s;
    flex-shrink: 0;
    margin-left: .5rem;
}
.help-panel-close:hover { color: #1e293b; }

/* ── Back button ──────────────────────────────────────────────── */
.help-back-btn {
    background: none;
    border: none;
    color: var(--bb-primary, #6473df);
    cursor: pointer;
    padding: .25rem .4rem;
    border-radius: .35rem;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s;
}
.help-back-btn:hover { background: #f1f5f9; }

/* ── Panel body ───────────────────────────────────────────────── */
.help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

/* ── Search ───────────────────────────────────────────────────── */
.help-search-wrap {
    position: relative;
    margin-bottom: .75rem;
}
.help-search-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: .875rem;
    pointer-events: none;
}
.help-search {
    width: 100%;
    padding: .55rem .75rem .55rem 2.1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: .5rem;
    font-size: .875rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}
.help-search:focus { border-color: var(--bb-primary, #6473df); }

/* ── Menu items ───────────────────────────────────────────────── */
.help-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .85rem 1rem;
    background: white;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
    gap: .75rem;
}
.help-menu-item:first-child { border-top: 1px solid #f3f4f6; }
.help-menu-item:hover { background: #f8fafc; }
.help-menu-item-title {
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}
.help-menu-chevron {
    color: #9ca3af;
    font-size: .8rem;
    flex-shrink: 0;
}

/* ── Empty / no results ───────────────────────────────────────── */
.help-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #9ca3af;
}
.help-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: .5rem;
    color: #d1d5db;
}
.help-empty p { margin: 0; font-size: .875rem; }

/* ── Article content ──────────────────────────────────────────── */
.help-article-content {
    font-size: .875rem;
    color: #374151;
    line-height: 1.7;
}
.help-article-content h2 {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.1rem 0 .3rem !important;
    padding-bottom: .3rem;
    border-bottom: 2px solid var(--bb-primary, #6473df);
}
.help-article-content h2:first-child { margin-top: 0 !important; }
.help-article-content h3 {
    font-size: .875rem;
    font-weight: 700;
    color: #374151;
    margin: .9rem 0 .25rem !important;
}
.help-article-content h4 {
    font-size: .825rem;
    font-weight: 700;
    color: #4b5563;
    margin: .75rem 0 .2rem !important;
}
.help-article-content p {
    margin: 0 0 0 !important;
}
.help-article-content p:empty,
.help-article-content p br:only-child {
    display: none;
}
.help-article-content ul,
.help-article-content ol {
    margin: .25rem 0 .4rem !important;
    padding-left: 1.4rem;
}
.help-article-content li { margin-bottom: .2rem; }
.help-article-content strong { color: #1e293b; }
.help-article-content em { color: #6b7280; }
.help-article-content code {
    font-family: monospace;
    font-size: .82rem;
    background: #f3f4f6;
    color: #374151;
    padding: .1rem .35rem;
    border-radius: .25rem;
}
.help-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
    border: 1px solid #e5e7eb;
    margin: .75rem 0;
    display: block;
}
.help-article-content a {
    color: var(--bb-primary, #6473df);
    text-decoration: underline;
}
.help-article-content a:hover { opacity: .8; }