/* ==========================================================================
   1. VARIÁVEIS, RESETS E ESTILOS GERAIS
   ========================================================================== */

:root {
    --vermelho-benfica: #E30613;
    --preto: #111111;
    --branco: #ffffff;
    --cinza-claro: #f4f4f4;
    --cinza-escuro: #dcdcdc;
}

* {
    box-sizing: border-box;
}

html {
    max-width: 100%;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--cinza-escuro);
    color: var(--preto);
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

/* --- Tipografia Geral --- */
h1, h2 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 {
    color: var(--vermelho-benfica);
    border-left: 5px solid var(--preto);
    padding-left: 10px;
}

h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}

main {
    width: min(1700px, 96%);
    margin: auto;
}

section {
    padding: 30px 0;
    border-bottom: 1px solid #ddd;
}

.container {
    max-width: 1100px;
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    background: var(--branco);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}


/* ==========================================================================
   2. ESTRUTURA: HEADER, NAV E FOOTER
   ========================================================================== */

header {
    background-color: var(--vermelho-benfica);
    color: var(--branco);
    padding: 30px 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

header .header-textos {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

header h1 {
    font-size: 3.5rem;
    margin: 0;
    line-height: 1;
}

header h3 {
    margin: 0;
    letter-spacing: 3px;
    font-size: 1.1rem;
}

.logo-benfica {
    width: 90px;
    height: auto;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

.quebra-mobile {
    white-space: nowrap; 
}

/* --- Menu Fixo (Sticky) --- */
nav {
    background-color: var(--preto);
    padding: 15px 10px;
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  gap: 8px;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0,0,0,.3);
}

nav a{
    color: var(--branco);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
    padding:8px 10px;
    border-radius:6px;
    transition: all .3s ease;
}

nav a:hover{
    background:#E30613;
    color:#fff;
}

nav a.ativo{
    background:#E30613;
    color:#fff;
}

/* --- Footer Moderno --- */
.footer-moderno {
    background-color: var(--preto);
    color: var(--branco);
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 4px solid var(--vermelho-benfica);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-conteudo {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-conteudo p {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.footer-subtexto {
    color: #aaa;
    font-size: 0.85rem !important;
}

.quebra-footer {
    display: inline;
    margin-left: 5px; 
}


/* ==========================================================================
   3. COMPONENTES: TABELAS, CARDS, VÍDEOS E GALERIA
   ========================================================================== */

/* --- Tabelas Responsivas Modificadas para Horizontal --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Garantia de leitura horizontal fluida */
}

table th, table td {
    padding: 12px;
    text-align: center; /* Alinhamento centralizado para leitura em grelha */
    border: 1px solid #ddd;
    font-size: 0.95rem;
}

table th {
    background-color: var(--vermelho-benfica);
    color: var(--branco);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.resultado-vitoria {
    font-weight: bold;
    color: var(--vermelho-benfica);
}

.btn-video-tabela {
    background-color: var(--vermelho-benfica);
    color: var(--branco);
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.btn-video-tabela:hover {
    background-color: var(--preto);
    color: var(--branco);
}

.badge-nacional { background-color: #0066cc !important; }
.badge-distrital { background-color: #e67e22 !important; }

/* --- Plantel & Grid de Jogadoras --- */
.plantel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Aumentado para suportar cards e fotos maiores */
    gap: 20px;
    margin-top: 20px;
}

.jogadora-card {
    background-image: url('../img/card-background.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    text-align: center;
    padding: 25px 15px;
    cursor: pointer;
    transition: transform 0.3s ease; 
}

.jogadora-card:hover {
    transform: translateY(-5px) scale(1.03);
}

.jogadora-card p {
    color: var(--branco);
    margin: 4px 0;
    font-size: 0.95rem;
}

/* 📸 CORREÇÃO: Fotos das jogadoras aumentadas significativamente */
.jogadora-foto {
    width: 180px;  
    height: 180px; 
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    display: block;
    border: 4px solid var(--branco);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.nome-jogadora {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--branco);
    margin-bottom: 5px;
}

.tecnica-card {
    background-image: none !important;
    background-color: var(--preto) !important;
}

/* --- Avisos de Aniversário --- */
.aviso-aniversario {
    display: block;
    width: calc(100% - 20px);
    margin: 10px auto 0;
    padding: 8px 10px;
    background: #fff;
    color: #E30613;
    border: 1px solid #E30613;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.aviso-aniversario.aviso {
    background: #ffffff;
    color: #E30613;
}

.aviso-aniversario.parabens {
    background: #E30613;
    color: #ffffff;
}

/* --- Grelha de Vídeos --- */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.video-thumbnail-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.video-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--preto);
    font-family: 'Oswald', sans-serif;
}

.video-meta {
    font-size: 0.85rem;
    color: #666;
}

/* --- Galeria de Imagens --- */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.galeria-item {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeria-item:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}


/* ==========================================================================
   4. MODALS E LIGHTBOX
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--branco);
    margin: 40px auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 650px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid var(--vermelho-benfica);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.modal-header-info {
    display: flex;
    flex-direction: column;
}

/* 📸 CORREÇÃO: Foto interna da modal também ampliada */
#modal-img {
    width: 150px;  
    height: 150px; 
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--vermelho-benfica);
}

.badge {
    display: inline-block;
    background-color: var(--preto);
    color: var(--branco);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 4px;
    width: fit-content;
}

/* --- Botões do Modal --- */
.modal-botoes-container {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 15px !important;
    width: 100% !important;
}

#modal-btn-galeria, #modal-btn-videos {
    flex: 1 !important;
    height: 40px !important;
    padding: 0 15px !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--branco) !important;
    text-align: center !important;
    white-space: nowrap !important;
    text-decoration: none !important; 
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: background-color 0.2s ease !important;
}

#modal-btn-galeria {
    background-color: var(--preto) !important;
}

#modal-btn-galeria:hover {
    background-color: #333 !important;
}

