﻿/* ==================================== */
/* 0. VARIABLES Y BASE                  */
/* ==================================== */
:root {
    /* Colores del Tema Oscuro (DEFAULT) */
    --background-color: #1e1e2f;
    --card-background: #27293d;
    --text-color: #f0f0f0;
    --secondary-text-color: #a0a0b8;
    --border-color: #3b3e5a;
    --color-primary: #ff5722; /* NARANJA Brillante (Accento) */
    --shadow-color: rgba(0, 0, 0, 0.4);
    --header-bg: rgba(30, 30, 47, 0.95);
    --swiper-navigation-color: #ff5722; 
    --swiper-pagination-color: #ff5722;
}

/* Colores del Tema Claro */
body.light-mode {
    --background-color: #f7f7f7;
    --card-background: #ffffff;
    --text-color: #333333;
    --secondary-text-color: #666666;
    --border-color: #dddddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --header-bg: rgba(255, 255, 255, 0.95);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.5s, color 0.5s;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Oswald', sans-serif;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* ==================================== */
/* 1. HEADER Y NAVEGACIÓN (LOGO CORREGIDO) */
/* ==================================== */
.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    /* 🚀 CORRECCIÓN DEL LOGO: Por defecto, el logo para fondo oscuro (letras claras) */
    content: url('assets/logo.png'); 
    transition: content 0.3s; 
}

/* 🔄 Cambia el logo cuando el body está en light-mode */
body.light-mode .logo img {
    content: url('assets/logo2.png'); 
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.3s, background-color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--background-color);
    background-color: var(--color-primary);
}

.theme-toggle {
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.7rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s, color 0.3s, border 0.3s;
}

.btn-acceso {
    border: 2px solid var(--color-primary);
    color: var(--color-primary) !important;
    padding: 0.4rem 1rem !important; /* Un poco más de aire */
    border-radius: 20px !important;
    margin-left: 1.5rem; /* Separarlo un poco del resto */
    font-family: 'Oswald', sans-serif; /* Toque deportivo */
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease-in-out;
}

.btn-acceso:hover {
    background-color: var(--color-primary) !important;
    color: var(--background-color) !important; /* Usa el fondo actual del tema */
    box-shadow: 0 0 15px var(--color-primary);
    transform: translateY(-2px);
}

/* Ajustes específicos para que el menú no desborde en móviles */
@media (max-width: 768px) {
    .header-sticky {
        padding: 0.5rem 2%;
        flex-wrap: wrap; /* Permite que el menú baje si no hay sitio */
        justify-content: space-between;
    }

    .logo img {
        height: 32px; /* Reducimos un poco el logo en móvil */
    }

    nav {
        width: 100%; /* El menú se va a la línea de abajo */
        display: flex;
        justify-content: center; /* Centra los enlaces */
        align-items: center;
        margin-top: 8px;
        gap: 2px; /* Control total del espacio entre enlaces */
    }

    nav a {
        margin: 0;
        padding: 4px 6px; /* Espacio mínimo para que sea pulsable */
        font-size: 0.72rem; /* Tamaño optimizado para móviles */
        white-space: nowrap; /* Evita que una palabra se parta en dos */
    }

    .btn-acceso {
        margin-left: 4px !important;
        padding: 3px 8px !important;
        font-size: 0.7rem !important;
        border-radius: 12px !important;
        background-color: var(--color-primary); /* Le damos fondo sólido para que destaque */
        color: var(--background-color) !important;
    }
    
    /* Ocultamos el icono de la luna en móviles muy estrechos si estorba 
       o lo dejamos fijo arriba a la derecha */
    .theme-toggle {
        padding: 0.3rem 0.5rem;
        font-size: 1rem;
    }
}
/* Un ajuste extra: si el móvil es muy pequeño (iPhone SE, etc.) */
@media (max-width: 380px) {
    nav a {
        font-size: 0.65rem;
    }
    .logo img {
        height: 30px; /* Logo más pequeño */
    }
}

/* ==================================== */
/* 2. SECCIÓN HERO                      */
/* ==================================== */

.hero-section {
    padding: 8rem 5% 8rem 5%; 
    text-align: center;
    position: relative;
    color: var(--text-color); 
    
    background-image: linear-gradient(rgba(30, 30, 47, 0.85), rgba(30, 30, 47, 0.85)), 
                      url('hero-background.jpg'); 
                      
    background-size: cover; 
    background-position: center; 
    background-attachment: fixed; 
    
    z-index: 1;
    transition: background-color 0.5s; 
}

