/* ==============================================
   VARIÁVEIS E CONFIGURAÇÕES BASE
   ============================================== */
:root {
    --verde-primario: #2e7d32;
    --verde-escuro: #1b5e20;
    --verde-claro: #e8f5e9;
    --efeito-vidro: rgba(255, 255, 255, 0.85);
    --sombra-suave: 0 8px 32px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f4;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==============================================
   CABEÇALHO E MENU (NAV)
   ============================================== */
header {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('elea_banner.jpeg');
    background-size: cover;
    background-position: center;
    height: 350px; /* Altura padrão para subpáginas */
    position: relative;
    display: flex;
    flex-direction: column;
}

header.home-header {
    height: 450px; /* Altura maior apenas para a Home */
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.header-content h1 { font-size: 5rem; letter-spacing: 2px; margin: 0; }
.header-content p { font-size: 1.2rem; font-weight: 300; }

.titulo-underline {
    width: 250px; 
    height: 5px;
    background-color: var(--verde-primario); 
    margin-top: 10px;
    border-radius: 10px;
}

nav {
    padding: 0 5%;
    height: 70px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: var(--efeito-vidro);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.nav-menu { display: flex; list-style: none; height: 100%; }
.nav-item { position: relative; display: flex; align-items: center; }

.nav-link {
    color: #1a3a1a;
    text-decoration: none;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
}

.nav-link:hover { background: rgba(46, 125, 50, 0.08); color: var(--verde-primario); }
.dropdown-icon { margin-left: 6px; font-size: 0.6rem; transition: transform 0.3s; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 240px;
    box-shadow: var(--sombra-suave);
    display: none;
    list-style: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    border: 1px solid #eee;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f5f5f5;
}
.dropdown-item:hover { background-color: var(--verde-claro); color: var(--verde-escuro); padding-left: 25px; }

/* ==============================================
   CONTEÚDO PRINCIPAL (SEÇÕES E CARDS)
   ============================================== */
main { max-width: 1100px; margin: 40px auto; padding: 0 20px; flex: 1; }

section {
    margin-bottom: 40px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.section-title {
    color: var(--verde-primario);
    margin-bottom: 25px;
    border-left: 5px solid var(--verde-primario);
    padding-left: 15px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    border: 1px solid #eee;
    transition: 0.3s;
}

.card:hover { border-color: var(--verde-primario); transform: translateY(-3px); }

/* ==============================================
   ELEMENTOS EXTRAS (BOTÕES, TABELAS)
   ============================================== */
.btn-acao {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--verde-primario);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.btn-acao:hover {
    background-color: var(--verde-escuro);
    transform: translateY(-2px);
}

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

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

table.elea-table th {
    background-color: var(--verde-primario);
    color: white;
}

table.elea-table tr:hover { background-color: var(--verde-claro); }

/* ==============================================
   RODAPÉ
   ============================================== */
footer { background-color: var(--verde-primario); color: white; }
.footer-top-stripe { height: 12px; background-color: var(--verde-escuro); width: 100%; }
.footer-content { padding: 50px 20px; max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-bottom { background: rgba(0,0,0,0.1); padding: 20px; text-align: center; font-size: 0.85rem; }

@media (max-width: 900px) {
    .nav-menu { display: none; } /* Requer menu mobile futuramente */
    .header-content h1 { font-size: 3rem; }
}

/* ==============================================
   CARROSSEL DE NOTÍCIAS
   ============================================== */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.carousel-track-container {
    overflow: hidden;
    width: 100%;
    padding: 10px 0;
}

.carousel-track {
    display: flex;
    list-style: none;
    transition: transform 0.4s ease-in-out;
    gap: 20px;
}

.carousel-slide {
    min-width: calc(33.333% - 14px); /* Mostra 3 cartões no PC */
    box-sizing: border-box;
}

.news-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    height: 100%;
    border: 1px solid #eee;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: var(--verde-primario);
}

.news-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.news-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    font-weight: 600;
}

.news-content h3 {
    font-size: 1.15rem;
    color: var(--verde-escuro);
    margin-bottom: 10px;
    line-height: 1.3;
}

.news-content p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
    flex: 1;
}

.read-more {
    color: var(--verde-primario);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.read-more:hover { text-decoration: underline; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--verde-primario);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: 0.3s;
}

.carousel-btn:hover { background: var(--verde-escuro); }
.prev-btn { left: -10px; }
.next-btn { right: -10px; }

/* ==============================================
   AGENDA / CALENDÁRIO
   ============================================== */
.calendar-container {
    position: relative;
    padding-bottom: 60%; /* Adapta para telemóveis */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: #fff;
    border: 1px solid #eee;
}

.calendar-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsividade do Carrossel e Calendário */
@media (min-width: 768px) {
    .calendar-container {
        padding-bottom: 0;
        height: 500px; /* Altura fixa no PC */
    }
}

@media (max-width: 900px) {
    .carousel-slide { min-width: calc(50% - 10px); } /* Mostra 2 cartões no tablet */
}

@media (max-width: 600px) {
    .carousel-slide { min-width: 100%; } /* Mostra 1 cartão no telemóvel */
}

/* ==============================================
   CARTÕES DE CURSOS E STATUS DE INSCRIÇÃO
   ============================================== */
.curso-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.curso-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-suave);
    border-color: var(--verde-primario);
}

.curso-header {
    padding: 20px;
    background-color: #fcfcfc;
    border-bottom: 1px solid #eee;
    position: relative;
}

.curso-header h3 {
    color: var(--verde-escuro);
    font-size: 1.25rem;
    margin-bottom: 5px;
    padding-right: 80px; /* Espaço para a tag de modalidade */
}

.curso-modalidade {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background: #e0e0e0;
    color: #555;
    text-transform: uppercase;
}

.curso-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.curso-body p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 20px;
    flex: 1;
}

.curso-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
}

.curso-info strong {
    color: #333;
}

/* Etiquetas de Status (Badges) */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.status-aberta {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status-breve {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.status-encerrada {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Botões do Curso */
.btn-curso {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.btn-inscrever {
    background-color: var(--verde-primario);
    color: white;
}

.btn-inscrever:hover {
    background-color: var(--verde-escuro);
}

.btn-desativado {
    background-color: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    pointer-events: none;
}

/* Banner EAD Destaque */
.ead-banner {
    background: linear-gradient(135deg, var(--verde-escuro) 0%, var(--verde-primario) 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 50px;
    box-shadow: var(--sombra-suave);
}

.ead-text h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.ead-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

.btn-ead {
    background-color: white;
    color: var(--verde-escuro);
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: 0.3s;
}

.btn-ead:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}