/* --- ESTILOS GENERALES --- */
body {
    background: #ffffff;
    color: #f6f6f6;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 900px;
    margin: 20px auto;
    margin-top: 80px;
}

/* --- NAVBAR BASE --- */
.navbar {
    position: fixed;
    display: flex;
    top: 0;
    left: 0;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    background-color: #f6f6f6;
    padding: 10px 20px;
    z-index: 1000;
}

.logoLiga {
    display: flex;
    align-items: center;
    color: #e63946;
}

.logoLiga img {
    max-height: 60px;
    width: auto;
    margin-right: 10px;
}

.logoLiga h1 a {
    color: #e63946;
    font-size: 20px;
    text-decoration: none;
    font-family: "Oswald", sans-serif;
    letter-spacing: 1px;
    font-weight: 500;
    transition: color 0.3s;
}

.logoLiga h1 a:hover {
    color: #f0f0f0;
}

/* Menu Links - ESCRITORIO */
.nav-links {
    list-style: none;
    display: flex;
    flex-direction: row;
    background-color: transparent;
    padding-right: 40px;
}

.nav-links li {
    margin: 0 10px;
}

.nav-links li a {
    color: #2c2c2c;
    text-decoration: none;
    font-size: 18px;
    padding: 10px;
    transition: color 0.3s, background-color 0.3s;
    border-radius: 1px;
    font-family: 'Righteous', sans-serif;
}

.nav-links li a:hover {
    color: #ffffff;
    background-color: #ef3340;
}

/* --- Menú hamburguesa (inicialmente oculto en escritorio) --- */
.menu-toggle {
    display: none;
}

/* --- BANNER JORNADA --- */
.banner-jornada {
    background-color: #3ebcb1;
    border-top: -20px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    color: white;
    font-family: 'Righteous', sans-serif;
    flex-wrap: wrap;
    gap: 15px;
    min-height: 250px;
}

/* --- MERCADO DE FICHAJES --- */
.mercado-fichajes {
    background-color: #ff5900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 70px;
    padding: 20px 40px;
    color: #ffffff;
    font-family: 'Righteous', sans-serif;
    flex-wrap: wrap;
    min-height: 20px;
}

.mercado-scroll {
    display: flex;
    white-space: nowrap;
    animation: scroll-infinite 20s linear infinite;
}

.mercado-scroll span {
    color: white;
    font-family: 'Righteous', sans-serif;
    font-size: 22px;
    font-weight: bold;
    padding: 0 50px;
    letter-spacing: 2px;
}

@keyframes scroll-infinite {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.banner-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0px 20px;
    position: relative;
}

.banner-left h1 {
    font-size: 68px;
    margin: 0;
    text-align: left;
}

.fecha-jornada {
    font-size: 22px;
    margin: 0 0 5px 0;
    font-family: 'Oswald', sans-serif;
    color: #ffffffcc;
}

/* --- Tarjetas de partidos --- */
.partido-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 15px;
    min-height: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    gap: 8px;
}

.partido-card img.escudo {
    height: 24px;
    width: 24px;
}

.partido-card .linea {
    width: 3px;
    height: 30px;
    background-color: var(--linea-color, #fff);
}

.partido-card .nombre-equipo {
    font-size: 16px;
}

.partido-card .vs {
    font-weight: bold;
    color: #fff;
    opacity: 0.8;
    margin: 0 8px;
}

/* --- Banner Right --- */
.banner-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- Resultados de partidos --- */
.resultado-partido-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.partido-card-resultado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(62, 188, 177, 0.15);
    padding: 15px 25px;
    border-radius: 12px;
    gap: 10px;
    min-width: 200px;
    max-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.partido-card-resultado:hover {
    transform: scale(1.05);
}

.resultado-superior {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.partido-card-resultado img.escudo-equipo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.partido-card-resultado .resultado {
    font-size: 22px;
    font-weight: bold;
    color: #ef3340;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.partido-card-resultado p {
    font-size: 13px;
    color: #5c5b5b;
    font-family: 'Righteous', sans-serif;
    text-align: center;
    margin: 0;
}

/* --- TABLAS --- */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #2c2c2c;
    box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    overflow-x: auto;
}

thead {
    background-color: #e63946;
    color: white;
}

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #444;
    color: black;
}

