* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
    color: #333;
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ================= Sidebar ================= */

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #eaeaea;
    padding: 20px;
    flex-shrink: 0;
    min-height: 100vh; /* Membuat sidebar ikut memanjang memenuhi tinggi layar */
    box-sizing: border-box; /* Supaya padding tidak membuat lebarnya melebihi 260px */
}

.logo-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
}

.logo-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 12px;
}

.logo-area h2 {
    font-size: 24px;
    line-height: 1.2;
    color: #2c3e50;
}

.sidebar-jargon {
    font-size: 12px;
    font-style: italic;
    color: #888;
    text-align: center;
    margin-top: 5px;
}

.logo-area span {
    color: #d39e69;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #666;
    padding: 12px 15px;
    border-radius: 10px;
    transition: .3s;
}

.nav-menu li.active a,
.nav-menu a:hover {
    background: #fdf5ef;
    color: #b87333;
}

/* ================= Main ================= */

.main-content {
    flex: 1;
    padding: 40px;
}

.top-header {
    background: white;
    padding: 25px 30px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,.05);
}

.welcome-text h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: #8B5E3C;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 15px;
}

.welcome-text p {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.8;
    max-width: 720px;
}


.progress-bar-bg {
    width: 260px;
    max-width: 100%;
    height: 8px;
    background: #ececec;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar-bg.small {
    width: 100%;
    margin-bottom: 15px;
}

.progress-bar-fill {
    height: 100%;
    background: #d39e69;
}

/* ================= User ================= */

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.support-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 20px;
    background: #fdf5ef;
    color: #b87333;
    cursor: pointer;
    transition: .3s;
}

.support-btn:hover {
    background: #d39e69;
    color: white;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: #eee;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ================= Cards ================= */

.main-content {
    flex: 1;
    padding: 40px;
    width: 100%; /* Pastikan mengambil ruang penuh */
    box-sizing: border-box;
}

.section-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Membagi halaman menjadi 2 kolom */
    gap: 20px;
    width: 100%;
}

/* Membuat kartu video musik (elemen pertama) melebar penuh di atas */
.section-container > .card:first-child {
    grid-column: 1 / -1; /* Mengambil seluruh kolom yang tersedia (full width) */
}



.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,.05);
    transition: .3s;
}

.card:hover {
    transform: translateY(-6px);
}

.card-img-placeholder{
    width:100%;
    height:180px;
    background:#f8efe7;
    border-radius:16px;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
    margin-bottom:18px;
}

/* Untuk ikon */
.card-img-placeholder i{
    font-size:60px;
    color:#b8865c;
}

/* Untuk gambar */
.card-img-placeholder img{
    width:100%;
    height:100%;
    object-fit:cover;

}

.card h3 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.card p {
    flex: 1;
    color: #666;
    margin-bottom: 20px;
}

.card-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #777;
    font-size: 13px;
}

.btn-resume {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d39e69;
    background: #d39e69;
    color: white;
    cursor: pointer;
    transition: .3s;
}

.btn-resume:hover {
    background: white;
    color: #d39e69;
}

.submenu {
    display: none;
    list-style: none;
    padding-left: 35px; /* bikin masuk seperti sub bab */
    margin-top: 10px;
}

.submenu li {
    margin-bottom: 10px;
}

.submenu a {
    font-size: 14px;
}


.submenu.show {
    display: block;
}

/* ================= Mandarin Music ================= */

.card .video-title {
    text-align: center;
    color: #B87333;
    font-size: 32px;
    font-weight: 900;
    font-family: "Comic Sans MS", "Segoe UI", cursive;
    margin-bottom: 20px;
}

.card .youtube-frame {
    width: 100%;
    padding: 14px;
    background: #FFF8F0;
    border: 4px solid #D4A373;
    border-radius: 30px;

    display: flex;
    justify-content: center;
    align-items: center;
}
.card .youtube-frame iframe {
    width: 100%;
    max-width: 700px;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
}


.video-card {
    max-width: 100%;
}

.hanzi-card-container {
    width: 300px;
    margin: auto;
    text-align: center;
    font-family: "Comic Sans MS", sans-serif;
}

