/* ===================================================
   RESULTADOS: MATCH CARD STYLES (Mobile First)
=================================================== */
body.modal-open {
    overflow: hidden;
    height: 100vh; /* Opcional, ayuda a asegurar el bloqueo en algunos navegadores */
}

.results-section {
    padding: 20px 15px;
}

.results-grid {
    display: grid;
    /* 1 columna en móvil, 2 en tablet/desktop */
    grid-template-columns: 1fr; 
    gap: 20px;
    margin-top: 20px;
}

.match-card {
    background-color: var(--neutral-white);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
    border-left: 5px solid var(--secondary-gray); 
    transition: all 0.3s ease;
    
    /* Animación simple de entrada */
    opacity: 0;
    transform: translateY(20px);
    animation: m3-entry 0.4s cubic-bezier(0.05, 0.7, 0.1, 1.0) forwards;
    
    /* 🔑 CLAVE: Añadimos flex para organizar la cabecera */
    display: flex; 
    flex-direction: column;
}

/* Definición de la animación M3 */
@keyframes m3-entry {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95); /* Un ligero escalado hace que se sienta más orgánico */
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.match-card {
    opacity: 0;
    will-change: transform, opacity;
    animation: m3-entry 0.4s cubic-bezier(0.05, 0.7, 0.1, 1.0) forwards;
}

/* Retraso progresivo para las tarjetas */
.match-card:nth-child(1) { animation-delay: 0.05s; }
.match-card:nth-child(2) { animation-delay: 0.10s; }
.match-card:nth-child(3) { animation-delay: 0.15s; }
.match-card:nth-child(4) { animation-delay: 0.20s; }
.match-card:nth-child(5) { animation-delay: 0.25s; }

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap; /* Permite que el tag de la categoría baje en pantallas muy pequeñas */
}

.match-date {
    font-size: 0.85rem;
    color: var(--secondary-gray-light);
    margin: 0; 
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}
/* Estilo del icono de calendario */
.match-date i {
    margin-right: 5px;
    color: var(--primary-green-light);
}

/* 🔑 CLAVE: ESTILO BONITO PARA LA CATEGORÍA (El tag) */
.match-category-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: var(--accent-gold); /* Fondo dorado/amarillo */
    color: var(--secondary-gray); 
    padding: 3px 8px;
    border-radius: 5px; /* Bordes redondeados */
    flex-shrink: 0; /* Evita que se encoja */
    /* margin-left: auto; */ /* Ya no es necesario si usamos justify-content: space-between en match-header */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.match-date {
    font-size: 0.85rem;
    color: var(--secondary-gray-light);
    margin-bottom: 10px;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}

.teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    gap: 10px;
}

.team-local, .team-visitante {
    font-size: 1rem;
    font-weight: 700;
    flex: 1; 
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.team-local {
    text-align: right;
}

.team-visitante {
    text-align: left;
}

.score {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--secondary-black);
    padding: 0 10px;
    min-width: 50px; 
    text-align: center;
}

/* ESTILOS DE ESTADO (Colores Landetxa) */

/* Landetxa ganó */
.match-card.status-won {
    border-left-color: var(--status-won); 
    box-shadow: 0 4px 15px rgba(0, 125, 76, 0.2); 
}

/* Landetxa perdió */
.match-card.status-lost {
    border-left-color: var(--status-lost);
}

/* Empate */
.match-card.status-draw {
    border-left-color: var(--status-draw);
}

/* Pendiente (vs) */
.match-card.status-pending {
    border-left-color: var(--status-pending);
}

/* Media Query para Tablet y Desktop */
@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr 1fr; /* 2 columnas */
    }
    
    .match-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    }
}


.modal-overlay {
    /* 🔑 CLAVE: Oculto por defecto */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro */
    z-index: 1000; /* Asegura que esté por encima de todo */
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto; /* Permite scroll si el contenido es largo */
}

