/* --- GERAL E LAYOUT --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* --- CABEÇALHO E RODAPÉ --- */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

header nav {
    margin-top: 1rem;
}

nav a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

nav a:hover {
    color: #3498db;
}

/* --- Layout para Rodapé Fixo na Base da Página --- */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
}

/* --- FORMULÁRIO ADMINISTRATIVO (admin.php) --- */
.admin-form-container {
    max-width: 700px;
    margin: auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
}

.admin-form-container h2 {
    text-align: center;
    margin-top: 0;
}

.admin-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.admin-form-container input[type="text"],
.admin-form-container input[type="email"],
.admin-form-container input[type="url"],
.admin-form-container input[type="password"],
.admin-form-container input[type="date"],
.admin-form-container textarea,
.admin-form-container select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Garante que o padding não aumente a largura total */
}

.admin-form-container input[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

.admin-form-container input[type="submit"]:hover {
    background-color: #3498db;
}


















/* --- PÁGINA DE PESQUISADORES (pesquisadores.php) --- */

/* Filtros */
.filtros-linhas {
    margin-bottom: 2.5rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

/* Lista */
.member-row {
    display: flex;
    gap: 20px;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}
.member-row:last-child {
    border-bottom: none;
}

.member-photo {
    flex: 0 0 150px;
    text-align: center;
}

.member-photo img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ecf0f1;
}

.member-info {
    flex: 1;
}

.member-info .bio-text {
    text-align: justify;
}

.member-info h2 {
    margin-top: 0;
    color: #2c3e50;
}

/* Botões de Linha de Pesquisa */
.linhas-container {
    margin-top: 10px;
}

.linha-pesquisa-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    color: white;
    margin-top: 5px;
    margin-right: 5px;
}