/* AJUSTE CLAVE para el MODO CLARO */
body.light-mode .hero-section {
    background-image: linear-gradient(rgba(245, 245, 245, 0.85), rgba(245, 245, 245, 0.85)), 
                      url('assets/hero-background.jpg');
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-section h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary); 
}

.hero-section p {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

/* ============================================ */
/* 2.1. AGENDA DE PARTIDOS: ESTRUCTURA SWIPER + GRID */
/* ============================================ */

/* 1. Contenedor "Ventana" (Solo se ve lo que hay dentro) */
.swiper-agenda {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible !important; 
    /*height: auto !important;*/
    height: 1000px;
    position: relative;
    padding-bottom: 40px; 
}

/* 2. El "Tren" de días */
.swiper-agenda .swiper-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Permite que cada día tenga su altura */
    overflow: visible;
    padding-left: 40px;
    padding-right: 40px;
}

/* 3. El "Vagón" (Cada día completo) */
.swiper-agenda .swiper-slide {
    width: 100% !important; /* Cada día ocupa todo el ancho */
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Solo si estamos en la home, centramos el contenido de la agenda 
body.home-page .swiper-wrapper {
    display: flex !important;
    justify-content: center !important;
    transform: none !important;
    width: 100% !important;
}*/
body.home-page .swiper-wrapper {
    display: flex !important;
    justify-content: center !important;
    transform: none !important;
    width: 100% !important;
}

body.home-page .swiper-slide {
    width: auto !important; /* Para que no ocupe todo el ancho y se pueda centrar */
    flex-shrink: 0;
}

/* 4. Cabecera del día (Lunes, Martes...) */
/* Cabecera del día - Discreta y elegante */
.agenda-day-header {
    width: fit-content;
    margin: 0 auto 30px auto;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    color: var(--text-color); /* Gris oscuro para lectura fácil */
    padding: 5px 20px;
    /*border-bottom: 2px solid #ff6600;  Subrayado naranja fino */
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Aseguramos que el contenedor del botón respire */
.agenda-btn-container {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    margin-bottom: 50px !important;
}

/* 5. El Grid de partidos (Dentro de cada día) */
.matches-grid-v2 {
    display: grid;
    /* En PC: 3 columnas. En tablet: 2. En móvil: 1 o 2. */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* 6. La Tarjeta de Partido */
/* --- TARJETA DE PARTIDO REFINADA --- */
.match-card-live {
    background: var(--card-background);
    border: 1px solid var(--border-color); /* Añadimos borde sutil */
    border-radius: 10px;
    padding: 12px; /* Reducimos padding para quitar blanco */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px; /* Altura más contenida */
    transition: all 0.2s ease;
}

.match-card-live:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); /* Sombra suave al pasar el ratón */
    background: linear-gradient(to bottom, #ffffff, #fdfdfd);
}

/* 7. Detalles internos de la tarjeta */
/* La Pista: Ahora más visible y con estilo */
.match-court-tag {
    position: absolute;
    top: 8px;
    right: 10px; /* Cambiada a la derecha para equilibrar */
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem; /* Más grande */
    color: white;
    background: var(--color-primary); /* Color corporativo */
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* La Hora: Un poco más ajustada */
.match-time-v2 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem; /* Ligeramente más pequeña para dejar sitio */
    color: var(--text-color);
    text-align: center;
    margin: 5px 0 10px 0;
    line-height: 1;
}

/* Contenedor principal de la tarjeta: ahora en FILA */
.match-players-v2 {
    display: flex;
    flex-direction: row; /* Izquierda - Centro - Derecha */
    align-items: center; /* Alineación vertical central */
    justify-content: center;
    gap: 15px;
    width: 100%;
}

/* Asegura que el VS esté siempre en el centro exacto */
.side-public {
    flex: 1; 
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center; /* Centra los nombres verticalmente si solo hay uno */
    min-width: 0; /* Evita que nombres largos rompan el layout */
}

.side-public:first-child { text-align: right; }
.side-public:last-child { text-align: left; }

/* Nombres de los jugadores (Negro) */
.p-name {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color); /* Negro corporativo */
    text-transform: uppercase;
    text-align: center;
}
.p-partner {
    font-weight: 700;       /* Bajamos un pelín el peso de 800 a 700 */
    font-size: 0.95rem;     /* Antes estaba en 1.05rem o 1.1rem */
    color: var(--text-color);
    text-transform: uppercase;
    line-height: 1.1;       /* Espaciado entre nombres más compacto */
    display: block;
    letter-spacing: -0.2px; /* Un toque sutil de tracking para legibilidad */
}
/* El VS (Naranja corporativo) */
.p-vs {
    flex: 0 0 auto; /* Que no se estire */
    font-family: 'Oswald', sans-serif;
    color: #ff6600; /* Naranja */
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0 5px;
}

/* 8. Flechas de navegación (PC) */
.next-agenda, .prev-agenda {
    color: var(--color-primary) !important;
    top: 50px !important; /* Subirlas a la altura de la cabecera */
}

/* --- AJUSTES MÓVIL --- */
@media (max-width: 768px) {
    .matches-grid-v2 { 
        grid-template-columns: 1fr 1fr; /* Mantenemos 2 columnas */
        gap: 8px; 
        padding: 5px;
    }
    .match-time-v2 { font-size: 1.8rem; }

    .p-name {
        font-size: 0.85rem !important; /* Tamaño perfecto para lectura en mano */
    }
.match-players-v2 {
        gap: 8px;
    }
    .p-name {
        font-size: 0.8rem;
    }
    .next-agenda, .prev-agenda { display: none; } /* En móvil se desliza con el dedo */
}
#full-agenda .swiper-agenda {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }

    #full-agenda .swiper-slide {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Aseguramos que las pistas no fuercen un ancho mayor al móvil */
    #full-agenda .pista-column {
        width: 100% !important;
        min-width: 0 !important;
    }