.hanzi-card-container h2 {
    color: #8b5e3c;
    font-size: 24px;
}


.flashcard {
    width: 220px;
    height: 160px;
    margin: 20px auto;
    perspective:1000px;
    cursor:pointer;
}
    


.card-inner {
    width:100%;
    height:100%;
    transition: transform .6s;
    transform-style: preserve-3d;
    position:relative;
}


.flashcard.flip .card-inner {
    transform: rotateY(180deg);
}


.card-front,
.card-back {

    position:absolute;
    width:100%;
    height:100%;

    backface-visibility:hidden;

    border-radius:25px;

    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;


    background:
    linear-gradient(
        135deg,
        #f9e8d9,
        #f3c6a8
    );


    box-shadow:
    0 10px 20px rgba(0,0,0,.15);

}


.card-front span {

    font-size:55px;
    color:#5b3622;

}


.card-back {

    transform:rotateY(180deg);

}


#pinyin {

    font-size:22px;
    color:#7b4b2a;
    font-weight:bold;

}


#meaning {

    margin-top:15px;
    font-size:16px;
    color:#5b3622;

}


.hint {

    font-size:14px;
    color:#9b6b4a;

}

.lesson-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lesson-card h2 {
    text-align: center;
    margin-bottom: 20px;
}


.instruction {

    text-align:center;

    margin-top:20px;

    color:#9b6b4a;

    font-size:14px;

}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 768px) {

    /* Layout utama */
    .app-container {
        flex-direction: column;
    }


    /* Sidebar */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }


    /* Header */
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }


    /* Konten utama */
    .main-content {
        padding: 20px;
        width: 100%;
    }


    /* Grid card */
    .section-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }


    /* Course 3 / video card */
    .section-container > .card:first-child {
        grid-column: auto;
    }


    /* Semua card */
    .card {
        width: 100%;
    }


    /* Video responsive */
    .video-card iframe,
    .video-card video {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }


    /* Flashcard */
    .flashcard {
        width: 100%;
        max-width: 320px;
        margin: auto;
    }


    /* Progress bar */
    .progress-bar-bg {
        width: 100%;
    }


    /* Font lebih nyaman di HP */
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

}


/* =========================
   TABLET
========================= */

@media (min-width: 769px) and (max-width: 1024px) {

    .main-content {
        padding: 30px;
    }


    .section-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

}


/* =========================
   HP KECIL
========================= */

@media (max-width: 480px) {

    .main-content {
        padding: 15px;
    }


    .card {
        border-radius: 15px;
    }


    h1 {
        font-size: 22px;
    }


    .flashcard {
        max-width: 280px;
    }

}
/* ================= About Accordion ================= */

.about-card{
    max-width:900px;
    margin:auto;
}

.about-card h2{
    text-align: center;
    color: #2c3e50;
    margin-bottom: 8px;
}

.about-subtitle{
    text-align: center;
    color: #b87333;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 40px;
    line-height: 1.5;
}

.accordion-item{
    background:#fff;
    border-radius:24px;
    margin-bottom:18px;
    overflow:hidden;
    box-shadow:0 8px 20px rgba(0,0,0,.06);
    transition:.3s;
}

.accordion-item:hover{
    transform:translateY(-3px);
}

.accordion-btn{
    width:100%;
    padding:22px;
    background:none;
    border:none;
    display:flex;
    justify-content:space-between;
    align-items:center;
    cursor:pointer;
}

.accordion-title{
    display:flex;
    align-items:center;
    gap:18px;
}

.accordion-emoji{
    width:52px;
    height:52px;
    border-radius:50%;
    background:#fdf5ef;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:24px;
}

.accordion-text{
    font-size:18px;
    font-weight:600;
    color:#2c3e50;
}

.accordion-icon{
    font-size:24px;
    transition:.3s;
    color:#d39e69;
}

.accordion-content{
    display:none;
    padding:0 28px 28px 92px;
    line-height:1.8;
    color:#666;
}

.accordion-content.show{
    display:block;
}