#modal-btn-videos {
    background-color: var(--vermelho-benfica) !important;
}

#modal-btn-videos:hover {
    background-color: #b8050f !important;
}

/* --- Lightbox de Imagens --- */
#lightbox {
    display: none;
    position: fixed;
    z-index: 2100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(10,10,10,0.95);
    text-align: center;
}

#lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

#lightbox-prev, #lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    padding: 10px;
    cursor: pointer;
}

#lightbox-prev { left: 10px; }
#lightbox-next { right: 10px; }

#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    margin-top: 10vh;
    object-fit: contain;
}


/* ==========================================================================
   5. PÁGINA INICIAL, BANNERS E MEDIA QUERIES
   ========================================================================== */

.hero {
    position: relative;
    width: 100%;
    height: calc(100vh - 5rem);
    overflow: hidden;
}
.hero-botoes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.03);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.60));
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 20px;
}

.hero-overlay h1 {
    font-family: "Kanit", sans-serif;
    font-size: 4rem;
    line-height: 1;
    letter-spacing: 3px;
    text-shadow: 0 4px 18px rgba(0,0,0,.45);
    animation: fadeHero 1s ease;
}

.hero-overlay h2 {
    font-family: "Oswald", sans-serif;
    margin-top: 8px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 5px;
    animation: fadeHero 1.4s ease;
}

.hero-overlay p {
    max-width: 850px;
    margin-top: 35px;
    font-size: 1.25rem;
    line-height: 1.7;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0,0,0,.45);
    animation: fadeHero 1.8s ease;
}

.hero-scroll {
    display: inline-block;
    padding: 16px 50px;
    border-radius: 40px;
    color: white;
    background-color: #E3061e;
    text-decoration: none;
    font-weight: 700;
    transition: .35s;
    animation: fadeHero 2s ease, sobeDesce 2s infinite 2s;
}
.hero-scroll:hover {
    background: #E3061e;
    color:white;
}


.escaloes-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: min(1700px, 95%);
    margin: 90px auto;
}

.banner-equipa {
    position: relative;
    display: block;
    width: 100%;
    height: 260px;
    margin-bottom: 35px;
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(0,0,0,.18);
    transition: transform .35s, box-shadow .35s;
}

.banner-equipa img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s ease;
}

.banner-equipa:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0,0,0,.28);
}

.banner-equipa:hover img {
    transform: scale(1.08);
}

.banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end; 
    padding: 40px 55px;
    background: linear-gradient(to right, rgba(0,0,0,.78) 0%, rgba(0,0,0,.55) 35%, rgba(0,0,0,.15) 100%);
}

.banner-texto h3 {
    font-family: "Oswald", sans-serif;
    font-size: 3rem;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: white;
}

.banner-botao {
    background: #E30613;
    color: white;
    padding: 16px 34px;
    border-radius: 50px;
    font-weight: 700;
    transition: .35s;
}

.banner-equipa:hover .banner-botao {
    background: white;
    color: #E30613;
}

/* ==========================================================
   AGENDA DA PÁGINA INICIAL
========================================================== */

.agenda-home{

    max-width:1100px;
    margin:70px auto;
    padding:0 20px;

}

.agenda-home h2 {
    text-align: center;
    color: var(--vermelho-benfica);
    margin-bottom: 40px;
    font-size: 2rem;
    
    /* ADICIONA ESTAS DUAS LINHAS PARA ANULAR REGRAS GERAIS: */
    border-left: none !important; 
    padding-left: 0 !important;
}

/* Container que envolve todos os cartões dos jogos */
#agenda-jogos {
    display: grid;
    /* Cria 4 colunas de tamanho igual em ecrãs grandes */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px; /* Espaço entre os cartões */
    padding: 20px 0;
    width: 100%;
}

.agenda-jogo{

    background:#fff;
    border-left:6px solid var(--vermelho-benfica);
    border-radius:12px;
    padding:20px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);

}

.agenda-jogo h3{

    color:var(--vermelho-benfica);
    margin-bottom:15px;

}

.agenda-jogo p{

    margin:8px 0;
    
}

.cartao-jogo {
    width: 100%;
    box-sizing: border-box;
    /* Podes ajustar a altura interior (padding) se o cartão estiver muito alto */
    padding: 15px; 
}