@media (max-width: 480px) {
    .matches-grid-v2 {
        grid-template-columns: 1fr; /* 1 columna en móviles muy pequeños */
    }
}

/* Quitar espacios en blanco si el grid se estira mucho */
.matches-grid-v2 {
    gap: 15px;
    padding: 10px 0;
}

/* 1. Aseguramos que el contenedor tenga espacio abajo para los puntos */
.swiper-agenda {
    padding-bottom: 60px !important; /* Espacio extra para que los puntos no pisen las tarjetas */
}

/* 2. Posicionamos los puntos fuera del grid de partidos */
.swiper-agenda .swiper-pagination {
    bottom: 10px !important; /* Los bajamos al borde inferior del contenedor */
    left: 0;
    width: 100%;
    text-align: center;
}

/* 3. Estilo para que se vean modernos y no estorben */
.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ccc !important;
    opacity: 0.5;
    margin: 0 5px !important;
}

.swiper-pagination-bullet-active {
    background: var(--color-primary) !important;
    opacity: 1;
    width: 25px; /* Efecto alargado para el activo */
    border-radius: 5px;
}

/* Contenedor de las columnas */
.pistas-container-v2 {
    display: flex;
    flex-direction: row;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 10px;
    flex-wrap: wrap; /* En PC se mantienen en fila */
    min-height: 200px;
    overflow-x: auto; /* Permite scroll lateral suave si hay demasiadas pistas */
    justify-content: flex-start; /* Mejor empezar por la izquierda si hay muchas */
}

/* Columna de pista - Transparente */
.pista-column {
    flex: 0 1 340px;
    background: transparent; 
    padding: 0 15px;
}

/* Título de la Pista - Naranja sobre transparente */
.pista-title {
    width: 100%;
    background: transparent; /* Fondo transparente */
    color: #ff6600;          /* Tu naranja corporativo */
    text-align: center;
    padding: 10px 0;
    font-family: 'Oswald', sans-serif;
    font-weight: 800;        /* Un poco más de peso para compensar el fondo */
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
    /* Opcional: un borde muy sutil abajo si quieres separar del primer partido */
    border-bottom: 1px dashed rgba(255, 102, 0, 0.2); 
}

/* Este es el contenedor "invisible" que envuelve los partidos de una pista */
.pista-matches-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 22px; /* Aquí es donde controlas la separación entre partidos */
    align-items: center;
    padding: 10px 0 20px 0; /* Espacio arriba y abajo de la lista */
}

