/* ===================================================
   SECCIÓN DE CLASIFICACIÓN - INTEGRAL & MOBILE FIRST
=================================================== */

#clasificacion {
    background-color: var(--secondary-black);
    color: var(--secondary-black);
    padding: var(--spacing-3xl) var(--spacing-lg);
    position: relative;
    box-shadow: inset 0 8px 10px -8px rgba(0, 0, 0, 0.15);
}

#clasificacion::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    pointer-events: none;
    z-index: 0;
}

#clasificacion > * { position: relative; z-index: 1; }

/* Controles de filtro */
.filter-controls {
    max-width: 320px;
    margin: 0 auto var(--spacing-2xl) auto;
    text-align: center;
}

.filter-controls label {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--neutral-white);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.5px;
}

#select-categoria {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--primary-green);
    color: var(--neutral-white);
    border: 3px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-2xl) var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* ===================================================
   TARJETA Y TÍTULO DE CATEGORÍA
=================================================== */
.clasificacion-card {
    background: var(--neutral-white);
    padding: 20px 5px 10px 5px; 
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-top: 5px solid var(--primary-green); /* Cambiado a verde para contraste */
    margin: 30px 0;
}

.clasificacion-title {
    color: var(--secondary-black);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Subrayado elegante */
.clasificacion-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent-gold);
    margin: 8px auto 0;
    border-radius: 10px;
}

/* ===================================================
   TABLA PRO: EQUILIBRIO DE ESPACIOS
=================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; 
}

/* NUEVO REPARTO: Nombre 48% para dar aire a los números */
.col-pos { width: 8%; }
.col-equipo { width: 48%; } 
.col-pts { width: 10%; }
.col-stat { width: 6.8%; } /* Un poco más de aire para J, G, E, P, GF, GC */

.table thead th {
    background-color: var(--primary-green);
    color: white;
    font-size: 0.55rem;
    padding: 10px 0;
    text-transform: uppercase;
    font-weight: 700;
}

.table td {
    padding: 12px 0;
    font-size: 0.72rem;
    border-bottom: 1px solid #f2f2f2;
    text-align: center;
    vertical-align: middle;
}

.team-name-cell {
    text-align: left !important;
    padding-left: 6px !important;
    font-weight: 600;
    font-size: 0.75rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--secondary-black);
}

/* ===================================================
   FILA LANDETXA: DORADO INSTITUCIONAL CONTINUO
=================================================== */

/* 1. Aplicamos el fondo a la fila entera (tr) */
.table tr.equipo-destacado {
    /* 1. Unificamos el fondo: Usamos el degradado preparado para el brillo */
    background: linear-gradient(90deg, #f7e0b5, #fffcf5, var(--accent-gold), #f7e0b5) !important;
    background-size: 200% 100% !important;
    
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.05);

    /* 2. COMBINAMOS LAS ANIMACIONES */
    /* filaEntrada: la que ya tenías para que aparezca una tras otra */
    /* brilloDorado: el efecto de luz infinita */
    animation: 
        filaEntrada 0.5s ease-out forwards, 
        brilloDorado 5s infinite linear !important;
    
    /* 3. Forzamos que sea visible (por si el 'forwards' de la otra animación falla) */
    opacity: 1 !important; 
}

/* La animación del brillo */
@keyframes brilloDorado {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* 2. Aseguramos que las celdas hereden el fondo y no tengan cortes */
.table tr.equipo-destacado td {
    background: transparent !important; 
    color: var(--primary-green-dark) !important; /* Texto en verde oscuro para máximo contraste */
    font-weight: 800 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding-top: 14px;
    padding-bottom: 14px;
}

/* 3. El icono de la estrella */
.clasificacion-star {
    color: var(--primary-green-dark);
    margin-right: 4px;
    font-size: 0.7rem;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.5));
}

/* 4. Ajuste de la columna de Puntos dentro de la fila destacada */
.table tr.equipo-destacado td.col-pts {
    background: rgba(255, 255, 255, 0.2) !important; /* Resalte extra para los puntos */
}

/* Redondeado de las esquinas de la fila (opcional pero elegante) */
.table tr.equipo-destacado td:first-child { border-radius: 6px 0 0 6px; }
.table tr.equipo-destacado td:last-child { border-radius: 0 6px 6px 0; }

/* 1. Definimos la animación de entrada */
@keyframes filaEntrada {
    from {
        opacity: 0;
        transform: translateY(15px); /* Viene desde 15px abajo */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Aplicamos la animación a todas las filas del cuerpo de la tabla */
.table tbody tr {
    opacity: 0; /* Empezamos invisibles */
    animation: filaEntrada 0.5s ease-out forwards;
}

/* 3. El "Efecto Cascada": Retraso progresivo fila por fila */
/* Ajustamos los tiempos para que sea fluido (0.05s entre cada una) */
.table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.table tbody tr:nth-child(2) { animation-delay: 0.15s; }
.table tbody tr:nth-child(3) { animation-delay: 0.2s; }
.table tbody tr:nth-child(4) { animation-delay: 0.25s; }
.table tbody tr:nth-child(5) { animation-delay: 0.3s; }
.table tbody tr:nth-child(6) { animation-delay: 0.35s; }
.table tbody tr:nth-child(7) { animation-delay: 0.4s; }
.table tbody tr:nth-child(8) { animation-delay: 0.45s; }
.table tbody tr:nth-child(9) { animation-delay: 0.5s; }
.table tbody tr:nth-child(10) { animation-delay: 0.55s; }
/* Si tienes más de 10 filas, puedes seguir añadiendo o dejar que las demás salgan al final */
.table tbody tr:nth-child(n+11) { animation-delay: 0.6s; }

@keyframes brilloDorado {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

