/* ======================================================= */
/* --- LAYOUT DA ÁREA DO ASSOCIADO (MENU LATERAL) --- */
/* ======================================================= */

.main-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--cor-container);
    position: sticky;
    top: 0;
    box-shadow: 0 2px 5px var(--cor-sombra);
    z-index: 999;
}

.sidebar-toggle {
    font-size: 1.5em; background: transparent; border: none;
    color: var(--cor-texto); cursor: pointer; padding: 0 15px 0 0;
}

.header-title {
    flex-grow: 1; text-align: center;
    /* Ajuste para centralizar o título na tela compensando o botão */
    padding-right: 45px;
}

.header-title h1 { margin: 0; font-size: 1.4em; display: inline-block; }

/* Menu Lateral (Sidebar) */
.sidebar {
    height: 100%; width: 280px; position: fixed; z-index: 1002; top: 0;
    left: -280px; /* Começa escondido */
    background-color: var(--cor-container);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease-in-out;
    display: flex; flex-direction: column;
}
.sidebar.active { left: 0; }

.sidebar-header { padding: 15px 20px; border-bottom: 1px solid var(--cor-borda); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { margin: 0; }
.sidebar-close { background: none; border: none; font-size: 2em; cursor: pointer; color: var(--cor-texto-claro); }

.sidebar-profile { padding: 20px; text-align: center; border-bottom: 1px solid var(--cor-borda); }
.sidebar-profile .profile-pic-small { width: 80px; height: 80px; margin: 0 auto 10px auto; border-radius: 50%; object-fit: cover; border: 3px solid var(--cor-primaria); }
.sidebar-profile span { display: block; color: var(--cor-texto-claro); }
.sidebar-profile strong { font-size: 1.2em; }

.sidebar-menu { list-style: none; padding: 10px 0; margin: 0; flex-grow: 1; overflow-y: auto; }
.sidebar-menu li a { display: flex; align-items: center; gap: 15px; padding: 16px 20px; text-decoration: none; color: var(--cor-texto-claro); font-weight: 500; border-left: 4px solid transparent; transition: all 0.2s ease; }
.sidebar-menu li a:hover { background-color: #f8f9fa; }
.sidebar-menu li a.active { background-color: #fffbeb; color: var(--cor-primaria-hover); font-weight: bold; border-left-color: var(--cor-primaria); }
.sidebar-menu li a i { width: 20px; text-align: center; font-size: 1.1em; }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--cor-borda); }
.sidebar-footer .btn { width: 100%; }

/* Conteúdo Principal e Overlay */
.main-content { transition: margin-left 0.3s ease-in-out; padding-top: 20px; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 1001; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.overlay.active { opacity: 1; visibility: visible; }

/* Seções e Componentes da Página */
.info-section { border: 1px solid var(--cor-borda); border-radius: 12px; padding: 20px; margin-bottom: 25px; }
.info-section legend { padding: 0 10px; margin-left: 10px; font-size: 1.3em; font-weight: 600; color: var(--cor-primaria-hover); }
.info-section legend i { margin-right: 8px; }

.page-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.page-actions .btn { flex-direction: column; padding: 20px; font-size: 1em; height: 100px; background-color: var(--cor-container); color: var(--cor-texto); border: 1px solid var(--cor-borda); font-weight: 500; }
.page-actions .btn:hover { background-color: var(--cor-fundo); border-color: var(--cor-primaria); color: var(--cor-primaria-hover); }
.page-actions .btn i { font-size: 2em; margin-bottom: 8px; color: var(--cor-primaria); }

.tab-content { display: none; }

/* --- RESPONSIVIDADE DA ÁREA DO ASSOCIADO --- */
@media (min-width: 993px) {
    /* Em telas grandes, o menu é fixo à esquerda */
    .sidebar { left: 0; box-shadow: none; border-right: 1px solid var(--cor-borda); }
    .main-content { margin-left: 280px; }
    .sidebar-toggle, .sidebar-close, .overlay { display: none; }
    .header-title { padding-right: 0; text-align: left; }
    .main-header { left: 280px; width: calc(100% - 280px); }
}

@media (max-width: 992px) {
    /* Em telas pequenas, o menu é escondido e o header é fixo */
    .main-header { position: fixed; width: 100%; }
    .main-content { padding-top: 80px; } /* Espaço para o header fixo */
     .header-title {
        padding-right: 0; text-align: center; width: 100%;
        position: absolute; left: 0; pointer-events: none;
    }
    .sidebar-toggle { z-index: 1; }
}
/* ======================================================= */
/* --- ESTILOS PARA OS BLOCOS DE MENSALIDADES --- */
/* ======================================================= */

.mensalidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mensalidade-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 12px var(--cor-sombra, rgba(0,0,0,0.075));
    border-left: 5px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mensalidade-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--cor-sombra, rgba(0,0,0,0.1));
}

