/* ==========================================================================
   ESTILOS DAS PÁGINAS MATÉRIAS E MATÉRIA INDIVIDUAL - estilo_materias.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ESTRUTURA GERAL E CONTAINER PRINCIPAL
   -------------------------------------------------------------------------- */
.dic-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
    padding: 20px;
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dic-search-box {
    margin-bottom: 20px;
    text-align: center;
}

.dic-welcome-text {
    flex-grow: 1;
    text-align: center;
}

.dic-search-label strong {
    color: #0073aa;
    font-size: 24px;
    font-weight: bold;
}

.dic-tab-btn.dic-logoff-btn {
    background-color: #f44336;
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    min-width: auto;
    white-space: nowrap;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dic-tab-btn.dic-logoff-btn:hover {
    background-color: #d32f2f;
    color: #ffffff;
}

/* Utilitários gerais */
.txt-center {
    text-align: center !important;
}

/* --------------------------------------------------------------------------
   2. LISTAGEM DE MATÉRIAS (materias.php)
   -------------------------------------------------------------------------- */
.dic-materias-lista-box {
    margin-top: 20px;
}

.dic-materias-titulo {
    font-size: 22px;
    color: #0073aa;
    margin-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.dic-tabela-materias {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.dic-tabela-materias th,
.dic-tabela-materias td {
    border: 1px solid #e5e5e5;
    padding: 10px;
    vertical-align: middle;
    font-size: 14px;
}

.dic-tabela-materias th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
}

.dic-img-thumb-100 {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.dic-img-thumb-100:hover {
    transform: scale(1.03);
}

.dic-link-materia-item {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.dic-link-materia-item:hover {
    color: #0073aa;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. VISUALIZAÇÃO INDIVIDUAL DA MATÉRIA (materia.php)
   -------------------------------------------------------------------------- */
.materia-detalhe-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Imagem principal de 600x600 px */
.materia-imagem {
    text-align: center;
    margin-bottom: 25px;
}

.img-600 {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Título centralizado */
.materia-titulo-detalhe {
    font-size: 28px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.3;
}

/* Conteúdo justificado */
.materia-conteudo {
    font-size: 20px;
    line-height: 1.7;
    color: #006;
    margin-bottom: 30px;
    text-align: justify;
    word-break: break-word;
}

/* CONTAINER DE INTERAÇÕES (FUNDO AMARELO CLARO) */
.materia-bloco-interacoes {
    background-color: #fff888 !important;
    border: 1px solid #ffeeba;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
    margin-bottom: 30px;
}

.materia-interacoes {
    background-color: transparent;
    border: none;
    padding: 0;
    margin-bottom: 25px;
}

.materia-botoes-voto {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-voto {
    padding: 10px 22px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-voto:active {
    transform: scale(0.97);
}

.btn-like {
    background-color: #2e7d32;
    color: #ffffff;
}

.btn-like:hover {
    background-color: #1b5e20;
}

.btn-dislike {
    background-color: #c62828;
    color: #ffffff;
}

.btn-dislike:hover {
    background-color: #b71c1c;
}

.materia-download {
    text-align: center;
    margin-bottom: 20px;
}

.btn-download {
    display: inline-block;
    padding: 12px 20px;
    background-color: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 15px;
    transition: background-color 0.2s;
}

.btn-download:hover {
    background-color: #005177;
    color: #ffffff;
}

/* Campo para deixar a opinião (250 caracteres) */
.materia-form-opiniao {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.materia-form-opiniao h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.materia-form-opiniao textarea {
    width: 100%;
    height: 90px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.materia-form-opiniao textarea:focus {
    border-color: #0073aa;
    outline: none;
}

.btn-enviar-opiniao {
    align-self: center;
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-enviar-opiniao:hover {
    background-color: #005177;
}

/* --------------------------------------------------------------------------
   4. TABELAS DE INFORMAÇÕES/ESTATÍSTICAS DA MATÉRIA
   -------------------------------------------------------------------------- */
.materia-estatisticas,
.materia-lista-opinioes {
    margin-top: 25px;
}

.materia-form-opiniao h3,
.materia-estatisticas h3,
.materia-lista-opinioes h3 {
    font-size: 18px;
    color: #0073aa;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    text-align: center;
}

.tabela-materia-info {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #ffffff;
}

.tabela-materia-info th,
.tabela-materia-info td {
    border: 1px solid #e5e5e5;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

.tabela-materia-info th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
}

/* Espaçamento entre os parágrafos do texto da matéria */
.materia-conteudo p {
    margin-bottom: 18px;
    line-height: 1.7;
}

.materia-conteudo p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVIDADE E BLOCO DE TEXTO
   -------------------------------------------------------------------------- */
.dic-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Container com fundo branco para Título e Texto da Matéria */
.materia-bloco-texto {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
}

/* Ajustes finos do título dentro do bloco */
.materia-bloco-texto .materia-titulo-detalhe {
    font-size: 25px;
    font-weight: bold;
    color: #0073aa;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.3;
}

/* Ajustes finos do conteúdo e parágrafos dentro do bloco */
.materia-bloco-texto .materia-conteudo {
    font-size: 18px;
    line-height: 1.7;
    color: #006;
    margin-bottom: 0;
    text-align: justify;
    word-break: break-word;
}

.materia-bloco-texto .materia-conteudo p {
    margin-bottom: 18px;
}

.materia-bloco-texto .materia-conteudo p:last-child {
    margin-bottom: 0;
}

/* Caixa para a Observação da Matéria */
.materia-observacao-box {
    margin-top: 20px;
    padding: 12px 15px;
    background-color: #fff9e6;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 15px;
    color: #555;
}

.materia-observacao-box strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

/* Estilo para a linha informativa entre o título e o texto da matéria */
.materia-subtitulo-info {
    font-size: 20px;
    font-weight: 600;
    color: #555555;
    text-align: center;
    margin-top: -10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
}

/* Força a tabela de opiniões a respeitar a largura do container */
.tabela-opinioes {
    table-layout: fixed;
    width: 100%;
}

/* Quebra de texto obrigatória para palavras muito longas/sem espaço */
.coluna-opiniao {
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Container responsivo com barra de rolagem se necessário */
.materia-lista-opinioes .dic-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.materia-autor-info {
    text-align: center;
    font-size: 16px;
    font-style: italic;
    color: #666666;
    margin-top: -10px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .dic-container {
        max-width: 100%;
        margin: 0 10px;
        padding: 12px;
    }

    .dic-search-label {
        font-size: 17px;
        padding: 15px;
    }

    .dic-search-label strong {
        font-size: 20px;
    }

    .materia-titulo-detalhe {
        font-size: 20px;
    }

    .materia-botoes-voto {
        flex-direction: column;
    }

    .btn-voto {
        width: 100%;
    }

    .btn-enviar-opiniao {
        width: 100%;
    }

    .dic-tabela-materias,
    .tabela-materia-info {
        font-size: 13px;
    }

    .dic-tabela-materias th, .dic-tabela-materias td,
    .tabela-materia-info th, .tabela-materia-info td {
        padding: 8px 5px;
    }

    .dic-img-thumb-100 {
        width: 70px;
        height: 70px;
    }
}