/* ---------------------------------- */
/* Variáveis Globais de Cor (Temas)   */
/* ---------------------------------- */
:root {
    /* Tema Claro (Padrão) */
    --primary-color: #00843D;
    --primary-text-color: #FFFFFF;
    --background-color: #F5F5F5;
    --surface-color: #FFFFFF;
    --text-color: #333333;
    --text-light-color: #555555;
    --border-color: #e0e0e0;
    --highlight-color: #2A58A3;
    --hover-color: #e9e9e9;
    --active-color: #dbeaff;
}

body.dark-mode {
    /* Tema Escuro */
    --primary-color: #00A950;
    --primary-text-color: #FFFFFF;
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --text-color: #E0E0E0;
    --text-light-color: #bbbbbb;
    --border-color: #444;
    --highlight-color: #5893D4;
    --hover-color: #333333;
    --active-color: #003b7a;
}

/* ---------------------------------- */
/* Estilos Base e Layout Principal    */
/* ---------------------------------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Evita a rolagem do body */
}

/* ================================================= */
/* ESTILOS PARA O CABEÇALHO                          */
/* ================================================= */
header {
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.header-logo-iffar img {
    height: 60px;
    width: auto;
    display: block;
}

.header-title {
    text-align: center;
    flex-grow: 1;
}

.header-title h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 900;
    color: var(--text-color);
}

.dark-mode .header-title h1 {
    color: var(--primary-text-color);
}

.header-title p {
    font-size: 0.9rem;
    margin: 0.25rem 0 0 0;
    color: #4A9C46;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* ---------------------------------- */
/* Barra Lateral (Sidebar)            */
/* ---------------------------------- */

/* Estilos para a Barra de Busca */
.search-container {
    padding: 0 0 1.5rem 0; /* Espaçamento abaixo da busca */
}

#search-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    box-sizing: border-box; /* Garante que padding não afete a largura total */
}

#search-input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 2px var(--active-color);
}

#sidebar {
    width: 350px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

#sidebar a {
    display: block;
    color: var(--text-light-color);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s, color 0.2s;
}

#sidebar a:hover {
    background-color: var(--hover-color);
}

#sidebar a.active {
    background-color: var(--active-color);
    color: var(--highlight-color);
    font-weight: bold;
}

/* ---------------------------------- */
/* Área de Conteúdo                   */
/* ---------------------------------- */
#content-area {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-placeholder {
    text-align: center;
    margin-top: 5rem;
    color: var(--text-light-color);
}

/* A classe .habilidade-content agora é apenas um container simples */
.habilidade-content {
    /* display: flex e gap foram removidos para voltar ao layout de coluna única */
}

.habilidade-content-wrapper h2 { /* Título da Habilidade */
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.coluna {
    min-width: 0;
    padding: 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem; /* Adiciona espaço entre as caixas */
    transition: background-color 0.3s, border-color 0.3s;
    overflow-wrap: break-word;
    text-align: justify;
    hyphens: auto;
}

.coluna h4 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.theme-button, .menu-button {
    padding: 8px 12px;
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
}

.menu-button {
    display: none;
}

/* Estilos para Recursos e Ferramentas */
.coluna h6 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.coluna ul {
    list-style: none;
    padding: 0;
}

.coluna li {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.coluna li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--highlight-color);
}

.dark-mode .coluna li:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.coluna li a {
    text-decoration: none;
    color: var(--highlight-color);
    font-weight: bold;
    font-size: 1.05rem;
}

.coluna li a:hover {
    text-decoration: underline;
}

.recurso-descricao {
    font-size: 0.85rem;
    color: var(--text-light-color);
    margin: 0.3rem 0 0 0;
    line-height: 1.4;
}

/* ================================================= */
/* ESTILOS DAS TAGS RESTAURADOS                      */
/* ================================================= */