.modal-overlay.active {
    /* 🔑 CLAVE: Muestra el modal */
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: var(--neutral-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 100%;
    position: relative;
    /* Animación de entrada */
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-content-container { 
    /* Si tienes un contenedor dentro del overlay */
    max-height: 90vh; /* Permite que el contenedor no ocupe 100% de alto */
    width: 90%;
    max-width: 600px;
    /* ... (resto de estilos de centrado/fondo blanco) ... */
    
    /* 🔑 CLAVE: Flex-direction column si necesitas que los elementos internos fluyan */
    display: flex; 
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: scale(1); /* Animación al mostrarse */
}

/* Estilos de la lista de partidos dentro del modal */
#full-results-list {
    margin-top: 20px;
    display: grid;
    /* El mismo diseño de cuadrícula que tienes en la home, pero para el modal */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    
    
}

.close-btn:hover {
    background-color: var(--status-lost);
}

.modal-content h2 {
    color: var(--primary-green-dark);
    font-family: 'Oswald', sans-serif;
    text-align: center;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding-top: 5px;
}

.full-height-scroll {
    max-height: 70vh; 
    overflow-y: auto;
    padding-right: 10px; 
}

/* Estilos de las tarjetas dentro del modal (más compactos) */
.full-list-modal .match-card {
    padding: 12px;
    border-radius: 8px;
    box-shadow: none;
    border-bottom: 1px dashed var(--neutral-bg);
}

.full-list-modal .match-card:last-child {
    border-bottom: none;
}


/* En caso de que tengas media query, refuerza el estilo */
@media (min-width: 768px) {
    #full-results-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablet */
    }
}

/* ===================================================
   ESTILO DE BOTONES
=================================================== */

.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    border: none;
    min-width: 150px; 
    min-height: 40px; 
}

.primary-button {
    background-color: var(--primary-green); /* Color principal verde */
    color: var(--neutral-white);
    border: 2px solid var(--primary-green-dark); 
}

/* Estilo para el botón de VER TODOS en la sección de resultados */
#view-all-results-btn {
    margin: 20px auto 0;
    display: block; /* Centrar y ocupar su propia línea */
    max-width: 300px;
}

.primary-button:hover {
    background-color: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); /* Sombra más fuerte al pasar el ratón */
}

#view-next-matches-btn {
    /* 🔑 CLAVE: Separación superior */
    margin: 25px auto 0; /* 25px arriba, auto para centrar, 0 abajo */
    
    /* Asegura que el margin 'auto' funcione */
    display: block; 
    
    /* Limita el ancho para que se vea como un botón y no ocupe todo */
    max-width: 300px;

}

/* Botón Secundario (Dentro del Modal: Ver Próximos Partidos / Volver) */
.secondary-button {
    background-color: var(--neutral-white);
    color: var(--primary-green-dark);
    border: 2px solid var(--primary-green-dark);
    box-shadow: none;
    padding: 8px 15px; 
    font-size: 0.9rem;
}

.secondary-button:hover {
    background-color: var(--primary-green-light);
    color: var(--neutral-white);
    border-color: var(--primary-green-light);
    transform: translateY(-1px);
}

/* Estilo para el botón de VER TODOS que está en la sección de resultados de la Home */
.results-section .button {
    margin: 20px auto 0;
    display: block; 
    max-width: 300px;
}

#all-results-popup {
    /* CLAVE: Oculto por defecto */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Fondo oscuro */
    backdrop-filter: blur(8px);
    z-index: 1000; /* Asegura que esté por encima de todo */
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;

    

}

/* CLAVE: Muestra el modal al añadir la clase 'active' con JS */
#all-results-popup.active {
    visibility: visible;
    opacity: 1;
}

/* Contenido del modal */
#all-results-popup .modal-content {
    background-color: var(--neutral-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 100%;
    position: relative;
    /* Permite scroll dentro del contenido y limita altura */
    max-height: 90vh; 
    overflow-y: auto; 
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#all-results-popup.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-gray);
    cursor: pointer;
    z-index: 1001; /* Debe estar por encima del contenido */
}



