/* Estilos específicos para la Clasificación del Juego de Trivia */

.leaderboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 15px;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.leaderboard-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.leaderboard-header h1 i {
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(246, 224, 94, 0.4));
}

.leaderboard-header p {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 8px;
}

/* SISTEMA DE PESTAÑAS (TABS) */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.tab-btn {
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-card-hover);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* CONTENIDO DE PESTAÑAS */
.leaderboard-pane {
    display: none;
    animation: fade-in 0.4s ease;
}

.leaderboard-pane.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* PODIUM DE LOS TRES PRIMEROS (VISTA PREMIUM) */
.podium-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .podium-section {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.podium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.podium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Orden visual en móvil, en escritorio el 2do va a la izquierda, 1ro al centro, 3ro a la derecha */
.podium-1 {
    order: 2;
    border: 2px solid var(--accent);
    background: linear-gradient(180deg, var(--bg-card) 60%, rgba(246, 224, 94, 0.05) 100%);
}

.podium-2 {
    order: 1;
    border: 1px solid #cbd5e1;
}

.podium-3 {
    order: 3;
    border: 1px solid #d97706;
}

@media (max-width: 768px) {
    .podium-1 { order: 1; }
    .podium-2 { order: 2; }
    .podium-3 { order: 3; }
}

.podium-rank {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.podium-1 .podium-rank { background: #facc15; color: #1e293b; } /* Oro */
.podium-2 .podium-rank { background: #9ca3af; } /* Plata */
.podium-3 .podium-rank { background: #d97706; } /* Bronce */

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.podium-1 .podium-avatar { border-color: #facc15; width: 95px; height: 95px; }

.podium-username {
    font-size: 18px;
    font-weight: 750;
    color: var(--text-main);
    margin-bottom: 5px;
}

.podium-score {
    font-size: 26px;
    font-weight: 850;
    color: var(--primary);
    line-height: 1.2;
}

.podium-score span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
}

.podium-stats {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
    padding-top: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.podium-stat-val {
    font-weight: 750;
    color: var(--text-main);
}

/* TABLA DE POSICIONES GENERAL */
.leaderboard-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.8px;
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 14.5px;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tbody tr {
    transition: background var(--transition-fast);
}

.leaderboard-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.col-rank {
    width: 70px;
    font-weight: 850;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12.5px;
    font-weight: 800;
}

.rank-badge-1 { background: rgba(250, 204, 21, 0.15); color: #b45309; }
.rank-badge-2 { background: rgba(156, 163, 175, 0.15); color: #4b5563; }
.rank-badge-3 { background: rgba(217, 119, 6, 0.15); color: #78350f; }

.col-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.user-name-link {
    color: var(--text-main);
    font-weight: 650;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.user-name-link:hover {
    color: var(--primary);
}

.col-score {
    font-weight: 800;
    color: var(--primary);
}

.col-center {
    text-align: center;
}

.col-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
    font-size: 13.5px;
}

.empty-leaderboard {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-leaderboard i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
}
