/* ═══════════════════════════════════════════════════════════
   Help Center — Documentation, guides & FAQ
   ═══════════════════════════════════════════════════════════ */

.help-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.help-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.help-modal {
    width: min(960px, 94vw);
    height: min(80vh, 700px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

.help-overlay.show .help-modal {
    transform: scale(1) translateY(0);
}

/* ── Header ── */
.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.help-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-header-icon {
    font-size: 1.4rem;
    color: #6366f1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 12px;
}

.help-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.help-header-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 1px;
}

.help-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-btn-welcome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.help-btn-welcome:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
}

.help-btn-welcome i {
    font-size: 0.85rem;
}

.help-close-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.help-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ── Search Bar ── */
.help-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    position: relative;
}

.help-search-icon {
    color: #64748b;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.help-search-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.help-search-input::placeholder {
    color: #475569;
}

.help-search-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.help-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 1rem;
    flex-shrink: 0;
}

.help-search-clear:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}

.help-search-hints {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.help-search-hint {
    font-size: 0.7rem;
    color: #475569;
}

.help-search-hint kbd {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: inherit;
    font-size: 0.7rem;
    color: #64748b;
}

/* ── Body ── */
.help-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar (Categories) ── */
.help-sidebar {
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.help-cat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
}

.help-cat-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.help-cat-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 600;
}

.help-cat-btn i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.help-cat-btn span {
    flex: 1;
}

.help-cat-count {
    font-size: 0.7rem;
    color: #475569;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 7px;
    border-radius: 20px;
    flex: none;
    min-width: 20px;
    text-align: center;
}

.help-cat-btn.active .help-cat-count {
    background: rgba(255, 255, 255, 0.08);
    color: #64748b;
}

/* ── Content Area ── */
.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* ── Welcome Screen ── */
.help-welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100%;
    padding: 40px 20px;
}

.help-welcome-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    margin-bottom: 20px;
    font-size: 2rem;
    color: #6366f1;
}

.help-welcome-screen h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.help-welcome-screen > p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 28px 0;
    max-width: 440px;
    line-height: 1.5;
}

.help-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
}

.help-quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
}

.help-quick-link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.help-quick-link i {
    font-size: 1rem;
}

.help-welcome-search-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 0.8rem;
}

.help-welcome-search-hint i {
    opacity: 0.6;
    animation: help-bounce-up 2s ease-in-out infinite;
}

@keyframes help-bounce-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ── Category View ── */
.help-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.help-category-header i {
    font-size: 1.5rem;
}

.help-category-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.help-category-desc {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 20px 0;
}

.help-article-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-article-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
    width: 100%;
}

.help-article-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.help-article-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.help-article-card-info {
    flex: 1;
    min-width: 0;
}

.help-article-card-info strong {
    display: block;
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 3px;
    font-weight: 600;
}

.help-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: #64748b;
    font-size: 0.68rem;
    margin-right: 4px;
    font-weight: 500;
}

/* ── Article View ── */
.help-article-view {
    max-width: 700px;
}

.help-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.help-back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

/* ── Article Content ── */
.help-article-body {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.7;
}

.help-article-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.help-article-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 24px 0 10px 0;
}

.help-article-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 18px 0 8px 0;
}

.help-article-body p {
    margin: 0 0 14px 0;
}

.help-article-body ul,
.help-article-body ol {
    margin: 0 0 14px 0;
    padding-left: 22px;
}

.help-article-body li {
    margin-bottom: 6px;
}

.help-article-body li strong {
    color: #e2e8f0;
}

.help-article-body a {
    color: #818cf8;
    text-decoration: none;
}

.help-article-body a:hover {
    text-decoration: underline;
}

.help-article-body kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: inherit;
    font-size: 0.8rem;
    color: #e2e8f0;
    margin: 0 2px;
    line-height: 1.4;
}

.help-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    margin: 18px 0;
    color: #a5b4fc;
    font-size: 0.85rem;
    line-height: 1.5;
}

.help-tip i {
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.help-tip strong {
    color: #c7d2fe;
}

/* ── Feature Grid (Interface Tour) ── */
.help-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}

.help-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.help-feature-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.help-feature-item strong {
    display: block;
    color: #e2e8f0;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.help-feature-item span {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ── Shortcuts Grid ── */
.help-shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 16px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.help-shortcuts-grid div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.82rem;
    padding: 4px 0;
}

.help-shortcuts-grid kbd {
    flex-shrink: 0;
}

/* ── FAQ Items ── */
.help-faq-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.help-faq-item h4 {
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.help-faq-item p,
.help-faq-item ul {
    margin: 0;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.6;
}

.help-faq-item ul {
    padding-left: 18px;
}

.help-faq-item li {
    margin-bottom: 4px;
}

/* ── Article Footer ── */
.help-article-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.help-article-tags {
    margin-bottom: 16px;
}

.help-related-articles {
    margin-top: 12px;
}

.help-related-articles strong {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.help-related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.help-related-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.8rem;
}

.help-related-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── Search Results ── */
.help-search-results-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.help-search-results-header strong {
    color: #e2e8f0;
}

.help-search-group {
    margin-bottom: 20px;
}

.help-search-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.help-search-group-title i {
    font-size: 0.9rem;
}

.help-search-result {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
    margin-bottom: 4px;
}

.help-search-result:hover {
    background: rgba(255, 255, 255, 0.05);
}

.help-search-result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.help-search-result-title i {
    font-size: 0.85rem;
}

.help-search-result-snippet {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.5;
    margin-left: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Search Empty ── */
.help-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 300px;
    padding: 40px 20px;
}

.help-search-empty h3 {
    color: #94a3b8;
    font-size: 1.1rem;
    margin: 16px 0 6px 0;
}

.help-search-empty p {
    color: #475569;
    font-size: 0.85rem;
    margin: 0;
}

/* ── Scrollbar ── */
.help-sidebar::-webkit-scrollbar,
.help-content::-webkit-scrollbar {
    width: 4px;
}

.help-sidebar::-webkit-scrollbar-track,
.help-content::-webkit-scrollbar-track {
    background: transparent;
}

.help-sidebar::-webkit-scrollbar-thumb,
.help-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.help-sidebar::-webkit-scrollbar-thumb:hover,
.help-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .help-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: none;
    }

    .help-sidebar {
        width: 180px;
        padding: 8px;
    }

    .help-content {
        padding: 16px;
    }

    .help-feature-grid {
        grid-template-columns: 1fr;
    }

    .help-shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .help-search-hints {
        display: none;
    }

    .help-header-subtitle {
        display: none;
    }

    .help-btn-welcome span {
        display: none;
    }
}
