

/* Hero Section */
.hero {
    position: relative;
    height: 500px;
    background: url('/public/bgmath.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.03);
}

/* Welcome Section */
.welcome-section {
    background: white;
    padding: 60px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-content {
    flex: 1;
}

.welcome-content h2 {
    color: #0047AB;
    font-size: 28px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.welcome-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

.welcome-image {
    flex: 1;
    text-align: center;
}

.welcome-image img {
    max-width: 100%;
    height: auto;
}

.btn-yellow {
    display: inline-block;
    background: #FFD700;
    color: #333;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    margin-top: 20px;
}

.btn-yellow:hover {
    background: #FFC700;
}

/* Yellow Bar */
.yellow-bar {
    background: #FFD700;
    padding: 40px 30px;
    text-align: center;
}

/* Leaderboard Section */
.leaderboard-section {
    background: #fff;
    padding: 40px 24px;
    max-width: 1100px;
    margin: 40px auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(16,24,40,0.06);
}

.section-title {
    text-align: center;
    font-size: 28px;
    color: #0047AB;
    margin-bottom: 20px;
    font-weight: 700;
}

/* removed old podium/rankings styles (cleaned) */

/* Mata Pelajaran Section */
.subjects-section {
    background: white;
    padding: 60px 30px;
}

.subjects-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
}

.subjects-grid {
    flex: 2;
}

.subjects-grid h3 {
    color: #FF0000;
    font-size: 24px;
    margin-bottom: 30px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.subject-card {
    background: #f8f8f8;
    border: 2px solid #0047AB;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.subject-icon {
    width: 60px;
    height: 60px;
    background: #FFD700;
    border-radius: 10px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.subject-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.subject-class {
    font-size: 12px;
    color: #666;
}

.sidebar-info {
    flex: 1;
}

.info-lomba {
    background: #FFD700;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.info-lomba h3 {
    color: #FF0000;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 25px;
}

.lomba-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
    align-items: stretch;
    /* Membuat semua card sama tinggi */
}

.lomba-card {
    flex: 1;
    background: white;
    border: 3px solid #FF0000;
    border-radius: 15px;
    padding: 10px;
    max-width: 350px;
    height: auto;
    display: flex;
    /* Tambahkan ini */
    flex-direction: column;
    /* Tambahkan ini */
}

.lomba-card img {
    width: 100%;
    height: 100%;
    /* Ubah dari auto ke 100% */
    object-fit: fill;
    /* Menjaga aspect ratio poster */
    border-radius: 10px;
}

.btn-red {
    display: inline-block;
    background: #DC143C;
    color: white;
    padding: 12px 35px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
}

.btn-red:hover {
    background: #B71C1C;
}

/* Partner Section */
.partner-section {
    background: white;
    padding: 60px 30px;
    text-align: center;
}

.partner-content {
    max-width: 600px;
    margin: 0 auto;
}

.partner-image {
    margin-bottom: 30px;
}

.partner-image img {
    max-width: 100%;
    height: auto;
}

.partner-content h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 25px;
    font-weight: bold;
}

@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .leaderboard-container,
    .subjects-container {
        flex-direction: column;
    }

    .lomba-cards {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    nav ul {
        flex-wrap: wrap;
    }

    .welcome-section {
        flex-direction: column;
        text-align: center;
    }

    .podium-container {
        flex-wrap: wrap;
    }

    .lomba-cards {
        flex-direction: column;
    }
}

/* Improved Leaderboard styles (override older rules) */
.leaderboard-section {
    background: #ffffffcc; /* slight translucency */
    padding: 28px 18px;
    max-width: 1100px;
    margin: 36px auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.06);
}

.leaderboard-filter {
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.leaderboard-filter button {
    background: transparent;
    border: 1px solid rgba(0,71,171,0.08);
    color: #0047AB;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.leaderboard-filter button.active {
    background: #0047AB;
    color: #fff;
    box-shadow: 0 6px 18px rgba(2,6,23,0.08);
}

.leaderboard-list {
    display: grid;
    gap: 12px;
    max-width: 820px;
    margin: 0 auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: linear-gradient(180deg,#fff,#fbfdff);
    border: 1px solid rgba(2,6,23,0.04);
}

.leaderboard-item .rank {
    min-width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #0047AB;
    background: rgba(102,126,234,0.06);
    border-radius: 6px;
}

.leaderboard-item .name {
    flex: 1;
    font-weight: 700;
    color: #0f172a;
}

.leaderboard-item .score {
    color: #6b21a8;
    font-weight: 700;
}

/* Top-3 special styles */
.leaderboard-item.gold {
    border-color: rgba(255,215,0,0.28);
}
.leaderboard-item.gold .rank {
    background: linear-gradient(180deg,#ffd54a,#ffd700);
    color: #7a4d00;
}
.leaderboard-item.gold .medal-icon { font-size: 22px; margin-left: 8px; }

.leaderboard-item.silver {
    border-color: rgba(192,192,192,0.18);
}
.leaderboard-item.silver .rank {
    background: linear-gradient(180deg,#e0e0e0,#c0c0c0);
    color: #333;
}
.leaderboard-item.silver .medal-icon { font-size: 20px; margin-left: 6px; }

.leaderboard-item.bronze {
    border-color: rgba(205,127,50,0.16);
}
.leaderboard-item.bronze .rank {
    background: linear-gradient(180deg,#e6b089,#cd7f32);
    color: #4b2b16;
}
.leaderboard-item.bronze .medal-icon { font-size: 20px; margin-left: 6px; }

/* Podium layout */
.leaderboard-row {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    justify-content: center;
}

.podium-container {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex: 0 0 520px;
    justify-content: center;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.podium-slot .podium-avatar-wrap {
    position: relative;
}

.podium-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.9);
    box-shadow: 0 6px 18px rgba(2,6,23,0.08);
}

.podium-slot.first .podium-avatar { width: 110px; height: 110px; }
.podium-slot.second .podium-avatar,
.podium-slot.third .podium-avatar { width: 92px; height: 92px; }

.podium-rank {
    position: absolute;
    right: -8px;
    bottom: -8px;
    background: #0047AB;
    color: #fff;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-weight: 800;
    z-index: 4;
}

.podium-meta { text-align: center; }
.podium-name { font-weight: 700; color: #0f172a; }
.podium-score { color: #6b21a8; font-weight: 700; }

.leaderboard-list-right {
    flex: 1 1 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow: auto;
    padding-left: 6px;
}

/* Podium base bars */
.podium-base {
    width: 100%;
    border-radius: 8px 8px 4px 4px;
    margin-top: -6px; /* tuck under avatar */
    box-shadow: 0 8px 18px rgba(2,6,23,0.08) inset;
}

.podium-slot.first .podium-base {
    height: 92px;
    background: linear-gradient(180deg, #fff2cc, #ffd54a);
    width: 160px;
}
.podium-slot.second .podium-base {
    height: 72px;
    background: linear-gradient(180deg, #f0f0f0, #d0d0d0);
    width: 140px;
}
.podium-slot.third .podium-base {
    height: 60px;
    background: linear-gradient(180deg, #f4e6d0, #d9a66b);
    width: 120px;
}

.podium-slot { display: flex; flex-direction: column; align-items: center; }
.podium-avatar-wrap { z-index: 2; }
.podium-base { z-index: 1; }

/* ensure podium avatar sits visually above the base */
.podium-avatar { position: relative; z-index: 3; }

@media (max-width: 920px) {
    .leaderboard-row { flex-direction: column; align-items: center; }
    .podium-container { order: 1; flex: none; }
    .leaderboard-list-right { order: 2; width: 100%; max-width: 700px; }
}

@media (max-width: 600px) {
    .leaderboard-filter { gap: 6px; }
    .leaderboard-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .leaderboard-item .rank { min-width: 36px; height: 36px; border-radius: 6px; }
}