/* Ajuste móvil: Aquí sí permitimos que bajen */
@media (max-width: 768px) {
    .pistas-container-v2 {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: center;
    }
    .pista-column {
        width: 100%;
    }
}

.no-matches-home {
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    /* Quitamos el borde verde, usamos algo más sutil */
    background: rgba(255, 255, 255, 0.03); 
    border-radius: 12px;
}

.no-matches-text {
    font-size: 1.1rem;
    color: #ccc; /* Un gris suave */
    margin-bottom: 10px;
}

/* Opcional: añadir un icono o algo de color si quieres más personalidad */
.no-matches-container::before {
    content: "🎾"; 
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
    filter: grayscale(1);
    opacity: 0.5;
}

/* ==================================== */
/* 3. NAVEGACIÓN DE TEMPORADA Y CARRUSEL */
/* ==================================== */

.season-section {
    padding: 2rem 5%;
    text-align: center;
    background-color: var(--card-background);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.season-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem; 
    flex-wrap: wrap; 
}

/* ⬅️ Botones de Flecha (Temporada Anterior/Siguiente) */
.nav-btn {
    background-color: var(--color-primary);
    color: var(--card-background);
    border: none;
    padding: 0.5rem; 
    width: 2.5rem;   
    height: 2.5rem;  
    line-height: 1.5rem; 
    border-radius: 50%; 
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem; 
    transition: background-color 0.3s, opacity 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn:hover:not(:disabled) {
    background-color: #e64a19; 
}

.nav-btn:disabled {
    background-color: var(--border-color);
    color: var(--secondary-text-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 📅 Etiqueta de Temporada Actual */
.current-season {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem; 
    font-weight: 700;
    color: var(--text-color);
    margin: 0 1rem; 
}

/* Asegúrate de que el contenedor principal se vea */
.swiper {
    width: 100%;
    height: 450px; /* Dale una altura fija para probar */
    margin: 20px 0;
}

/* Contenedor principal para que el 3D respire */
.mySwiper {
    padding: 50px 0 !important;
    /* Crea un efecto de desvanecimiento en los laterales */
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    perspective: 1200px; /* Añade realismo al 3D */
}

/* Quitamos fondos raros de los slides */
.swiper-slide {
    background: transparent !important;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 350px !important; /* Ajusta el ancho para que se vean más tarjetas */
}

/* La tarjeta central (la enfocada) */
.swiper-slide-active {
    filter: blur(0);
    transform: scale(1.1); /* La central se hace un poco más grande */
    z-index: 10;
}

/* La tarjeta central brilla un poquito más */
.swiper-slide-active .competition-card {
    box-shadow: 0 15px 35px rgba(255, 94, 26, 0.3); /* Sombra con un toque de tu naranja */
    border: 2px solid #ff5e1a; /* Borde naranja resaltado */
    transform: scale(1.05); /* Un pelín más grande */
}

/* Efecto visual para las que están a los lados */
.swiper-slide:not(.swiper-slide-active) {
    opacity: 0.5; /* Se ven más claritas para dar foco al centro */
    filter: grayscale(30%); /* Un poco de gris para profundidad */
}

.carousel-section {
    padding: 4rem 0;
}


/* Configuración 3D del Carrusel */
.carousel-container {
    width: 320px;
    height: 300px;
    margin: 4rem auto;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: pan-y;
}

.carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    will-change: transform; /* Pre-renderiza la animación en la GPU */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) !important;
}

/* BASE DE LA TARJETA */
/* Aplicamos la sombra solo a la tarjeta, no a todo el carril */
.competition-card {
    /* Mantenemos tus transiciones y colores */
    transition: transform 0.3s, background-color 0.4s, border 0.4s, box-shadow 0.4s;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 20px var(--shadow-color);
    
    /* Ajustes para Swiper: Importante quitar position: absolute */
    position: relative; 
    width: 100%;       /* Que ocupe el ancho del slide (320px o 350px) */
    height: 250px;     /* Ajusta la altura a tu gusto */
    
    /* Mantenemos el alineado de los textos */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    word-break: break-word; 
    overflow: hidden;

    /* BORRAMOS: top, left, margin-left, margin-top y absolute */
}

/* --- ESTADOS SEGÚN FECHA (CON ALTA PRIORIDAD) --- */

/* 1. Tarjeta Pasada (Finalizada - Gris) */
div.competition-card.past {
    background-color: #f2f2f2 !important; 
    border: 1px solid #ccc !important;
    filter: grayscale(0.9);
}
div.competition-card.past .card-title, 
div.competition-card.past p {
    color: #777 !important;
}
div.competition-card.past .card-details-btn {
    background-color: #999 !important;
}

/* 2. Tarjeta Futura (Limpia - Blanco estándar) */
div.competition-card.future {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-top: none !important; /* Quitamos la franja verde */
}

/* Aseguramos que el título de las futuras use el color normal */
div.competition-card.future .card-title {
    color: var(--color-primary) !important;
}

/* 3. Tarjeta Actual (ACTIVA - Blanca/Destacada) */
div.competition-card.current {
    background-color: #ffffff !important;
    border: 2px solid #ffd700 !important; /* Dorado suave */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2) !important;
    z-index: 10;
}
/* Añadimos un pequeño indicador de "EN VIVO" */
div.competition-card.current::before {
    content: "● EN CURSO";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #e64a19;
}

/* --- ADAPTACIÓN MODO OSCURO --- */
body:not(.light-mode) div.competition-card.past {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}

/* Ajuste Modo Oscuro para Futuras: Fondo oscuro normal */
body:not(.light-mode) div.competition-card.future {
    background-color: var(--card-background) !important;
    border-color: var(--border-color) !important;
}

body:not(.light-mode) div.competition-card.future .card-title {
    color: var(--color-primary) !important;
}

/* Ajuste para Modo Oscuro: Tarjeta Actual en Dorado */
body:not(.light-mode) div.competition-card.current {
    background-color: #1e1e1e !important; /* Fondo oscuro */
    border-color: #ffcc00 !important;      /* Un dorado un poco más vibrante */
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.2) !important;
}

