/* File: public/assets/css/style.css */
/* Description: Main stylesheet with BEM conventions. */

/* --- Variáveis Globais --- */
:root {
    --font-primary: 'Open Sans', sans-serif;
    --color-bg: #f4f7fa;
    --color-white: #ffffff;
    --color-sidebar-bg: #2c3e50;
    --color-sidebar-text: #ecf0f1;
    --color-sidebar-hover: #34495e;
    --color-primary: #3498db;
    --color-text: #333;
    --color-error: #e74c3c;
}

/* --- Reset Básico --- */
body, html {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* --- Estrutura de Login --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    display: flex;
    max-width: 900px;
    width: 100%;
    background-color: var(--color-white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.login-container__logo-wrapper {
    flex-basis: 50%;
    background-color: var(--color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container__logo-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--color-white);
}

.login-container__form-wrapper {
    flex-basis: 50%;
    padding: 40px;
}

.form-wrapper__title {
    font-size: 24px;
    margin-bottom: 10px;
}
.form-wrapper__subtitle {
    color: #777;
    margin-bottom: 30px;
}

/* --- Alertas --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
}
.alert--error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* --- Formulários --- */
.form-group {
    margin-bottom: 20px;
}
.form-group__label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}
.form-group__input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Garante que o padding não afete a largura total */
}

/* --- Botões --- */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}
.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    width: 100%;
}

/* --- Layout Principal da App --- */
.app-container {
    display: flex;
}

/* --- Sidebar --- */
.sidebar {
    width: 300px;
    background-color: var(--color-white);
    color: var(--color-sidebar-bg);
    min-height: 100vh;
}
.sidebar__header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #4a627a;
}
.sidebar__logo {
    max-width: 80%;
}
.sidebar__nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav-list__link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--color-sidebar-bg);
    text-decoration: none;
    transition: background-color 0.3s;
}
.nav-list__link i {
    margin-right: 15px;
    width: 20px; /* Alinhamento dos ícones */
    text-align: center;
}
.nav-list__link:hover {
    background-color: var(--color-sidebar-text);
}


/* --- Conteúdo Principal --- */
.main-content {
    flex-grow: 1;
    padding: 30px;
}

.main-content__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.user-menu a {
    color: var(--color-primary);
    text-decoration: none;
    margin-left: 15px;
}