/* Cores da borda e ícone baseadas no status */
.mensalidade-card.paga { border-left-color: var(--cor-sucesso, #198754); }
.mensalidade-card.atrasada { border-left-color: var(--cor-perigo, #dc3545); }
.mensalidade-card.pendente { border-left-color: var(--cor-primaria, #fcd036); }

.mensalidade-card.paga .card-status-icon { color: var(--cor-sucesso, #198754); }
.mensalidade-card.atrasada .card-status-icon { color: var(--cor-perigo, #dc3545); }
.mensalidade-card.pendente .card-status-icon { color: var(--cor-primaria-hover, #e4bb31); }

.card-status-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.6em;
    opacity: 0.8;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-vencimento {
    font-size: 0.9em;
    color: var(--cor-texto-claro, #6c757d);
    font-weight: 500;
}

.card-valor {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--cor-texto, #212529);
}

/* Estilo para o formulário de filtro */
.filter-form {
    margin-top: 20px;
    background-color: var(--cor-fundo);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}
.filter-form label {
    font-weight: 500;
}
.filter-form select {
    padding: 8px;
    border: 1px solid var(--cor-borda);
    border-radius: 4px;
    font-size: 1em;
}

/* --- Estilos para variações de botões --- */
/* (Removido o bloco duplicado de eventos daqui) */

.btn-success {
    background-color: var(--cor-sucesso, #198754);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #157347; /* Um tom de verde mais escuro */
}

.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #5c636a;
}

.btn-danger {
    background-color: var(--cor-perigo, #dc3545);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #bb2d3b;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* --- Estilo para o botão de Cancelar Participação --- */
.btn-warning {
    background-color: #ffc107; /* Amarelo */
    color: var(--cor-texto);
    border-color: #ffc107;
}

.btn-warning:hover {
    background-color: #e0a800; /* Amarelo mais escuro */
    border-color: #e0a800;
}

/* --- Estilos para a Página de Detalhes do Evento --- */

.btn-voltar {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--cor-texto-claro);
    text-decoration: none;
    font-weight: 500;
}
.btn-voltar:hover {
    color: var(--cor-primaria-hover);
}

.evento-detalhe-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--cor-sombra);
    overflow: hidden; /* Garante que a imagem não vaze dos cantos arredondados */
}

.evento-detalhe-imagem {
    width: 100%;
    height: 300px; /* Altura fixa para a imagem de capa */
    object-fit: cover; /* Garante que a imagem cubra a área sem distorcer */
}

.evento-detalhe-header {
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.evento-detalhe-header h1 {
    margin: 0 0 15px 0;
    font-size: 2em;
}

.evento-detalhe-meta {
    display: flex;
    gap: 25px;
    color: var(--cor-texto-claro);
    flex-wrap: wrap;
}

.evento-detalhe-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1em;
}

.evento-detalhe-descricao {
    padding: 25px;
    line-height: 1.7;
}

.evento-detalhe-descricao h3 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    color: var(--cor-primaria-hover);
}

.evento-detalhe-descricao p {
    margin: 0;
}

.evento-detalhe-actions {
    padding: 25px;
    background-color: var(--cor-fundo);
    text-align: center;
}
.evento-detalhe-actions .btn {
    padding: 12px 25px;
    font-size: 1.1em;
}
.evento-detalhe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
}
.info-bloco h4 {
    margin: 0 0 10px 0;
    color: var(--cor-primaria-hover);
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-bloco p {
    margin: 0;
    color: var(--cor-texto);
}

/* --- Estilos para os Cupons --- */
.cupons-container {
    display: grid;
    gap: 15px;
}

.cupom-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--cor-fundo);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed var(--cor-primaria);
}

.cupom-codigo {
    background-color: var(--cor-primaria);
    color: var(--cor-texto);
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1.1em;
}

.cupom-descricao {
    margin: 0;
    font-weight: 500;
}

.cupom-validade {
    font-size: 0.85em;
    color: var(--cor-texto-claro);
}
/* --- Estilos para a Nova Dashboard --- */

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Bloco de Recompensas (Gamificação) --- */
.recompensas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.recompensa-card {
    background-color: var(--cor-fundo);
    border: 1px solid var(--cor-borda);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    width: 120px;
    transition: all 0.2s ease;
}
.recompensa-card i {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}
.recompensa-card span {
    font-weight: 500;
    font-size: 0.9em;
}
.recompensa-card.achieved {
    border-color: var(--cor-primaria);
}
.recompensa-card.achieved i {
    color: var(--cor-primaria);
}
.recompensa-card.next {
    opacity: 0.7;
    border-style: dashed;
}
.progress-bar-recompensa {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 5px 0;
    overflow: hidden;
}
.progress-bar-recompensa .progress {
    height: 100%;
    background-color: var(--cor-primaria);
    border-radius: 4px;
}

/* --- Bloco da Comunidade --- */
.comunidade-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.post-card {
    background-color: var(--cor-fundo);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--cor-borda);
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--cor-texto-claro);
    font-size: 0.9em;
}
.post-body p {
    margin: 0 0 10px 0;
}
.post-link {
    text-decoration: none;
    font-weight: 500;
    color: var(--cor-primaria-hover);
}

/* --- Responsividade --- */
@media (max-width: 992px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr; /* Coluna única em telas menores */
    }
}
/* --- Estilos para a Dashboard (Blocos de Resumo) --- */

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center; /* Centraliza os cards */
}

/* Regra para o link que envolve o card */
.stat-link {
    text-decoration: none; /* Remove o sublinhado do link */
    color: inherit;      /* Faz o texto dentro do link herdar a cor normal */
    display: block;      /* Garante que o link se comporte como um bloco */
}

/* O card em si, seja um link ou não */
.stat-card {
    background-color: var(--cor-fundo);
    border: 1px solid var(--cor-borda);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 160px;
    height: 100%; /* Garante que todos os cards na linha tenham a mesma altura */
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Efeito de hover quando o mouse passa sobre o link */
.stat-link:hover .stat-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: var(--cor-primaria);
}

.stat-card i {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 700;
    display: block;
    line-height: 1.1;
    color: var(--cor-texto);
}

.stat-label {
    font-size: 0.9em;
    color: var(--cor-texto-claro);
}

/* Classes de cor para os ícones (já devem existir) */
.icon-primary { color: #007bff; }
.icon-danger  { color: var(--cor-perigo, #dc3545); }
.icon-success { color: var(--cor-sucesso, #198754); }
/* --- Estilos para a Comunidade --- */
.page-header-comunidade { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.post-card { background: #fff; border-radius: 8px; box-shadow: 0 4px 12px var(--cor-sombra); margin-bottom: 20px; display: flex; flex-direction: column; }
.post-body { padding: 20px; flex-grow: 1; }
.post-footer { background: var(--cor-fundo); padding: 15px 20px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-size: 0.9em; color: var(--cor-texto-claro); }
.post-completo-card { background: #fff; padding: 25px; border-radius: 8px; margin-top: 20px; }
.comentarios-section { margin-top: 30px; }
.comentario-card { background: var(--cor-fundo); padding: 15px; border-radius: 8px; margin-bottom: 15px; }
.comentario-header { display: flex; justify-content: space-between; font-size: 0.9em; color: var(--cor-texto-claro); margin-bottom: 5px; }
.comentario-form textarea { width: 100%; min-height: 80px; margin-bottom: 10px; padding: 10px; border-radius: 8px; border: 1px solid #ccc; }

/* --- Estilos para Alertas/Feedback --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 500;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
/* ======================================================= */
/* --- CSS RESPONSIVO PARA EVENTOS E FILTROS (NOVO) --- */
/* ======================================================= */

/* --- Filtros de Categoria --- */
.category-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    
    /* Permite rolar horizontalmente no celular */
    overflow-x: auto; 
    
    /* Esconde a barra de rolagem (visual) */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.category-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-filters a {
    white-space: nowrap; /* Impede que "CONFRATERNIZAÇÃO" quebre a linha */
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    background-color: #eee;
    color: #555;
    font-size: 0.9em;
    font-weight: 500;
}
.category-filters a.active {
    background-color: var(--cor-primaria, #fcd036);
    color: var(--cor-texto, #333);
    font-weight: 600;
}

/* --- Grid de Eventos --- */
.eventos-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 coluna por padrão (mobile-first) */
    gap: 20px;
}

.evento-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column; /* Empilha verticalmente no celular */
    overflow: hidden;
}

.evento-data {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.evento-data span {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--cor-primaria-hover, #e0a800);
}
.evento-data small {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--cor-texto-claro, #6c757d);
    text-transform: uppercase;
}

.evento-info {
    padding: 15px;
    flex-grow: 1; /* Faz esta seção crescer */
}
.evento-categoria {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    background-color: #6c757d; /* Cor padrão */
}
/* Cores das categorias (opcional) */
.cat-provas { background-color: #dc3545; }
.cat-treinos { background-color: #0d6efd; }
.cat-confraternizacao { background-color: #198754; }
.cat-diversos { background-color: #6c757d; }

.evento-titulo {
    font-size: 1.3em;
    margin: 10px 0;
}
.evento-local {
    color: #555;
    font-size: 0.95em;
}
.evento-local i {
    margin-right: 5px;
    color: var(--cor-primaria, #fcd036);
}

.evento-actions {
    display: flex;
    flex-direction: column; /* Empilha botões no celular */
    gap: 10px;
    padding: 15px;
    background-color: #f8f9fa; /* Fundo levemente cinza */
}
.evento-actions .btn {
    width: 100%; /* Faz botões ocuparem 100% da largura */
    text-align: center;
}

/* --- Media Query para Telas Maiores (Desktop) --- */
@media (min-width: 768px) {
    .evento-card {
        flex-direction: row; /* Lado a lado no desktop */
        align-items: center;
    }
    .evento-data {
        flex-direction: column; /* Data empilhada */
        width: 100px;
        height: 100px;
        justify-content: center;
        gap: 5px;
        border-bottom: none;
        border-right: 1px solid #f0f0f0;
    }
    .evento-data span { font-size: 2.2em; }
    .evento-data small { font-size: 0.9em; }

    .evento-actions {
        flex-direction: row; /* Botões lado a lado */
        width: auto;
        min-width: 250px; /* Ajuste conforme necessário */
        background-color: transparent;
    }
    .evento-actions .btn {
        width: auto;
    }
}