/* --- ELEMENTOS INTERNOS --- */

.card-title {
    font-size: 1.3rem; 
    line-height: 1.2;
    margin-bottom: 0.3rem;
    color: var(--color-primary);
}
/* Estilo para el texto entre paréntesis en las tarjetas */
.card-title .card-subtitle {
    display: block;          /* Hace que baje a una línea nueva (opcional) */
    font-size: 0.75em;       /* Un 25% más pequeño que el título */
    opacity: 0.8;            /* Un pelín más transparente */
    font-weight: 400;        /* Menos grosor que el nombre principal */
    margin-top: 5px;         /* Espacio si decides usar el display: block */
}
.card-date {
    font-weight: 300;
    font-size: 0.9rem; 
    color: var(--secondary-text-color);
    font-style: italic;
    margin-bottom: 1rem;
}

.card-details-btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: #ffffff !important; 
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    margin-top: auto;
    transition: background-color 0.3s;
}

.card-details-btn:hover {
    background-color: #e64a19;
}

.slide-btn {
    background: none;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s;
}

.slide-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

.carousel-controls {
    display: flex;             /* Activa el alineado flexible */
    justify-content: center;   /* Centra los botones horizontalmente */
    align-items: center;       /* Centra los botones verticalmente */
    gap: 20px;                 /* Separa los dos botones entre sí */
    width: 100%;               /* Que ocupe todo el ancho */
    margin-top: 2rem;          /* Espacio respecto al carrusel */
    position: relative;        /* Para que no se mueva de su sitio */
}

/* Para que los botones se vean perfectamente redondos y el icono centrado */
.slide-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;  /* Ajusta según tu gusto */
    height: 45px; /* Debe ser igual al ancho */
    border-radius: 50%;
    padding: 0;
    margin: 0;    /* Quitamos márgenes para que el GAP controle el espacio */
    touch-action: manipulation; /* Elimina retrasos en dispositivos táctiles */
}

/* ==================================== */
/* 4. RANKING Y FILTROS                 */
/* ==================================== */
.ranking-section {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.filter-controls input[type="text"],
.filter-controls select {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 250px;
}

.filter-controls input:focus,
.filter-controls select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(255, 87, 34, 0.5);
    outline: none;
}

.filter-controls select option {
    background-color: var(--card-background);
    color: var(--text-color);
}


/* Tabla */
.table-container {
    overflow-x: auto; 
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px; 
}

.ranking-table thead tr {
    background-color: var(--color-primary);
    color: #ffffff;
}

.ranking-table th {
    padding: 1rem 1rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
}

