/* ═══════════════════════════════════════════════════════════════════════════
   CENTRAL DE AJUDA, MANUAIS E TUTORIAIS — ATIVA ISP MANAGER
   ═══════════════════════════════════════════════════════════════════════════ */

.help-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
    min-height: 600px;
}

@media (max-width: 1024px) {
    .help-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ── Coluna Esquerda: Lista e Filtros ────────────────────────────────────── */
.help-sidebar-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.help-search-box {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.help-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.help-search-input-wrap i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.help-search-input-wrap input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.help-search-input-wrap input:focus {
    border-color: var(--accent);
}

.help-categories-bar {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.help-cat-btn {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.help-cat-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.help-cat-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.help-docs-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-doc-item {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-doc-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.help-doc-item.active {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 0 1px var(--accent);
}

.help-doc-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

.help-doc-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.help-doc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.help-doc-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Coluna Direita: Leitor de Documentos ─────────────────────────────────── */
.help-reader-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.help-reader-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

@media (max-width: 768px) {
    .help-reader-scroll {
        padding: 20px 16px;
    }
}

.help-reader-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.help-reader-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 8px 0 16px 0;
    line-height: 1.25;
}

.help-reader-actions {
    display: flex;
    gap: 8px;
}

/* ── Markdown Estilizado ─────────────────────────────────────────────────── */
.help-reader-body {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 14px;
}

.help-reader-body h1,
.help-reader-body .help-heading-1 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.help-reader-body h2,
.help-reader-body .help-heading-2 {
    font-size: 18px;
    font-weight: 700;
    margin: 28px 0 12px 0;
    color: var(--text-primary);
}

.help-reader-body h3,
.help-reader-body .help-heading-3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: var(--text-primary);
}

.help-p {
    margin-bottom: 14px;
}

.help-inline-code {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--accent);
}

.help-code-wrap {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #0d1117;
    border: 1px solid var(--border);
}

.help-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.help-code-lang {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #8b949e;
    letter-spacing: 0.05em;
}

.help-code-copy-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.help-code-copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.help-code-wrap pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    color: #e6edf3;
}

.help-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.help-alert i {
    font-size: 18px;
    margin-top: 2px;
}

.help-alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #0891b2;
}

.help-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.help-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.help-quote {
    border-left: 3px solid var(--accent);
    padding: 8px 16px;
    margin: 16px 0;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: 0 6px 6px 0;
}

.help-list {
    padding-left: 24px;
    margin-bottom: 14px;
}

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

.help-table {
    width: 100%;
    margin: 16px 0;
    font-size: 13px;
}

.help-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.help-link {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 500;
}
