body {
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

.navbar-brand {
    font-weight: 700;
}

.card {
    border: 0;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.btn-gradient {
    background-image: linear-gradient(to right, #4e54c8 0%, #8f94fb 51%, #4e54c8 100%);
    background-size: 200% auto;
    color: white;
    transition: 0.5s;
    border: none;
}

.btn-gradient:hover {
    background-position: right center;
    color: #fff;
    text-decoration: none;
}

.theme-switch {
    cursor: pointer;
}

/* --- Gaya Papan Peringkat Standar --- */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background-color 0.2s;
    border: 1px solid #eee;
}
[data-bs-theme="dark"] .leaderboard-item { border-color: #444; }
.leaderboard-item:hover { background-color: rgba(0,0,0,0.05); }
[data-bs-theme="dark"] .leaderboard-item:hover { background-color: rgba(255,255,255,0.1); }
.leaderboard-rank { font-size: 1.2rem; font-weight: 700; min-width: 50px; text-align: center; }
.leaderboard-avatar { width: 40px; height: 40px; border-radius: 50%; margin: 0 15px; background-color: #eee; object-fit: cover; }
.leaderboard-name { font-weight: 600; flex-grow: 1; }
.leaderboard-score { font-size: 1.1rem; font-weight: 700; color: #4e54c8; }
[data-bs-theme="dark"] .leaderboard-score { color: #8f94fb; }

/* --- Gaya Baru untuk Podium Juara (Revisi) --- */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Align items to the bottom */
    gap: 5px; /* Reduce gap slightly */
    padding: 30px 10px 0 10px; /* More padding top, no padding bottom */
    min-height: 350px;
    background: linear-gradient(to top, #e9ecef, #ffffff);
    border-radius: 8px;
    overflow: hidden; /* Prevent shadows from being cut off */
}
[data-bs-theme="dark"] .podium-container {
    background: linear-gradient(to top, #1c1e22, #343a40);
}

.podium-rank {
    width: 33%;
    max-width: 200px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Content starts from the bottom up */
}

/* Urutan visual: 2, 1, 3 */
.podium-rank.rank-1 { order: 2; }
.podium-rank.rank-2 { order: 1; }
.podium-rank.rank-3 { order: 3; }

.podium-avatar-container {
    position: relative;
    margin-bottom: 10px;
    transform: translateY(10px); /* Move avatar slightly up */
    transition: transform 0.3s ease;
}

.podium-rank:hover .podium-avatar-container {
    transform: translateY(0px) scale(1.05);
}

.podium-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 5px solid; /* Border color will be set per rank */
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    object-fit: cover;
}

.podium-rank-number {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
[data-bs-theme="dark"] .podium-rank-number {
    border-color: #495057;
}

.podium-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    word-break: break-word;
    color: #fff;
    padding: 5px 0;
}

.podium-score {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.podium-base {
    width: 100%;
    border-radius: 8px 8px 0 0;
    padding: 15px 10px;
    color: #fff;
    font-weight: bold;
    position: relative;
    display: flex;
    justify-content: flex-end; /* Align content to the bottom */
    align-items: center;
    flex-direction: column;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.2);
}

.podium-trophy {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

/* Ketinggian dan Warna Podium */
.podium-rank.rank-1 .podium-base { height: 180px; background-image: linear-gradient(to top, #fcc200, #f7d04a); }
.podium-rank.rank-2 .podium-base { height: 140px; background-image: linear-gradient(to top, #c0c0c0, #d8d8d8); }
.podium-rank.rank-3 .podium-base { height: 100px; background-image: linear-gradient(to top, #cd7f32, #e69c4d); }

/* Warna Border Avatar & Nomor Peringkat */
.podium-rank.rank-1 .podium-avatar { border-color: #FFD700; }
.podium-rank.rank-2 .podium-avatar { border-color: #C0C0C0; }
.podium-rank.rank-3 .podium-avatar { border-color: #CD7F32; }

.podium-rank.rank-1 .podium-rank-number { background-color: #FFD700; }
.podium-rank.rank-2 .podium-rank-number { background-color: #C0C0C0; }
.podium-rank.rank-3 .podium-rank-number { background-color: #CD7F32; }

/* Penyesuaian untuk peringkat 1 */
.podium-rank.rank-1 .podium-avatar {
    width: 110px;
    height: 110px;
}
.podium-rank.rank-1 .podium-name {
    font-size: 1.3rem;
}

/* Gaya untuk Halaman Review */
.review-correct {
    border-left: 5px solid #198754; /* Hijau */
}
.review-incorrect {
    border-left: 5px solid #dc3545; /* Merah */
}

/* **BARU:** Gaya untuk Tombol Scroll */
.scroll-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scroll-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s, visibility 0.3s;
    border: none;
    opacity: 0;
    visibility: hidden;
    font-size: 1.2rem;
}

.scroll-btn.show {
    opacity: 1;
    visibility: visible;
}

.scroll-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
