/* Global Styles & Variables */
:root {
    --primary-color: #b71e24; /* Rojo Principal CV Aranjuez */
    --secondary-color: #711216; /* Rojo Oscuro */
    --text-color: #333;
    --light-bg: #f5f5f5;
    --white: #fff;
    --nav-height: 65px; /* Altura estándar de la barra de navegación */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    /* Espacio para el footer si no es fijo, o para evitar solapamiento */
    padding-bottom: 0;
}

/* --- Navigation --- */

nav {
    background-color: var(--primary-color);
    padding: 0 1rem;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

nav .logo {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 0.5rem; /* Pequeño espacio para no pegarse al borde absoluto */
    flex-shrink: 0;
}

/* ** SOLUCIÓN LOGO: Tamaño fijo y correcto ** */
#logoCVA {
    height: 45px; /* <--- Ajusta esta altura a tu gusto (45px es estándar) */
    width: 45px;
    object-fit: contain;
    margin: 0; /* Asegura que no haya márgenes externos */
    padding: 0;
}
nav h1 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-left: 0;
    margin: 0;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: 500;
    display: flex; /* Para alinear Login con icono */
    align-items: center;
    gap: 5px;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: var(--secondary-color);
    border-radius: 8px;
}

/* Estilo específico para el enlace de Login */
nav ul li a.login-link {
    background-color: var(--secondary-color);
    border-radius: 6px;
    padding: 0.7rem 1rem;
    margin-left: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

nav ul li a.login-link:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: scale(1.05);
}


/* --- Social Lateral --- */
#lateral {
    position: fixed;
    top: 50%;
    right: 0px;
    transform: translateY(-50%);
    z-index: 100;
    /* Usamos un fondo para las tarjetas laterales de los iconos */
    background: var(--white);
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.15); /* Sombra hacia el interior */
}

/* Estilos para los NUEVOS iconos de Font Awesome */
#iconInstagram, #iconX {
    /* Ajusta este tamaño para que se vea bien, por ejemplo 2.5rem (40px) */
    font-size: 2.5rem;
    display: block;
    margin: 10px 15px; /* Espacio alrededor de cada icono dentro del lateral */
    transition: transform 0.3s;
}

/* Asignar colores base */
#iconInstagram {
    color: #E4405F; /* Color de marca de Instagram */
}
#iconX {
    color: #000000; /* Color de marca de X/Twitter */
}

/* Efecto hover */
#lateral a:hover #iconInstagram {
    color: #FF7F50; /* Un color de acento o un efecto de luz en el hover */
    transform: scale(1.15);
}
#lateral a:hover #iconX {
    color: var(--primary-color); /* Usamos el rojo principal del club en el hover de X */
    transform: scale(1.15);
}

/* Ocultamos los IDs de las imágenes antiguas por si las dejaste */
/* Esto asegura que las imágenes externas no interfieran si aún están en el HTML, pero lo ideal es eliminarlas */
#logoInstagram, #logoX {
    display: none !important;
}


/* --- Hero Section (Inicio) --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("Imagenes/seniorfed.png") no-repeat center center/cover;
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    /* Sin padding-top aquí, el main maneja el espacio */
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* --- Main Content & Spacing --- */

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    /* Espacio para el nav fijo */
    margin-top: var(--nav-height);
    min-height: calc(100vh - 400px); /* Evitar que el footer suba si hay poco contenido */
}

/* --- Feature Section (Tarjetas de Inicio) --- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.feature {
    text-align: center;
    padding: 2rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid var(--primary-color);
}

.feature h2 {
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* --- About Page (Detalles avanzados) --- */

.about-header {
    text-align: center;
    padding: 2rem 0;
    padding-top: 5rem; /* AJUSTE: Espacio para el nav fijo */
}
.about-header h1 {
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.about-content-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: flex-start;
    margin-top: 2rem;
}
.about-image-container {
    background-color: var(--light-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
    padding: 15px;
}
.about-image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}
.about-text h2 {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.values-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}
.values-list li {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
}
.values-list li:hover {
    background-color: var(--secondary-color);
}

/* --- Directors Page (Junta Directiva) --- */
.directors-page h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--light-bg);
}
.directors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}
.director-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid var(--primary-color);
}
.director-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}
.director-img {
    width: 150px;
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: 0 0 0 4px var(--secondary-color);
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}
.director-card:hover .director-img {
     transform: scale(1.05);
}
.director-card h2 {
    color: var(--text-color);
    margin-bottom: 0.3rem;
    font-size: 1.4rem;
    font-weight: 700;
}
.director-card h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.director-card p {
    color: #777;
    font-style: italic;
    margin-top: 1rem;
}
/* Estilos específicos de fondo para las imágenes de la directiva (Necesitas estas imágenes) */
.directors-grid .director-card:nth-child(1) .director-img { background-image: url("Imagenes/fotojose.png"); }
.directors-grid .director-card:nth-child(2) .director-img { background-image: url("Imagenes/fotoJin.png"); }
.directors-grid .director-card:nth-child(3) .director-img { background-image: url("Imagenes/fotomorillo.png"); }
.directors-grid .director-card:nth-child(4) .director-img { background-image: url("Imagenes/fotoDiego.png"); }
.directors-grid .director-card:nth-child(5) .director-img { background-image: url("Imagenes/IMG_6371.png"); }


/* --- Teams Page (Equipos) --- */
.teams-page h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--light-bg);
}
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}
.team-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 5px solid var(--primary-color);
    min-height: 250px;
}
.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}
.team-card h2 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    padding-left: 0.5rem;
    border-bottom: 1px dashed var(--light-bg);
    padding-bottom: 0.5rem;
}
.team-card p {
    margin-bottom: 1rem;
    color: #555;
    flex-grow: 1;
    font-style: italic;
}
.team-card ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.team-card ul li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}
.team-card ul li i {
    color: var(--primary-color);
    margin-right: 8px;
}


/* --- Contact Page --- */
.contact-page h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--light-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
.contact-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}
/* (Estilos de formulario y contact-info van en el HTML de contacto, pero la estructura de grid está aquí) */

.menu-toggle {
    display: none; /* Ocultarlo completamente en desktop */
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Mostrarlo solo en móvil */
    }
}
/* --- Admin / Login Page --- */
.login-box {
    /* Estos estilos se movieron al HTML del login para darle un fondo específico */
}


/* --- Resultados (Tarjetas) --- */
#resultados-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0 2rem 3rem 2rem;
}
/* Estilos de resultados (tarjetas, filtros, etc.) también están en el HTML de resultados para aislamiento */


/* --- FOOTER COMPLETO Y ESTANDARIZADO --- */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 2.5rem 0 0;
    width: 100%;
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-col h4 {
    font-size: 1.1rem;
    color: var(--white);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}
.footer-col p {
    font-size: 0.9rem;
    line-height: 1.8;
}
.footer-col ul {
    list-style: none;
    padding: 0;
}
.footer-col ul li {
    margin-bottom: 0.8rem;
}
.footer-col ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.footer-col ul li a:hover {
    color: var(--primary-color);
}
.social-icons {
    margin-top: 1.5rem;
    display: flex;
    gap: 15px;
}
.social-icons a {
    color: var(--white);
    font-size: 1.4rem;
    transition: color 0.3s;
}
.social-icons a:hover {
    color: var(--primary-color);
}
.contact-col p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}
.contact-col i {
    color: var(--primary-color);
}
.footer-bottom {
    text-align: center;
    padding: 1rem 0;
    font-size: 0.8rem;
    background-color: #5a0f12;
}

/* --- Media Queries (Organizadas y Limpias) --- */

img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1200px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 14px;
    }
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Ajuste en tablets para el contacto */
    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Navegación Responsive */
    nav {
        position: relative; /* Quitar fixed en móvil para evitar que oculte contenido */
        height: auto;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
    }
    nav .logo {
        padding-left: 0.2rem;
        margin-bottom: 0.5rem;
    }
    nav h1 {
        font-size: 1.5rem;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem 0;
        gap: 0.5rem;
        width: 100%;
    }
    nav ul li {
        text-align: center;
    }
    /* El login-link en móvil */
    nav ul li a.login-link {
        margin-left: 0;
    }

    /* Main Content */
    main {
        margin-top: 0; /* Si nav no es fixed, no necesita margin-top */
        padding: 1rem;
    }

    /* Grid layouts */
    .features,
    .directors-grid,
    .teams-grid {
        grid-template-columns: 1fr;
    }

    /* About Page Mobile */
    .about-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-image-container {
        order: -1;
        position: static;
    }
    .about-header {
        padding-top: 2rem;
    }

    /* Social lateral */
    #lateral {
        display: none;
    }

    /* Footer Responsive */
    footer {
        position: relative;
    }
    .footer-container {
        grid-template-columns: 1fr;
        padding: 0 1rem 1.5rem;
        text-align: center;
    }
    .footer-col h4 {
        border-left: none;
        padding-left: 0;
        margin-top: 1rem;
    }
    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 13px;
    }
    /* Ajuste fino de padding en tarjetas para móviles muy pequeños */
    .feature,
    .director-card,
    .team-card,
    .resultado {
        padding: 1.2rem;
    }
}
/* Desactivar hover en dispositivos táctiles */
@media (hover: none) {
    .feature:hover,
    .director-card:hover,
    .team-card:hover {
        transform: none;
        box-shadow: none;
    }
}
/* --- SPINNER DE CARGA --- */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    width: 100%;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--primary-color); /* Tu rojo corporativo */
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* --- TABLA RESPONSIVE --- */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Permite scroll horizontal */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iPhone */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Ajuste para que no se corten los botones en móvil */
#tablaResultados {
    min-width: 600px; /* Fuerza un ancho mínimo para que no se aplaste */
}
