/* Cabecera de resultados (Subtítulo + Link) */
.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 0 auto 0 auto;
    max-width: 1200px; /* Mismo ancho que la tabla */
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.ranking-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: #fff;
    margin: 0;
}

.view-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: opacity 0.3s;
}

.view-all-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Tabla de Resultados */
.ranking-table-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px 30px; /* Reducimos padding lateral interno */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 1200px; 
    margin: 20px auto 0 auto; /* Centra el bloque en la sección */
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ranking-table thead th {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: var(--primary);
    padding: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    width: 8%;
}

.ranking-table tbody tr {
    transition: background 0.3s ease;
}

.ranking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02); /* Efecto sutil al pasar el mouse */
}

.ranking-table tbody td {
    padding: 15px 10px;
    color: #eee;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    width: 6%;
}

.ranking-table thead th:nth-child(1),
.ranking-table tbody td:nth-child(1) {
	width: 7%;
}

.ranking-table tbody td:nth-child(1) {
    text-align: right;
    padding-right: 20px;
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
    width: 26%;
    text-align: left;
}

.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) {
    width: 15%;
    text-align: left;
}

.ranking-table th:nth-child(4),
.ranking-table td:nth-child(4) {
    width: 14%;
    text-align: left;
}

.ranking-table th:nth-child(5),
.ranking-table td:nth-child(5) {
    width: 8%;
}

.ranking-table-results-link {
    display: inline-block;
    color: #eee;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.ranking-table-results-link:hover {
    color: var(--primary);
}

/* Ajuste responsivo */
@media (max-width: 768px) {
    #ranking.section {
        padding-left: 10px;
        padding-right: 10px;
    }
    .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .view-all-link {
        font-size: 0.75rem;
    }
    .ranking-table-container, .ranking-header {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    .ranking-table thead {
        display: none; /* Ocultamos cabecera en móvil para diseño tipo lista */
    }
    .ranking-table tbody td {
        padding: 12px 5px; /* Padding mínimo para que quepa todo */
        font-size: 0.8rem;  /* Fuente más pequeña */
    }
    .ranking-table tbody td:nth-child(2) {
        white-space: nowrap;
    }
    .ranking-table-category-badge {
        padding: 3px 6px;
        font-size: 0.75rem;
        display: inline-block;
        white-space: nowrap; /* Evita que el nombre de la categoría se rompa */
    }
    .ranking-table-results-link {
        font-size: 0.7rem;
        padding: 5px 0; /* Sin padding lateral, solo el borde inferior */
        white-space: nowrap;
    }
}