.recurso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.recurso-tipo {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.recurso-tipo[data-tipo="Plataforma"] { background-color: #007bff; }
.recurso-tipo[data-tipo="Ferramenta"] { background-color: #28a745; }
.recurso-tipo[data-tipo="Curso"] { background-color: #6f42c1; }
.recurso-tipo[data-tipo="Vídeo"] { background-color: #dc3545; }
.recurso-tipo[data-tipo="Artigo"] { background-color: #6c757d; }
.recurso-tipo[data-tipo="Simulador"] { background-color: #fd7e14; }
.recurso-tipo[data-tipo="Referência"] { background-color: #17a2b8; }
.recurso-tipo[data-tipo="Guia"] { background-color: #ffc107; color: #333; }
.recurso-tipo[data-tipo="Desafio"] {background-color: #1a1a1a; color: #fff; border: 1px solid #fff;}

/* Estilos do Acordeão na Sidebar */
.competencia-accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.competencia-accordion-item:last-child {
    border-bottom: none;
}

.competencia-header {
    width: 100%;
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
    text-align: left;
    padding: 1rem 0.5rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.competencia-header::after {
    content: '+';
    position: absolute;
    right: 0.5rem;
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.2s ease-in-out;
}

.competencia-header[aria-expanded="true"]::after {
    transform: rotate(45deg);
}

.conhecimentos-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 0.5rem;
}

/* Estilos para as Janelas Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light-color);
    cursor: pointer;
}

/* Estilos do Rodapé */
footer {
    background-color: var(--surface-color);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo img {
    height: 35px;
    width: auto;
    display: block;
}

.dark-mode .footer-logo img {
    filter: brightness(0) invert(1);
}

footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light-color);
    white-space: nowrap;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-light-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-nav a:hover {
    color: var(--highlight-color);
    text-decoration: underline;
}

/* ================================================= */
/* RESPONSIVIDADE GERAL                              */
/* ================================================= */
@media (max-width: 900px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .header-logo-iffar { order: 1; }
    .header-title { order: 2; }
    .header-actions { order: 3; width: 100%; justify-content: center; }
    .header-title h1 { font-size: 1.2rem; }
    .header-logo-iffar img { height: 50px; }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        position: relative;
    }
    #sidebar {
        position: absolute;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    #sidebar.visible {
        left: 0;
    }
    #content-area {
        width: 100%;
        padding: 1.5rem;
    }
    .habilidade-content {
        flex-direction: column;
    }
    .menu-button {
        display: block;
    }
    footer {
        flex-direction: column;
        justify-content: center;
        gap: 1.5rem;
    }
    footer p {
        white-space: normal;
        text-align: center;
    }
}

/* ================================================= */
/* ESTILOS PARA A SEÇÃO APRESENTAÇÃO (MODAL)         */
/* ================================================= */

.apresentacao-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.apresentacao-header h2 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.apresentacao-header p {
    font-size: 1rem;
    color: var(--text-light-color);
    max-width: 600px;
    margin: 0 auto;
}

.perfis-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap; /* Permite que os boxes quebrem a linha em telas menores */
}

.perfil-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1; /* Faz com que os boxes tentem ocupar o mesmo espaço */
    min-width: 300px; /* Largura mínima antes de quebrar a linha */
    max-width: 45%;
}

.perfil-foto {
    width: 100px;
    height: 100px;
    border-radius: 50%; /* Deixa a foto redonda */
    object-fit: cover; /* Garante que a foto não fique distorcida */
    border: 3px solid var(--border-color);
}

.perfil-info {
    text-align: left;
}

.perfil-foto {
    width: 120px;
    height: 120px;
    border-radius: 8px; /* Cria as bordas levemente arredondadas */
    object-fit: cover; /* Garante que a foto não fique distorcida */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Adiciona a sombra suave */
    transition: transform 0.2s ease-in-out; /* Efeito suave para o hover */
}

/* Efeito sutil de zoom ao passar o mouse */
.perfil-foto:hover {
    transform: scale(1.05);
}

/* Sombra um pouco mais visível para o tema escuro */
.dark-mode .perfil-foto {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.perfil-info h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 0.25rem 0 0.5rem 0;
}

.perfil-info p {
    font-size: 0.9rem;
    margin: 0;
}

.perfil-links {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.perfil-link-button {
    background-color: var(--highlight-color);
    color: var(--primary-text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.perfil-link-button:hover {
    opacity: 0.85;
}

/* Responsividade para a seção de perfis */
@media (max-width: 768px) {
    .perfis-container {
        flex-direction: column; /* Empilha os boxes verticalmente */
        align-items: center;
    }
    .perfil-box {
        flex-direction: column; /* Empilha foto e texto */
        align-items: center;
        text-align: center;
        max-width: 100%;
    }
    .perfil-info {
        text-align: center;
    }
}

/* style.css */

/* ================================================= */
/* ESTILOS PARA A MODAL DE BOAS-VINDAS               */
/* ================================================= */
.welcome-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.welcome-header h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.welcome-subtitle {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-light-color);
}

.welcome-body h4 {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.welcome-body ul {
    padding-left: 20px;
}

/* ================================================= */
/* ESTILOS PARA O LEITOR DE ARTIGOS INTEGRADO (MODAL)*/
/* ================================================= */

/* Ajusta a modal de leituras para ocupar mais espaço */
.modal-leituras-container {
    display: flex;
    flex-direction: row;
    padding: 0;
    max-width: 90vw;
    width: 1200px;
    height: 80vh;
}

.leituras-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
}

.leituras-sidebar h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.leituras-sidebar h3 { /* Título da Categoria */
    font-size: 1rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#post-navigation a {
    display: block;
    color: var(--text-light-color);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

#post-navigation a:hover {
    background-color: var(--hover-color);
}

#post-navigation a.active {
    background-color: var(--active-color);
    color: var(--highlight-color);
    font-weight: bold;
}

.leituras-content {
    flex-grow: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

.artigo-placeholder {
    display: flex;
    height: 100%;
    justify-content: center;
    align-items: center;
    color: var(--text-light-color);
}

.leituras-content h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 0;
}

.leituras-content .post-body p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.leituras-content .post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ================================================= */
/* ESTILOS ATUALIZADOS PARA A MODAL BIBLIOTECA       */
/* (Substitua as regras de biblioteca antigas)       */
/* ================================================= */

#biblioteca-content {
    margin-top: 1.5rem;
}

.livro-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.livro-capa {
    flex-shrink: 0;
}

.livro-capa img {
    width: 150px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.livro-dados h3 {
    margin: 0 0 0.5rem 0;
    color: var(--highlight-color);
}

.livro-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.livro-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-light-color);
}

.livro-meta li {
    margin-bottom: 0.25rem;
}

/* Responsividade para a biblioteca */
@media (max-width: 600px) {
    .livro-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .livro-dados {
        margin-top: 1rem;
    }
}

.livro-actions {
    margin-top: 1rem;
}

.livro-link-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: opacity 0.2s;
}

.livro-link-button:hover {
    opacity: 0.85;
}