.ranking-table th:first-child { border-top-left-radius: 8px; }
.ranking-table th:last-child { border-top-right-radius: 8px; }

.ranking-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-background);
    color: var(--text-color);
}

.ranking-table tbody tr:nth-child(even) td {
    background-color: rgba(255, 87, 34, 0.05); 
}

.ranking-table tbody tr:hover td {
    background-color: rgba(255, 87, 34, 0.15); 
}

/* Destacar las primeras posiciones */
.ranking-table tbody tr:first-child td {
    font-weight: 700;
    font-size: 1.1rem;
    background-color: rgba(255, 215, 0, 0.1); 
}
.ranking-table tbody tr:nth-child(2) td,
.ranking-table tbody tr:nth-child(3) td {
    font-weight: 500;
}

/* ==================================== */
/* 5. SECCIÓN CONTACTO Y MAPA           */
/* ==================================== */

.contact-section {
    padding: 4rem 5%;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-section h2 {
    margin-bottom: 0.5rem;
}

.section-subtitle {
    margin-bottom: 3rem;
    font-weight: 300;
    color: var(--secondary-text-color);
}

/* Estilos del Mapa */
.map-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin-bottom: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color); 
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 400px; 
    transition: filter 0.5s ease;
}

/* Adaptación del Mapa para Modo Oscuro */
body:not(.light-mode) .map-container iframe {
    filter: grayscale(80%) invert(95%) hue-rotate(180deg);
}


/* Estilos del Formulario de Contacto (Dos Columnas) */
.contact-details {
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
    gap: 3rem;
    padding: 0 5%;
    text-align: left;
    max-width: 1000px;
    margin: 0 auto 4rem auto;
}

.contact-info-block,
.contact-form-container {
    flex: 1; 
    min-width: 300px;
}

.contact-form-container h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fafafa;
    color: #111;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: #0073e6;
    box-shadow: 0 0 10px rgba(0, 115, 230, 0.25);
    outline: none;
    background: #fff;
}

#contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Botón de envío del formulario */
.main-submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-primary);
    color: var(--card-background);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Oswald', sans-serif; /* Igual que el resto de la web */
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s;
}

/* Hover / efecto interactivo */
.main-submit-btn:hover {
    background-color: #e64a19; /* Igual que el hover que ya tenías */
    transform: translateY(-2px);
}

/* Estado de "procesando" */
.main-submit-btn.processing {
    position: relative;
    pointer-events: none; /* Evita múltiples clics */
    opacity: 0.8;
}

