/* css/leaderboard.css */

/* --- VARIABEL WARNA (Serasi dengan Profile) --- */
:root {
    --primary-color: #023047;
    --accent-color: #219ebc;
    --bg-gradient-1: #8ecae6;
    --bg-gradient-2: #219ebc;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    min-height: 100vh;
    overflow-y: auto;
}

.background-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }

.leaderboard-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
.lb-header { text-align: center; margin-bottom: 20px; color: white; }
.page-title { margin: 10px 0 5px; font-weight: 900; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.subtitle { margin: 0; opacity: 0.9; font-size: 14px; }

.back-btn {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
    color: white; padding: 8px 15px; border-radius: 20px; cursor: pointer;
    backdrop-filter: blur(5px); font-size: 14px; margin-bottom: 10px;
}
.back-btn:hover { background: rgba(255,255,255,0.4); }

/* --- KARTU LEADERBOARD --- */
.lb-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 70vh; /* Tinggi tetap agar bisa scroll di dalam */
}

.lb-list-header {
    display: flex;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #eee;
    font-weight: bold;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}
.col-rank { width: 40px; text-align: center; }
.col-user { flex: 1; padding-left: 10px; }
.col-stats { width: 100px; text-align: right; }

/* --- LIST ITEMS --- */
.lb-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.lb-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}
.lb-item:hover { background: #f1f8fc; }

/* Styling Ranking */
.rank-badge {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-weight: bold; color: #555;
    margin-right: 15px; font-size: 14px;
}

/* Juara 1-3 */
.top-1 .rank-badge { background: var(--gold); color: white; box-shadow: 0 2px 5px rgba(255, 215, 0, 0.4); font-size: 16px; }
.top-2 .rank-badge { background: var(--silver); color: white; }
.top-3 .rank-badge { background: var(--bronze); color: white; }

/* User Info */
.user-info { flex: 1; display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.user-name { font-weight: 700; color: #023047; font-size: 15px; }
.top-1 .user-name { color: #d4af37; } /* Emas Gelap */

/* Stats Info */
.stats-info { text-align: right; }
.lvl-text { display: block; font-size: 11px; color: #888; font-weight: bold; }
.xp-text { color: var(--accent-color); font-weight: 800; font-size: 14px; }

/* Loading */
.loading { text-align: center; padding: 40px; color: #888; }

/* --- MY RANK BAR (Sticky Bottom) --- */
.my-rank-bar {
    background: #023047;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    z-index: 10;
}
.my-rank-bar img { width: 35px; height: 35px; border-radius: 50%; margin-right: 10px; border: 2px solid white; }
.my-rank-bar .rank-pos { font-size: 18px; font-weight: bold; width: 40px; text-align: center; color: #ffd700; }
.my-rank-bar .rank-xp { margin-left: auto; font-weight: bold; color: #8ecae6; }
.hidden { display: none !important; }

/* Scrollbar */
.lb-list::-webkit-scrollbar { width: 6px; }
.lb-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }