/* ============================================
   MATHFUN SD - STYLE UTAMA
   Versi Kompatibel untuk Semua Halaman
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', Arial, sans-serif;
    background: #fffaf4;
    color: #304438;
    min-height: 100vh;
}

/* ============================================
   NAVBAR (KOMPATIBEL DENGAN SEMUA HALAMAN)
============================================ */

.navbar {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Quicksand', Arial, sans-serif;
}

.navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar .nav-logo {
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
    color: #667eea;
}

.navbar .nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.navbar .nav-menu li a {
    text-decoration: none;
    color: #304438;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.navbar .nav-menu li a:hover {
    background: #f0f4ff;
    color: #667eea;
}

.navbar .nav-menu li a.active {
    color: #e77991;
}

/* Logo di navbar (untuk kompatibilitas) */
.logo {
    font-size: 22px;
    font-weight: bold;
    color: #667eea;
}

/* ============================================
   HERO
============================================ */

.hero {
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 10%;
    gap: 50px;
    margin-top: 70px;
}

.hero-text {
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 30px;
    background: #f9dfe7;
    color: #8b5365;
    font-size: 14px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero h1 span {
    display: block;
    color: #71896f;
}

.hero p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 30px;
    color: #657069;
}

.hero .btn-primary {
    border: none;
    padding: 15px 28px;
    border-radius: 12px;
    background: #71896f;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.hero .btn-primary:hover {
    transform: translateY(-3px);
    background: #5d765c;
}

/* HERO CARD */
.hero-card {
    width: 350px;
    min-height: 350px;
    background: #f7e5ea;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.character {
    font-size: 120px;
    margin-bottom: 20px;
}

.hero-card h3 {
    font-size: 25px;
    margin-bottom: 10px;
}

.hero-card p {
    color: #657069;
    line-height: 1.6;
}

/* ============================================
   SECTION
============================================ */

.kelas-section,
.fitur {
    padding: 90px 10%;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title span {
    font-size: 13px;
    font-weight: bold;
    color: #a26878;
    letter-spacing: 2px;
}

.section-title h2 {
    font-size: 36px;
    margin: 12px 0;
}

.section-title p {
    color: #707a73;
}

/* ============================================
   KELAS
============================================ */

.kelas-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.kelas-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    transition: 0.3s;
    cursor: pointer;
}

.kelas-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.kelas-icon {
    font-size: 55px;
    margin-bottom: 15px;
}

.kelas-card h3 {
    font-size: 23px;
    margin-bottom: 8px;
}

.kelas-card p {
    color: #778078;
    margin-bottom: 20px;
}

.kelas-card button {
    border: none;
    background: #f2cbd6;
    color: #674957;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

/* ============================================
   FITUR
============================================ */

.fitur-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.fitur-card {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    text-decoration: none;
    color: #304438;
    transition: 0.3s;
    cursor: pointer;
    display: block;
}

.fitur-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.fitur-card div {
    font-size: 45px;
    margin-bottom: 15px;
}

.fitur-card h3 {
    margin-bottom: 10px;
}

.fitur-card p {
    color: #747d76;
    line-height: 1.5;
}

/* ============================================
   FOOTER
============================================ */

footer {
    background: #304438;
    color: white;
    text-align: center;
    padding: 50px 20px;
    margin-top: 40px;
}

footer h3 {
    margin-bottom: 10px;
}

footer p {
    margin: 8px;
}

.copyright {
    font-size: 13px;
    opacity: 0.7;
}

/* ============================================
   HALAMAN KELAS
============================================ */

.kelas-header {
    padding: 70px 10% 20px;
}

.kelas-header .section-title {
    margin-bottom: 20px;
}

.kelas-header h1 {
    font-size: 42px;
}

/* ============================================
   MATERI
============================================ */

.materi-section {
    padding: 50px 10% 100px;
}

.materi-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.materi-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    transition: 0.3s;
}

.materi-card:hover {
    transform: translateY(-7px);
}

.materi-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.materi-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.materi-card p {
    color: #737c76;
    line-height: 1.6;
    margin-bottom: 20px;
}

.materi-card button {
    border: none;
    background: #71896f;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.materi-card button:hover {
    background: #5d765c;
}

/* ============================================
   MATERI PREVIEW (DI INDEX)
============================================ */

.materi-preview {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.materi-preview h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
}

.materi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.materi-link {
    text-decoration: none;
}