tbody tr:nth-child(even) {
    background-color: #333;
}

tbody tr:hover {
    background-color: #444;
}

/* --- FOOTER --- */
footer {
    background-color: #2c2c2c;
    text-align: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

.footer-logo img {
    max-width: 550px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
}

.footer-separator {
    border: none;
    border-top: 2px solid #ccc;
    margin: 0 auto;
    width: 80%;
}

.footer-title {
    color: white;
    font-family: 'Righteous', sans-serif;
    font-weight: bold;
    font-size: 30px;
    text-align: left;
    margin: 40px 10% 0 10%;
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 0px;
    background-color: #2c2c2c;
}

.logo-container {
    margin: 0 35px;
}

.logo-container img {
    width: 100%;
    height: auto;
    display: block;
}

.logo-cecume {
    max-width: 200px;
}

.logo-merida {
    max-width: 150px;
}

.logo-safyde {
    max-width: 120px;
}

.disabled-link {
    color: gray;
    pointer-events: none;
    cursor: default;
    text-decoration: none;
}

.resultado-wrapper {
    background-color: #c5efe9;
    width: 100%;
    padding: 10px 0;
    box-sizing: border-box;
}

.selector-jornada {
    position: absolute;
    bottom: -60px;
    left: 20px;
    padding: 6px 10px;
    border: 2px solid #dc2500;
    border-radius: 8px;
    background: transparent;
    color: #dc2500;
    font-family: 'Righteous', sans-serif;
    cursor: pointer;
    font-size: 1rem;
}

.selector-jornada option {
    color: black;
}

/* --- BOTONES --- */
.btn-acta {
    margin-top: 10px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #C8102E 0%, #A00D25 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.btn-aplazado {
    margin-top: 10px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #c87810 0%, #a0870d 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.btn-inci {
    margin-top: 0px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #480000 0%, #470119 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.btn-inci:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 0, 5, 0.5);
}

.btn-inci:active {
    transform: translateY(0);
}

.btn-acta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.5);
}

.btn-acta:active {
    transform: translateY(0);
}

.btn-aplazado:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 200, 16, 0.5);
}

.btn-aplazado:active {
    transform: translateY(0);
}

/* --- ÁRBITRO --- */
.arbitro-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    font-weight: bold;
    font-size: 1.2em;
    flex-wrap: wrap;
    gap: 10px;
    text-align: center;
}

.escudo-arbitro {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    padding-bottom: 10px;
}

.texto-arbitro {
    color: #5a5a5a;
    font-family: 'Righteous', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    text-align: center;
    padding-bottom: 10px;
}