.linha-educacao-campo { background-color: #27ae60; }
.linha-ti-educacao    { background-color: #2980b9; }
.linha-outra          { background-color: #e67e22; }

@media (max-width: 600px) {
    .member-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .member-info {
        padding-left: 0;
        margin-top: 1rem;
    }
}

/* --- PÁGINA DE RELATÓRIOS (relatorios.php) --- */
.page-container h2 {
    text-align: center;
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 30px;
}

.year-heading {
    flex-basis: 100%;
    text-align: left;
    border-bottom: 2px solid #3498db;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.year-heading h2 {
    margin: 0;
    font-size: 1.8em;
}

.reports-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.year-group {
    display: contents;
}

.report-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    width: calc(33.333% - 14px);
    display: flex;
    flex-direction: column;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.report-image {
    background-color: #f8f9fa;
}

.report-image img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

.report-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.report-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    min-height: 60px;
}

.link-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.link-btn:hover {
    background-color: #3498db;
}

@media (max-width: 900px) {
    .report-card {
        width: calc(50% - 10px);
    }
}
@media (max-width: 600px) {
    .report-card {
        width: 100%;
    }
}




/* --- PÁGINA DE PRODUÇÕES (FILTROS) --- */
.filtros-producoes { background-color:#f8f9fa; padding: 10px; border-radius: 8px; margin-bottom: 20px; }
.filtros-producoes h2 { margin-top: 0; text-align: center; }
.filter-section { text-align: center; padding: 10px 0; border-bottom: 1px solid #e9ecef;}
.filter-section:last-child { border-bottom: none; }






/* REGRA GERAL PARA TODOS OS BOTÕES DE FILTRO (MODIFICADO) */
.filtro-btn {
    display: inline-block;
    padding: 5px 12px; /* Reduzido */
    margin: 3px 4px;   /* Reduzido */
    border: 1px solid #bdc3c7;
    border-radius: 15px;
    text-decoration: none;
    color: #34495e;
    background-color: #fff;
    font-size: 0.9em; /* Reduzido */
    transition: all 0.2s;
}

.filtro-btn:hover {
    background-color: #ecf0f1;
    border-color: #3498db;
}

.filtro-btn.active {
    background-color: #3498db;
    color: #fff;
    border-color: #2980b9;
    font-weight: bold;
}

/* Estilos específicos para botões de Autor e Keyword (apenas cores agora) */
.author-cloud, .keyword-cloud {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 5px 8px; /* Espaçamento entre os botões */
    padding: 10px 0;
}
.author-cloud strong, .keyword-cloud strong {
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.author-btn {
    background-color: #e9f5ff;
    border-color: #aed6f1;
    color: #2980b9;
}
.author-btn:hover { background-color: #d4e6f1 !important; }
.author-btn.active { background-color: #2980b9 !important; color: white !important; }

/* Card de Publicação (sem alterações) */
.publication-card { background: #fff; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; margin-bottom: 30px; box-shadow: 0 4px 8px rgba(0,0,0,0.08); transition: all 0.3s ease; }
.publication-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.12); }
.publication-cover img { max-width: 150px !important; height: auto !important; border: 1px solid #ddd; border-radius: 4px; margin-top: 15px; display: block; margin-left: auto; margin-right: auto; }
.publication-type { background-color: #e67e22; color: white; padding: 4px 10px; border-radius: 15px; font-size: 0.8em; font-weight: bold; display: inline-block; }
.publication-card h3 { margin-top: 15px; margin-bottom: 10px; }
.publication-meta { font-size: 0.9em; color: #6c757d; margin-bottom: 15px; }

/* --- PÁGINA DE NOVIDADES (novidades.php) --- */
.news-layout { display: flex; gap: 30px; }
.main-content { flex: 3; }
.sidebar { flex: 1; background-color: #f8f9fa; padding: 20px; border-radius: 8px; height: fit-content; }
.sidebar h4 { margin-top: 0; border-bottom: 2px solid #3498db; padding-bottom: 10px; }
.post-summary { display: flex; gap: 20px; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid #eee; }
.summary-image { flex: 0 0 200px; }
.summary-image img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; }
.summary-content h3 a { text-decoration: none; color: #2c3e50; }
.summary-content h3 a:hover { color: #3498db; }
.post-meta { font-size: 0.9em; color: #7f8c8d; }
.link-btn-small { display: inline-block; padding: 5px 12px; font-size: 0.9em; background: #eee; color: #333; text-decoration: none; border-radius: 4px; }
.full-post h1 { font-size: 2.5em; }
.full-post-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.post-body { font-size: 1.1em; line-height: 1.7; text-align: justify; }
.post-sources-container { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.post-sources-button { display: inline-block; padding: 10px 25px; background-color: #27ae60; color: white; text-decoration: none; border-radius: 5px; font-weight: bold; text-align: center; transition: background-color 0.3s; }
.post-sources-button:hover { background-color: #2ecc71; }
.author-summary { background: #f8f9fa; padding: 15px; margin-top: 20px; font-style: italic; text-align: justify; border-left: 3px solid #7f8c8d; }
.sidebar-post { display: flex; gap: 15px; margin-bottom: 15px; }
.sidebar-thumb { flex: 0 0 60px; }
.sidebar-thumb img { width: 100%; height: 60px; object-fit: cover; border-radius: 4px; }
.sidebar-info h5 { margin: 0 0 5px 0; }
.sidebar-info h5 a { text-decoration: none; color: #333; font-weight: bold; }
.sidebar-info h5 a:hover { text-decoration: underline; }
.sidebar-info small { color: #7f8c8d; }
.citation-box { margin-top: 30px; padding: 15px; background-color: #e9ecef; border-radius: 8px; border: 1px solid #dee2e6; }
.citation-box h4 { margin-top: 0; margin-bottom: 10px; color: #343a40; border-bottom: 1px solid #ccc; padding-bottom: 10px; }
.citation-box .citation-text { font-family: 'Times New Roman', Times, serif; font-size: 0.95em; line-height: 1.5; color: #212529; user-select: all; -webkit-user-select: all; -moz-user-select: all; }
@media (max-width: 800px) { .news-layout { flex-direction: column-reverse; } }

/* --- SEÇÃO DE COMENTÁRIOS --- */
.comments-section { margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee; }
.comment-item { padding: 15px; border-bottom: 1px solid #f0f0f0; }
.comment-item:last-child { border-bottom: none; }
.comment-item p { margin: 5px 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea { width: 100%; padding: 15px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 1.1em; }
.comment-form textarea { min-height: 150px; }
.comment-form input[type="submit"] { padding: 10px 20px; background-color: #2980b9; color: white; border: none; border-radius: 4px; cursor: pointer; }
.comment-success-message { padding: 15px; background-color: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; border-radius: 4px; }

/* --- TABELA E DASHBOARD DE ADMINISTRAÇÃO --- */
.admin-container { max-width: 800px; margin: auto; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { border: 1px solid #ddd; padding: 12px; text-align: left; }
.admin-table th { background-color: #f2f2f2; }
.admin-button { color: white; text-decoration: none; padding: 8px 12px; border-radius: 4px; font-size: 0.9em; margin-right: 5px; }
.admin-button.add-new { background-color: #27ae60; display: inline-block; margin-bottom: 20px; }
.admin-button.edit { background-color: #2980b9; }
.admin-button.delete { 
    background-color: #c0392b; 
    margin-left: 15px; /* ADICIONADO: Espaçamento extra para o botão excluir */
}
.dashboard-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 30px; }
.summary-box { display: block; background-color: #ecf0f1; color: #2c3e50; padding: 20px; border-radius: 8px; text-align: center; text-decoration: none; border-left: 5px solid #3498db; transition: all 0.3s; }
.summary-box:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-color: #2980b9; }
.summary-box .count { display: block; font-size: 3em; font-weight: bold; }
.summary-box .label { display: block; font-size: 1em; margin-top: 10px; }
.dashboard-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.dashboard-link { display: block; padding: 30px; background-color: #2980b9; color: white; text-align: center; text-decoration: none; font-size: 1.2em; border-radius: 8px; transition: all 0.3s; }
.dashboard-link:hover { background-color: #3498db; transform: translateY(-5px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* --- AJUSTES DE LAYOUT PARA TELAS GRANDES (Admin Panel) --- */
@media (min-width: 1200px) {
    .admin-container {
        max-width: 1100px;
    }
    .dashboard-summary {
        grid-template-columns: repeat(4, 1fr);
    }
    .dashboard-links {
        grid-template-columns: repeat(2, 1fr);
    }
}