/* Spinner dentro del botón */
.main-submit-btn.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.2rem;
    height: 1.2rem;
    margin: -0.6rem 0 0 -0.6rem;
    border: 2px solid #fff; /* Color del spinner */
    border-top: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Animación del spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.contact-list {
    list-style: none;
    padding: 1rem 0;
    margin: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.contact-list li {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-list a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-list a:hover {
    text-decoration: underline;
}

.legal-note {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

/* Estilos de los Labels */
#contact-form label {
    display: block; /* Hace que el label ocupe toda la línea */
    font-weight: 500;
    margin-bottom: 0.3rem; /* Espacio pequeño antes del input */
    margin-top: 1rem; /* Espacio entre el campo anterior y el label */
    color: var(--secondary-text-color); /* Lo hacemos un poco más suave */
}

/* El primer label no necesita margen superior extra */
#contact-form label:first-of-type {
    margin-top: 0;
}

/* --- Mensajes de Feedback del Formulario (NUEVO) --- */
/* Mensajes de feedback animados */
.form-message {
    text-align: center;
    font-weight: 700;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: 'Roboto', sans-serif;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.form-message.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Éxito */
.form-message.success {
    background: linear-gradient(135deg, #d4edda, #b2f2bb);
    color: #155724;
    border-color: #28a745;
}

/* Error */
.form-message.error {
    background: linear-gradient(135deg, #f8d7da, #f5b7b1);
    color: #721c24;
    border-color: #dc3545;
}
/* ---------------------------------------------------- */

/* ==================================== */
/* 6. FOOTER                            */
/* ==================================== */
footer {
    text-align: center;
    padding: 2rem 5%;
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

/* ==================================== */
/* 7. AVISO DE COOKIES                  */
/* ==================================== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-background);
    color: var(--text-color);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 2000;
    transition: transform 0.5s ease-in-out;
}

.cookie-consent.hidden {
    transform: translateY(100%); 
}

.cookie-consent p {
    margin: 0;
    font-size: 0.9rem;
    flex-grow: 1;
    margin-right: 1rem;
}

.cookie-consent a {
    color: var(--color-primary);
    text-decoration: underline;
    margin-left: 0.5rem;
}

.cookie-accept-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s;
}

.cookie-accept-btn:hover {
    background-color: #e64a19;
}

/* ==================================== */
/* 7.5. VENTANA MODAL (POLÍTICA DE COOKIES) */
/* ==================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo semi-transparente oscuro */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000; /* Asegura que esté por encima de todo */
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    /* Usamos pointer-events: none para asegurar que no se puede interactuar con ella 
       cuando está oculta, aunque la capa esté ahí brevemente durante la transición. */
    pointer-events: none; 
}

.modal-content {
    background-color: var(--card-background);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    max-height: 80vh; /* Limita la altura de la modal */
    overflow-y: auto; /* Permite scroll si el contenido es grande */
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Efecto de entrada/salida (opcional) */
.modal-overlay.hidden .modal-content {
    transform: translateY(-50px);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--color-primary);
}

.modal-body h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* Estilos de contenido del modal (si cargas HTML simple) */
.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Media Query para móvil */
@media (max-width: 650px) {
    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }
}

/* ==================================== */
/* 8. RESPONSIVE Y MÓVIL                */
/* ==================================== */
@media (max-width: 900px) {
    /* Header */
    .header-sticky {
        padding: 1rem 3%;
    }
    nav a {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }

    /* Hero */
    .hero-section {
        padding: 6rem 5% 6rem 5%;
    }
    .hero-section h1 {
        font-size: 3rem;
    }
    .hero-section p {
        font-size: 1.2rem;
    }

    /* Carrusel */
    .carousel-container {
        transform: scale(0.9);
    }
}

@media (max-width: 800px) {
    /* Contacto: Apilar columnas */
    .contact-details {
        flex-direction: column; 
        align-items: center;
        gap: 4rem;
    }
    .contact-info-block,
    .contact-form-container {
        max-width: 100%;
        min-width: auto;
    }
}

@media (max-width: 650px) {
    /* Header: Colapsar navegación */
    .header-sticky {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .logo, .theme-toggle {
        order: 1;
    }
    nav {
        order: 2;
        width: 100%;
        margin-top: 0.5rem;
        display: flex;
        justify-content: center;
    }

    /* Hero */
    .hero-section h1 {
        font-size: 2.5rem;
    }

    /* Filtros (Stack vertical) */
    .filter-controls {
        flex-direction: column;
        gap: 0.8rem;
    }
    .filter-controls input[type="text"],
    .filter-controls select {
        width: 100%;
    }

    /* Tabla: Asegurar el scroll */
    .table-container {
        width: 100%;
    }
    
    /* Cookies: Stack vertical */
    .cookie-consent {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    .cookie-consent p {
        margin-right: 0;
    }
    .cookie-accept-btn {
        width: 100%;
    }
    
    /* Navegación de temporada en móvil */
    .current-season {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    /* Carrusel: Ajuste más agresivo para pantallas pequeñas */
    .carousel-container {
        transform: scale(0.8);
    }
}

/* ==================================== */
/* 9. MEDIA QUERIES (RESPONSIVE)        */
/* ==================================== */

@media (max-width: 768px) {
    
    /* Ajustes específicos para la sección Hero en móviles */
    .hero-section {
        /* 1. Reducir el padding vertical para que ocupe menos pantalla */
        padding: 9rem 5% 3rem 5%; 
        
        /* 2. Desactivar el efecto parallax en móviles */
        /* Esto mejora el rendimiento y la estabilidad */
        background-attachment: scroll;
        
        /* 3. Ajustar el punto focal (opcional) */
        /* Si la imagen se recorta demasiado, la centramos en la parte superior */
        background-position: center top; 
    }
    
    .hero-section h1 {
        /* Opcional: Reducir el tamaño del título para que quepa en el ancho */
        font-size: 2.5rem; 
    }
    
    .hero-section p {
        /* Opcional: Reducir el tamaño del subtítulo */
        font-size: 1.2rem;
    }
}

/* ==================================== */
/* EN PRUEBAS                           */
/* ==================================== */
/* Efecto especial de cristal para las tarjetas solo en modo oscuro */
body:not(.light-mode) .match-card-live {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Ajuste para el formulario y otros inputs en modo oscuro */
body:not(.light-mode) #contact-form input,
body:not(.light-mode) #contact-form textarea {
    background: #27293d;
    color: #ffffff;
    border-color: #3b3e5a;
}

/* Para que los nombres brillen un poco más en el cristal */
body:not(.light-mode) .p-name, 
body:not(.light-mode) .p-partner {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}


/* Contenedor principal del Swiper en la Agenda */
.swiper-agenda-container {
    width: 100%;
    padding: 20px 0 50px 0; /* Espacio para la paginación abajo */
    overflow: hidden;
    max-width: 100vw;
    margin: 0 auto;
    cursor: grab; /* Indica visualmente que se puede arrastrar */
}
.swiper-agenda-container:active {
    cursor: grabbing;
}

/* 2. IMPORTANTE: Las slides NO deben heredar el display:flex del contenedor antiguo */
.pista-column-slide {
    display: block; /* Swiper maneja el posicionamiento */
    flex-shrink: 0;  /* Evita que se encojan */
    width: 300px;   /* Dale un ancho fijo para que haya varias */
    margin-right: 20px; /* Espacio entre pistas */
}

/* 3. Asegúrate de que las pistas internas no fuercen un ancho extraño */
.pista-column {
    width: 100% !important;
    margin: 0 !important; /* Limpiamos márgenes antiguos que puedan chocar */
}

/* Estilo de los puntos de paginación de la agenda */
.swiper-pagination-agenda .swiper-pagination-bullet {
    background: var(--accent-color, #27ae60); /* Usa tu color corporativo */
    opacity: 0.5;
}

.swiper-pagination-agenda .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Responsive: En móviles muy pequeños, ajustamos el ancho */
@media (max-width: 480px) {
    .pista-column-slide {
        width: 85%; /* Para que se vea un trozo de la siguiente pista */
    }
}

/* Fuerza a que las diapositivas se pongan una al lado de la otra */
.swiper-agenda-dias .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
}

/* Evita que los partidos se desparramen fuera de su día */
.swiper-agenda-dias .swiper-slide {
    width: 100%;
    flex-shrink: 0;
    height: auto;
}

/* Oculta lo que no debe verse (el resto de días) */
.swiper-agenda-dias {
    overflow: hidden;
    position: relative;
}

.swiper-agenda-dias, 
.swiper-agenda-dias .swiper-wrapper, 
.swiper-agenda-dias .swiper-slide {
    width: 100%;
}

.agenda-page-main {
    width: 100%;
}

/* ============================================================ */
/* FIX ESPECÍFICO PARA AGENDA (PARA QUE NO SE AMONTONE)         */
/* ============================================================ */

/* 1. Forzamos el contenedor para que actúe como una ventana */
.swiper-agenda-dias {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important; 
    position: relative;
    padding: 20px 0 60px 0;
}

/* 2. El "tren" de slides: Anulamos el justify-content:center de la home */
.swiper-agenda-dias .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important; 
    transform: none; /* Swiper lo manejará por JS */
}

/* 3. Cada slide (Día): Una página independiente y centrada */
.swiper-agenda-dias .swiper-slide {
    width: 100% !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0 15px;
    box-sizing: border-box;
    /* Anulamos efectos 3D del otro carrusel */
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
}

/* 4. Flechas de navegación (AQUÍ ESTÁ EL ESTILO QUE FALTABA) */
.agenda-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    z-index: 10;
    pointer-events: none; /* No bloquea clics en tarjetas */
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.agenda-button-prev, .agenda-button-next {
    pointer-events: auto; /* Las flechas sí reciben clics */
    width: 45px;
    height: 45px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.agenda-button-prev:hover, .agenda-button-next:hover {
    background-color: #e64a19;
    transform: scale(1.1);
}

/* Iconos de las flechas */
.agenda-button-prev::after { content: 'prev'; font-family: swiper-icons; font-size: 18px; }
.agenda-button-next::after { content: 'next'; font-family: swiper-icons; font-size: 18px; }

/* Ocultar flechas en móviles si molestan mucho */
@media (max-width: 768px) {
    .agenda-nav { display: none; }
}