/* --- RESPONSIVE PARA MÓVILES (max-width: 900px) --- */
@media (max-width: 900px) {
    .banner-jornada {
        flex-direction: column;
        align-items: center;
        min-height: auto;
        padding: 15px 20px;
        border-bottom: 0px solid;
    }

    .banner-left h1 {
        font-size: 52px;
        text-align: center;
    }

    .fecha-jornada {
        font-size: 18px;
        text-align: center;
        margin-bottom: 8px;
    }

    .banner-right {
        width: 100%;
    }

    .partido-card {
        width: 94%;
        justify-content: space-between;
    }

    .resultado-partido {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    .partido-card-resultado {
        width: 90%;
        min-width: auto;
    }

    .resultado-superior {
        gap: 15px;
    }

    .partido-card-resultado img.escudo-equipo {
        width: 40px;
        height: 40px;
    }

    .partido-card-resultado .resultado {
        font-size: 22px;
        text-align: center;
    }

    /* --- Navbar responsive --- */
    .menu-toggle {
        display: block;
        font-size: 30px;
        color: #2c2c2c;
        cursor: pointer;
        margin-right: 2px;
        z-index: 9999;
        position: fixed;
        top: 12px;
        right: 16px;
        background: transparent;
        padding: 6px;
        line-height: 1;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        z-index: 2000;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li a {
        font-size: 24px !important;
        color: #2c2c2c !important;
    }

    body,
    html {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Logo del navbar (30% más pequeño) */
    .logoLiga img {
        max-height: 42px;
        padding-top: 2px;
    }

    /* Logo del footer (50% más pequeño) */
    .footer-logo img {
        max-width: 275px;
    }

    /* Texto "Colaboradores" (30% más pequeño) */
    .footer-title {
        font-size: 21px;
    }

    .footer-logos {
        flex-direction: column;
        gap: 20px;
    }

    .logo-container {
        margin: 10px 0;
    }

    .selector-jornada {
        position: static;
        bottom: -267px;
        left: -70px;
        padding: 6px 10px 6px 122px;
        border: 2px solid #dc2500;
        border-radius: 8px;
        background: transparent;
        color: #dc2500;
        font-family: 'Righteous', sans-serif;
        cursor: pointer;
        font-size: 1rem;
        right: 0px;
        margin-left: 0px;
        margin-top: 6px;
        margin-bottom: 9px;
    }

    .arbitro-info {
        flex-direction: column;
        font-size: 1em;
        margin-top: 15px;
    }

    .escudo-arbitro {
        width: 2em;
        height: 2em;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .texto-arbitro {
        font-size: 1em;
        line-height: 1.3;
    }
}

/* --- ESCRITORIO (min-width: 901px) --- */
@media (min-width: 901px) {
    .menu-toggle {
        display: none !important;
    }

    .nav-links {
        display: flex !important;
        position: static !important;
        height: auto !important;
        width: auto !important;
        background: transparent !important;
        flex-direction: row !important;
    }

    .nav-links.show {
        display: flex !important;
    }
}

/* --- RANGO ESPECÍFICO 769px - 900px --- */
@media (min-width: 769px) and (max-width: 900px) {
    .menu-toggle {
        display: block !important;
    }

    .nav-links:not(.show) {
        display: none !important;
    }

    .nav-links.show {
        display: flex !important;
    }
}

/* ==========================================
   ANIMACIÓN MERCADO DE FICHAJES
   ========================================== */

/* Overlay que cubre toda la pantalla */
.mercado-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00d0ff 0%, #e63946 100%);
    background-size: 200% 200%;
    animation: slideInFromRight 0.8s ease-out forwards, gradientMove 4s ease infinite;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Animación del gradiente */
@keyframes gradientMove {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Animación de entrada desde la derecha */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Contenedor del texto */
.mercado-content {
    text-align: center;
    color: white;
    font-family: 'Righteous', sans-serif;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
    position: relative;
}

/* Logo de la liga (aparece primero) */
.mercado-logo {
    opacity: 0;
    transform: scale(0.5);
    animation: logoAppear 0.6s ease-out 0.5s forwards;
    margin-bottom: 30px;
}

.mercado-logo img {
    height: 120px;
    width: auto;
}

@keyframes logoAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animación del texto desde abajo */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Título principal */
.mercado-titulo {
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 3px;
    margin: 0 20px;
    background: linear-gradient(45deg, #ffffff, #ffe5e5, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Subtítulo con fechas */
.mercado-subtitulo {
    font-size: 24px;
    font-family: 'Oswald', sans-serif;
    margin-top: 15px;
    letter-spacing: 2px;
    opacity: 0.9;
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

/* Animación de salida hacia arriba */
.mercado-overlay.hide {
    animation: slideOutUp 0.8s ease-in forwards;
}

@keyframes slideOutUp {
    to {
        transform: translateY(-100%);
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .mercado-logo img {
        height: 80px;
    }

    .mercado-titulo {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .mercado-subtitulo {
        font-size: 18px;
        letter-spacing: 1.5px;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    .mercado-logo img {
        height: 60px;
    }

    .mercado-titulo {
        font-size: 24px;
        letter-spacing: 1px;
    }

    .mercado-subtitulo {
        font-size: 16px;
        letter-spacing: 1px;
        padding: 6px 15px;
    }
}

/* ==========================================
   BANNER MERCADO INFERIOR (DEBAJO DEL NAVBAR)
   ========================================== */

.mercado-banner-inferior {
    position: fixed;
    top: 70px;
    /* Justo debajo del navbar */
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(90deg, #00d0ff 0%, #e63946 25%, #00d0ff 50%, #e63946 75%, #00d0ff 100%);
    background-size: 400% 100%;
    animation: gradientBannerMove s linear infinite;
    z-index: 999;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Animación del degradado en movimiento horizontal */
@keyframes gradientBannerMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

/* Animación de entrada desde arriba */
.mercado-banner-inferior.show {
    animation: slideDownBanner 0.6s ease-out forwards;
}

@keyframes slideDownBanner {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulso sutil en el banner */
@keyframes pulseBannerSutil {

    0%,
    100% {
        background-color: #e63946;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    50% {
        background-color: #d62839;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Contenedor del texto en movimiento */
.mercado-banner-scroll {
    display: flex;
    white-space: nowrap;
    animation: scrollText 15s linear infinite;
    height: 100%;
    align-items: center;
}

/* Animación de scroll infinito */
@keyframes scrollText {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Texto del banner */
.mercado-banner-texto {
    color: white;
    font-family: 'Righteous', sans-serif;
    font-size: 22px;
    font-weight: bold;
    padding: 0 50px;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    .mercado-banner-inferior {
        height: 45px;
    }

    .mercado-banner-texto {
        font-size: 18px;
        padding: 0 40px;
    }
}

/* Ajustar el margen del contenido principal para que no quede tapado */
.banner-jornada {
    margin-top: 50px;
}

@media (max-width: 768px) {
    .banner-jornada {
        margin-top: 45px;
    }
}

/* --- AVISO CLIMATOLÓGICO --- */
.aviso-clima {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Separación entre emoji y texto */
    
    background-color: #ef3340; /* Naranja advertencia */
    color: #ffffff;
    
    /* Tipografía */
    font-family: 'Righteous', sans-serif;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    
    /* Dimensiones y Bordes */
    width: fit-content; /* IMPORTANTE: El ancho se ajusta al contenido */
    max-width: 90%; /* Para que no se salga en móviles */
    padding: 12px 30px;
    border-radius: 8px;
    border: 2px solid #10ccbf; /* Borde naranja más oscuro */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    
    /* Posicionamiento */
    margin: 0 auto; /* Centrado horizontal */
    margin-top: 130px; /* Espacio para salvar el Navbar y Fichajes */
    margin-bottom: 20px; /* Separación con el banner de jornada */
    position: relative;
    z-index: 50;
}

.aviso-icono {
    font-size: 24px; /* Tamaño del emoji */
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* AJUSTE IMPORTANTE: Modificar el margen del banner jornada existente */
/* Como el aviso ya tiene margen superior, quitamos el del banner para que no quede un hueco enorme */
.banner-jornada {
    margin-top: 0 !important; 
}

/* --- RESPONSIVE DEL AVISO --- */
@media (max-width: 768px) {
    .aviso-clima {
        margin-top: 110px; /* Ajuste para móvil */
        font-size: 13px; /* Texto un poco más pequeño */
        padding: 10px 20px;
        flex-direction: column; /* En pantallas muy pequeñas, emoji arriba texto abajo */
        gap: 5px;
    }
    
    .aviso-icono {
        font-size: 20px;
    }
}