/**
 * ajuda-topicos-adm.css
 *
 * Estilização para a página de gerenciamento de Tópicos e Categorias
 * da Central de Ajuda na área administrativa.
 * Preserva a identidade visual do projeto (cores, bordas, espaçamentos).
 */

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #105482;
    --primary-hover: #0d4a73;
    --secondary-color: #6c757d;
    --bg-light: #f8fafc;
    --text-dark: #333333;
    --border-color: #dfe3eb;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --success-border: #bbf7d0;
    --inactive-bg: #f3f4f6;
    --inactive-text: #4b5563;
    --inactive-border: #e5e7eb;
}

/* --- Container Principal --- */
.help-topics-wrapper {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 84, 130, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

/* --- Cabeçalho da Página --- */
.help-topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.help-topics-header h2 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.6rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.help-topics-header h2 i {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* --- Barra de Ferramentas (Busca e Filtros) --- */
.help-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.help-search-input {
    flex: 1;
    min-width: 250px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.5rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.help-search-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 84, 130, 0.15);
}

/* --- Tabela de Tópicos --- */
.help-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.help-table thead th {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    text-align: left;
}

.help-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-dark);
}

.help-table tbody tr:hover {
    background-color: #fdfdfd;
}

.help-table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Componentes da Tabela --- */

/* Badge de Status */
.help-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.help-badge.active {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.help-badge.inactive {
    background-color: var(--inactive-bg);
    color: var(--inactive-text);
    border: 1px solid var(--inactive-border);
}

/* Coluna de Ações */
.help-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.help-btn-action {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 1rem;
}

.help-btn-edit {
    background-color: #0ea5e9; /* Azul claro (info) */
}
.help-btn-edit:hover {
    background-color: #0284c7;
}

.help-btn-delete {
    background-color: #ef4444; /* Vermelho (danger) */
}
.help-btn-delete:hover {
    background-color: #dc2626;
}

/* Preview de Ícone (se houver) */
.help-icon-preview {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
}

/* --- Estilização dos Artigos de Ajuda (Card) --- */
.ajuda-article {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.ajuda-article:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ajuda-article:last-of-type {
    margin-bottom: 0;
}

.ajuda-article h4 {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.ajuda-article p,
.ajuda-article li {
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 0.95rem;
}

.ajuda-article ol {
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.ajuda-article li {
    margin-bottom: 0.75rem;
}



/* --- Responsividade --- */
@media (max-width: 768px) {
    .help-topics-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .help-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    /* Padrão de tabela responsiva */
    .help-table thead {
        display: none;
    }
    
    .help-table tbody, .help-table tr, .help-table td {
        display: block;
        width: 100%;
    }

    .help-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
    }

    .help-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f1f5f9;
    }

    .help-table td:last-child {
        border-bottom: 0;
    }

    .help-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: calc(50% - 2rem);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--primary-color);
        text-transform: uppercase;
        font-size: 0.8rem;
    }

    .help-actions {
        justify-content: flex-end;
    }
}