/* --- DESTAQUES DA AGENDA --- */

/* Jogo Hoje: Vermelho vibrante para alertar que o dia chegou! */
.agenda-jogo.jogo-hoje {
    border: 3px solid #E30613 !important;
    background-color: #fff0f0 !important;
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.2);
    position: relative;
}

/* Jogo Amanhã: Um tom intermédio (laranja/dourado suave ou cinza quente) para avisar que está quase */
.agenda-jogo.jogo-amanha {
    border: 3px solid #f39c12 !important; /* Dourado/Laranja de aviso */
    background-color: #fefcf5 !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15);
    position: relative;
}

/* Opcional: Adicionar uma etiqueta de texto nos cartões especiais */
.agenda-jogo.jogo-hoje::before {
    content: "HOJE";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #E30613;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
}

.agenda-jogo.jogo-amanha::before {
    content: "AMANHÃ";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f39c12;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Contador de Visitas Discreto e Centrado */
.contador-visitas {
    background-color: #222;
    color: #888;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid #333;
}


/* ==========================================================================
   🎯 CSS CONSOLIDADO DO RODAPÉ (Sem Repetições)
   ========================================================================== */

.footer-moderno {
    background-color: #111;
    padding: 30px 10px;
    border-top: 2px solid #E30613; /* Vermelho Benfica */
}

/* Container principal sempre centrado e vertical */
.footer-conteudo {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
}

/* Secção de Texto */
.footer-seccao {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-seccao p {
    margin: 5px 0;
    font-size: 0.95rem; /* Tamanho para computador */
    color: #fff;
}

.footer-subtexto {
    font-size: 0.85rem;
    color: #888;
}

/* Força a quebra de linha em qualquer ecrã */
.quebra-footer {
    display: block;
    margin-top: 2px;
}

/* Secção do Contacto (Email) */
.contacto-rodape {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.email-rodape {
    margin: 0;
}

.email-rodape a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
    font-size: 0.85rem; /* 👈 Aplica o tamanho diretamente no link para o computador */
}

.email-rodape a:hover {
    color: #E30613;
}

/* Contador de Visitas */
.contador-visitas {
    background-color: #222;
    color: #888;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid #333;
}

#numero-visitas {
    font-weight: bold;
    color: #E30613;
}
/* ==========================================================================
   🎬 ANIMATIONS
   ========================================================================== */
@keyframes sobeDesce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes fadeHero {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   📱 RESPONSIVIDADE CRÍTICA (Ordenada do maior para o menor ecrã)
   ========================================================================== */

/* 🖥️ Tablets Grandes (Até 1024px) */
@media (max-width: 1024px) {
    #agenda-jogos {
        /* Em tablets, mostra 2 cartões por linha */
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 💻 Computadores Pequenos / Ecrãs Médios (Até 1000px) */
@media (max-width: 1000px) {
    .banner-equipa { height: 220px; }
    .banner-overlay { padding: 35px; }
}

/* 📋 Tablets Médios (Até 900px) */
@media (max-width: 900px) {
    .escaloes-menu { grid-template-columns: repeat(2, 1fr); }
}

/* 📱 Tablets Pequenos e Telemóveis em Horizontal (Até 768px) */
@media (max-width: 768px) {
    header { flex-direction: column; text-align: center; gap: 10px; }
    header h1 { font-size: 2.2rem; }
    nav { gap: 10px 15px; }
    .plantel-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .jogadora-foto { width: 130px; height: 130px; }
    .hero { height: 75vh; }
    .hero-overlay h1 { font-size: 2.5rem; }
    .banner-equipa { height: 240px; }
    .banner-overlay { flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: 20px; }
    .banner-texto h3 { font-size: 2rem; }
 .hero-botoes {
    margin-top: 10px;
    gap: 15px;
}
.hero-scroll {
    padding: 14px 28px;
    font-size: 0.95rem;
}
}

/* 📱 Telemóveis (Até 600px) - JUNTADO NUM ÚNICO BLOCO */
@media (max-width: 600px) {
    .escaloes-menu { 
        grid-template-columns: 1fr; 
    }
    
    #agenda-jogos {
        /* Em telemóveis, mostra apenas 1 cartão por linha (para não esmagar a info) */
        grid-template-columns: 1fr;
    }
}

/* 📱 REGRAS EXCLUSIVAS PARA TELEMÓVEL (MOBILE) */
@media (max-width: 480px) {
    .footer-moderno {
        padding: 20px 10px;
    }

    .footer-conteudo {
        gap: 12px;
    }

    .footer-seccao p {
        font-size: 0.85rem; /* Encolhe o texto principal */
    }

    .footer-subtexto {
        font-size: 0.75rem; /* Encolhe o "Website de Apoio..." */
    }

    .email-rodape {
        font-size: 0.5rem; /* <-- REDUZIDO DE 0.85rem PARA 0.75rem (Fica mais pequeno e elegante no tlm) */
    }

    .contador-visitas {
        padding: 5px 12px;
        font-size: 0.75rem; /* Encolhe ligeiramente o contador */
    }

    
}