.materi-grid .materi-card {
    background: white;
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.materi-grid .materi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.materi-grid .materi-card .icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.materi-grid .materi-card h3 {
    color: #333;
    margin: 5px 0;
}

.materi-grid .materi-card p {
    color: #666;
    font-size: 0.8rem;
    margin: 5px 0;
}

.materi-grid .materi-card .badge {
    display: inline-block;
    padding: 3px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* ============================================
   DETAIL MATERI
============================================ */

.detail-materi-section {
    padding: 40px 20px;
}

.detail-materi-container {
    max-width: 900px;
    margin: 0 auto;
}

.detail-box {
    background: white;
    padding: 30px;
    margin-bottom: 25px;
    border-radius: 22px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.07);
}

.detail-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.detail-box p {
    line-height: 1.8;
}

.detail-box li {
    margin-bottom: 10px;
}

.contoh-angka {
    background: #fff5f8;
    padding: 20px;
    margin: 20px 0;
    border-radius: 15px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.8;
}

.contoh-pertanyaan {
    padding: 20px;
    background: #f7f7f7;
    border-radius: 15px;
    margin-bottom: 15px;
}

.contoh-jawaban {
    padding: 20px;
    background: #f0fff4;
    border-radius: 15px;
    margin-bottom: 15px;
}

.contoh-pembahasan {
    padding: 20px;
    background: #fff9e8;
    border-radius: 15px;
}

.detail-action {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.kembali-button,
.latihan-button {
    display: inline-block;
    padding: 13px 22px;
    border-radius: 14px;
    border: none;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.kembali-button {
    background: #eeeeee;
    color: #444;
}

.latihan-button {
    background: #f3bfd0;
    color: white;
}

/* ============================================
   GAME / LATIHAN SOAL
============================================ */

.game-body {
    background: #fff8f1;
    min-height: 100vh;
}

.game-navbar {
    height: 82px;
    background: #fffdf9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid #eee4da;
    position: sticky;
    top: 0;
    z-index: 100;
}

.game-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 30px;
}

.game-logo strong {
    display: block;
    font-size: 22px;
    color: #304438;
}

.game-logo strong span {
    color: #e98298;
}

.game-logo small {
    display: block;
    font-size: 10px;
    color: #8c8178;
}

.game-navbar nav {
    display: flex;
    gap: 25px;
}

.game-navbar nav a {
    text-decoration: none;
    color: #304438;
    font-weight: 600;
    font-size: 14px;
}

.game-navbar nav a.active {
    color: #e77991;
}

.student-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* GAME LAYOUT */
.game-layout {
    display: grid;
    grid-template-columns: 250px minmax(500px, 1fr) 300px;
    gap: 22px;
    padding: 25px;
    max-width: 1600px;
    margin: auto;
}

/* SIDEBAR KIRI */
.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.class-info {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(60,40,20,0.06);
}

.plant-icon {
    font-size: 40px;
}

.class-info h2 {
    margin: 5px 0;
    color: #304438;
}

.class-info p {
    color: #7b807c;
    margin-bottom: 18px;
}

.progress-track {
    height: 10px;
    background: #e6e6e6;
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #7da66f;
    border-radius: 20px;
    transition: 0.4s;
}

.side-progress span {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #777;
}

.side-menu {
    background: white;
    border-radius: 18px;
    padding: 10px;
}

.side-menu-item {
    width: 100%;
    display: flex;
    gap: 15px;
    align-items: center;
    border: none;
    background: transparent;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    color: #304438;
    font-size: 15px;
}

.side-menu-item:hover {
    background: #fff0f3;
}

.side-menu-item.active {
    background: #ffd6df;
    color: #a84c63;
    font-weight: bold;
}

.mascot-box {
    position: relative;
    min-height: 180px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.mascot {
    font-size: 100px;
}

.speech {
    position: absolute;
    top: 0;
    right: 0;
    background: #fff1d9;
    padding: 12px 15px;
    border-radius: 20px;
    font-size: 13px;
}

/* AREA QUIZ */
.quiz-area {
    min-width: 0;
}

.quiz-top {
    display: grid;
    grid-template-columns: 130px 1fr 100px;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.back-button {
    border: none;
    background: #e7f2df;
    color: #304438;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
}

.quiz-label {
    text-align: center;
}

.quiz-label span {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    background: #e5f1d8;
    color: #467044;
    font-weight: bold;
    font-size: 14px;
}

.quiz-label h1 {
    margin: 7px 0;
    color: #182d21;
    font-size: 28px;
}

.quiz-label p {
    color: #777;
    margin: 0;
}

.timer {
    background: #ffe0e5;
    color: #d84f69;
    padding: 12px;
    border-radius: 15px;
    font-weight: bold;
    text-align: center;
}

/* QUESTION CARD */
.question-card {
    background: white;
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(60,40,20,0.08);
}

.question-header {
    margin-bottom: 15px;
}

.question-number {
    display: inline-block;
    padding: 9px 14px;
    border-radius: 10px;
    background: #ffe4e8;
    color: #c94d65;
    font-weight: bold;
    font-size: 14px;
}

.question-box {
    background: #fff9f0;
    border-radius: 18px;
    padding: 35px 20px;
    text-align: center;
    border: 1px solid #f1dfc9;
}

.question-box h2 {
    font-size: 32px;
    color: #253b2b;
}

/* ANSWER */
.answer-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 25px;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 18px;
    background: white;
    border: 2px solid #e8e4df;
    border-radius: 15px;
    padding: 15px 18px;
    font-size: 21px;
    text-align: left;
    cursor: pointer;
    transition: 0.2s;
}

.answer-option:hover {
    border-color: #e9869b;
    transform: translateX(3px);
}

.answer-option.selected {
    border-color: #7da66f;
    background: #f0f8e9;
}

.answer-option.correct {
    border-color: #6ca45d;
    background: #e5f6df;
}

.answer-option.wrong {
    border-color: #df687c;
    background: #ffe5e9;
}

.answer-letter {
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #ffd8df;
    color: #a84d61;
    font-weight: bold;
}

/* FEEDBACK */
.feedback {
    min-height: 50px;
    margin-top: 15px;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
    text-align: center;
}

.feedback.success {
    background: #e4f5dd;
    color: #47763d;
}

.feedback.error {
    background: #ffe4e8;
    color: #bd4e63;
}

/* BOTTOM */
.quiz-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.skip-button {
    border: 1px solid #ddd;
    background: white;
    padding: 13px 20px;
    border-radius: 12px;
    cursor: pointer;
    color: #555;
}

.submit-button {
    border: none;
    background: #6d9b5d;
    color: white;
    padding: 14px 30px;
    border-radius: 13px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

.submit-button:hover {
    background: #587f4b;
}

/* SIDEBAR KANAN */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(60,40,20,0.06);
}

.info-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 17px;
}

.info-title span {
    margin-left: auto;
    color: #777;
    font-size: 13px;
}

.big-progress {
    height: 13px;
    background: #e7e7e7;
    border-radius: 20px;
    overflow: hidden;
}

.big-progress div {
    height: 100%;
    width: 0%;
    background: #7ca86c;
    transition: 0.4s;
}

.lives {
    font-size: 25px;
    letter-spacing: 4px;
}

.points {
    font-size: 32px;
    font-weight: bold;
    color: #d99a1e;
}

.hint-card p {
    color: #667069;
    line-height: 1.6;
    margin: 0;
}

.motivation-card {
    background: #ffe3e8;
    border-radius: 18px;
    padding: 22px;
    text-align: center;
    color: #65434d;
    line-height: 1.5;
}

.challenge-card {
    background: white;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(60,40,20,0.06);
}

.challenge-card h3 {
    margin-bottom: 15px;
}

.challenge-card p {
    font-size: 13px;
    color: #555;
}

/* RESULT */
.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40,50,40,0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.result-overlay.show {
    display: flex;
}

.result-card {
    background: white;
    width: 420px;
    max-width: 90%;
    padding: 40px;
    border-radius: 25px;
    text-align: center;
}

.result-icon {
    font-size: 75px;
}

.result-card h2 {
    font-size: 30px;
    margin: 10px 0;
}

.result-score {
    margin: 25px 0;
}

.result-score span {
    display: block;
    color: #777;
}

.result-score strong {
    font-size: 55px;
    color: #6d9b5d;
}

.result-detail {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 25px;
}

.result-detail strong {
    display: block;
    font-size: 25px;
}

.result-detail span {
    color: #777;
}

.back-home {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    margin-top: 15px;
    padding: 10px;
    cursor: pointer;
    color: #666;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 200px 1fr;
    }
    
    .right-sidebar {
        grid-column: 2;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .kelas-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fitur-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .materi-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Navbar */
    .navbar .nav-menu {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .navbar .nav-menu li a {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Hero */
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 60px 6%;
        margin-top: 100px;
    }
    
    .hero h1 {
        font-size: 42px;
    }
    
    .hero-card {
        width: 100%;
    }
    
    /* Grids */
    .kelas-container {
        grid-template-columns: 1fr;
    }
    
    .fitur-container {
        grid-template-columns: 1fr;
    }
    
    .materi-container {
        grid-template-columns: 1fr;
    }
    
    .materi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Game */
    .game-navbar nav {
        display: none;
    }
    
    .student-profile {
        display: none;
    }
    
    .game-layout {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .game-sidebar {
        display: none;
    }
    
    .right-sidebar {
        grid-column: auto;
        grid-template-columns: 1fr;
    }
    
    .quiz-top {
        grid-template-columns: 1fr;
    }
    
    .quiz-label {
        order: -1;
    }
    
    .timer {
        width: 100px;
        margin-left: auto;
    }
    
    /* Detail */
    .detail-action {
        flex-direction: column;
    }
    
    .kembali-button,
    .latihan-button {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .navbar .nav-menu {
        gap: 5px;
    }
    
    .navbar .nav-menu li a {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .materi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-card {
        padding: 25px;
    }
    
    .result-detail {
        gap: 30px;
    }
}

/* ============================================
   UTILITY
============================================ */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ============================================
   ANIMASI UNTUK NOTIFIKASI
============================================ */

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}