/* --- Cards de Estatísticas --- */
.stats-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.card--stat {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
}
.card__title {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}
.card__value {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}
.card__icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    padding: 15px;
    border-radius: 50%;
    color: var(--color-white);
}
.card__icon--blue { background-color: #3498db; }
.card__icon--green { background-color: #2ecc71; }
.card__icon--orange { background-color: #f39c12; }
.card__icon--red { background-color: #e74c3c; }


/* --- Página de Configurações --- */
.card--settings {
    margin-bottom: 30px;
    padding: 25px;
}

.card__subtitle {
    margin: -5px 0 20px 0;
    font-size: 14px;
    color: #777;
}

.upload-area {
    display: flex;
    align-items: center;
    gap: 30px;
}

.upload-area__preview {
    flex-shrink: 0;
    width: 200px;
    height: 80px;
    border: 2px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    background-color: #f9f9f9;
}

.upload-area__preview--circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.upload-area__preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 'contain' para sidebar, 'cover' para círculo */
}

.upload-area__preview--circle img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.upload-area__input input[type="file"] {
    display: none; /* Escondemos o input padrão */
}

.upload-area__input .filename {
    margin-left: 15px;
    color: #555;
    font-style: italic;
}

.btn--secondary {
    background-color: #ecf0f1;
    color: #333;
    border: 1px solid #bdc3c7;
}

.btn--save-settings {
    min-width: 200px;
}


/* --- Área de Relatórios --- */
.reports-area {
    margin-top: 30px;
}

.card--report {
    background-color: var(--color-white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card--report .card__title {
    font-size: 20px;
}

/* --- Estilos da Tabela --- */
.table-container {
    width: 100%;
    overflow-x: auto; /* Para responsividade em telas pequenas */
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.report-table thead {
    background-color: #f4f7fa;
}

.report-table th, .report-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.report-table th {
    font-weight: 600;
    color: #333;
}

.report-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Alerta de sucesso quando a tabela está vazia */
.alert--success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    display: flex;
    align-items: center;
    gap: 10px;
}



/* --- Formulário de Filtros --- */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.filter-form__group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-form input[type="text"],
.filter-form select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-width: 200px;
}

/* --- Alerta de Info --- */
.alert--info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}


/* --- Paginação --- */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.page-item .page-link {
    padding: 10px 15px;
    display: block;
    color: var(--color-primary);
    background-color: var(--color-white);
    text-decoration: none;
    border: 1px solid #ddd;
    border-left-width: 0;
    transition: background-color 0.3s;
}

.page-item:first-child .page-link {
    border-left-width: 1px;
}

.page-item.active .page-link,
.page-item .page-link:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #e9ecef;
    border-color: #ddd;
}


/* --- Estilos para Ordenação de Tabela --- */
.report-table th a.sort {
    color: inherit;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-table th a.sort .fa-sort {
    color: #ccc;
}

.report-table th a.sort.active,
.report-table th a.sort:hover {
    color: var(--color-primary);
}

.report-table th a.sort.active .fa-sort {
    color: var(--color-primary);
}


/* --- Barra de Progresso --- */
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: .375rem;
    overflow: hidden;
}

.progress-bar {
    height: 24px;
    line-height: 24px;
    background-color: #28a745; /* Verde sucesso */
    color: black;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: width 0.6s ease;
}



/* --- Estilos para Categorias da Sidebar (Versão Final e Corrigida) --- */
.nav-list__category {
    padding: 15px 20px 5px 20px;
    margin-top: 15px; /* Adiciona um espaço acima de cada categoria */
    font-size: 11px;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid #e0e0e0; /* Linha separadora suave */
}

/* Remove a margem e a borda do topo da primeira categoria para alinhar com o item do Dashboard */
.nav-list__item + .nav-list__category {
    margin-top: 15px;
}
ul > .nav-list__category:first-of-type {
    margin-top: 10px;
    border-top: none;
}

/* Regra de recuo para os itens indentados */
.nav-list__item--indented > .nav-list__link {
    padding-left: 35px;
}



.btn--small {
    padding: 5px 10px;
    font-size: 14px;
}



/* --- Cabeçalho do Perfil do Aluno --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 20px;
    background-color: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.profile-header__avatar {
    color: var(--color-primary);
}

.profile-header__info h1 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.profile-header__info p {
    margin: 5px 0;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* --- Layout do Grid de Gráficos do Dashboard --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card--chart {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card--chart-full-width {
    grid-column: 1 / -1; /* Faz este card ocupar a largura total do grid */
}

.chart-container {
    position: relative;
    height: 300px; /* Altura padrão para os gráficos */
    width: 100%;
}

.chart-container--pie {
    height: 300px;
    max-width: 300px; /* Limita o tamanho do gráfico de pizza */
    margin: auto;
}


/* --- Layout do Grid de Gráficos do Dashboard --- */
.charts-grid {
    display: grid;
    /* Cria um grid de 2 colunas, mas permite que um item ocupe a largura total */
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.card--chart {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* Define uma altura mínima para consistência visual */
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.card--chart .card__title {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Faz o card de "Top Cursos" ocupar a largura total do grid */
.card--chart-full-width {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    /* O gráfico vai ocupar todo o espaço restante do card */
    flex-grow: 1;
    width: 100%;
}

/* Ajuste específico para o gráfico de rosca, para não ficar muito grande */
.chart-container--pie {
    max-height: 300px;
    margin: auto;
}


.card__icon--purple { background-color: #8e44ad; }


.btn--export {
    background-color: #1d6f42; /* Verde escuro do Excel */
    color: white;
}


/* --- Filtro Global --- */
.global-filter {
    margin: 0 auto; /* Centraliza o filtro */
}
.global-filter select {
    padding: 8px;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
