/* ============================================
   TABLA DE POSICIONES COMPLETA - V29.0
   Community League Chile
   ============================================ */

/* SECCIÓN PRINCIPAL */
.tabla-posiciones-section {
    background: var(--negro-principal, #0A0A0A);
    padding: 80px 0;
    position: relative;
}

.tabla-posiciones-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dorado-principal, #D4AF37), transparent);
}

/* FILTROS DE TORNEO */
.tabla-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.torneo-filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gris-oscuro, #1A1A1A);
    border: 2px solid var(--gris-medio, #888);
    border-radius: 8px;
    color: var(--blanco-puro, #FFF);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.torneo-filter-btn:hover {
    border-color: var(--dorado-principal, #D4AF37);
    transform: translateY(-2px);
}

.torneo-filter-btn.active {
    background: var(--dorado-principal, #D4AF37);
    border-color: var(--dorado-principal, #D4AF37);
    color: var(--negro-principal, #0A0A0A);
}

/* CONTENEDOR DE TABLA */
.tabla-wrapper {
    background: var(--gris-oscuro, #1A1A1A);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* TABLA */
.tabla-posiciones-full {
    width: 100%;
    border-collapse: collapse;
}

.tabla-posiciones-full thead {
    background: var(--dorado-principal, #D4AF37);
    color: var(--negro-principal, #0A0A0A);
}

.tabla-posiciones-full thead th {
    padding: 1rem 0.75rem;
    font-weight: 700;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.tabla-posiciones-full tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.tabla-posiciones-full tbody tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

.tabla-posiciones-full td {
    padding: 1rem 0.75rem;
    text-align: center;
    color: var(--blanco-puro, #FFF);
}

/* COLUMNAS */
.pos-col {
    width: 60px;
}

.equipo-col {
    text-align: left !important;
    min-width: 200px;
}

.num-col {
    width: 60px;
}

.pts-col {
    width: 80px;
    font-size: 1.1rem;
    color: var(--dorado-principal, #D4AF37);
}

/* POSICIÓN */
.pos-num {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    background: var(--dorado-principal, #D4AF37);
    color: var(--negro-principal, #0A0A0A);
    border-radius: 50%;
    font-weight: 700;
}

/* EQUIPO INFO */
.equipo-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.equipo-logo-mini {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
}

.equipo-logo-placeholder {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    font-size: 1.2rem;
}

.equipo-nombre {
    font-weight: 600;
    color: var(--blanco-puro, #FFF);
}

/* DIFERENCIA DE GOLES */
.positivo {
    color: #4CAF50;
    font-weight: 600;
}

.negativo {
    color: #F44336;
    font-weight: 600;
}

/* ZONAS DE CLASIFICACIÓN */
.zona-campeon {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3) 0%, transparent 100%) !important;
    border-left: 4px solid var(--dorado-principal, #D4AF37);
}

.zona-clasificacion {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.2) 0%, transparent 100%) !important;
    border-left: 4px solid #4CAF50;
}

.zona-descenso {
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.2) 0%, transparent 100%) !important;
    border-left: 4px solid #F44336;
}

/* LEYENDA */
.tabla-leyenda {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gris-medio, #888);
    font-size: 0.9rem;
}

.leyenda-color {
    width: 24px;
    height: 16px;
    border-radius: 4px;
}

.leyenda-color.zona-campeon {
    background: var(--dorado-principal, #D4AF37);
}

.leyenda-color.zona-clasificacion {
    background: #4CAF50;
}

.leyenda-color.zona-descenso {
    background: #F44336;
}

/* FOOTER DE TABLA */
.tabla-footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.tabla-footer p {
    color: var(--blanco-puro, #FFF);
    margin: 0;
}

/* LOADING STATE */
.loading-tabla {
    padding: 4rem;
    text-align: center;
}

.loading-tabla .loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--dorado-principal, #D4AF37);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-tabla p {
    color: var(--gris-medio, #888);
}

/* EMPTY STATE */
.empty-state {
    padding: 4rem;
    text-align: center;
    color: var(--gris-medio, #888);
}

/* ERROR STATE */
.error-state {
    padding: 4rem;
    text-align: center;
    color: var(--gris-medio, #888);
}

.btn-retry {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--dorado-principal, #D4AF37);
    border: none;
    border-radius: 8px;
    color: var(--negro-principal, #0A0A0A);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-retry:hover {
    transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .tabla-posiciones-section {
        padding: 60px 0;
    }
    
    .tabla-filters {
        gap: 0.5rem;
    }
    
    .torneo-filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .tabla-wrapper {
        overflow-x: auto;
    }
    
    .tabla-posiciones-full {
        font-size: 0.85rem;
    }
    
    .tabla-posiciones-full thead th,
    .tabla-posiciones-full td {
        padding: 0.75rem 0.5rem;
    }
    
    .equipo-col {
        min-width: 150px;
    }
    
    .equipo-logo-mini,
    .equipo-logo-placeholder {
        width: 28px;
        height: 28px;
    }
    
    .equipo-nombre {
        font-size: 0.85rem;
    }
    
    .pos-num {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 0.85rem;
    }
    
    .tabla-leyenda {
        gap: 1rem;
    }
    
    .tabla-footer {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .num-col {
        width: 45px;
    }
    
    .pts-col {
        width: 60px;
    }
    
    .equipo-col {
        min-width: 120px;
    }
}
