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

body {
    background-color: #182551; 
    color: #ffffff; 
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

/* navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: #cbd5e1; 
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 400;
    font-size: 1.05rem;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #93c5fd; 
}

.nav-links a.active {
    font-weight: 600;
    border-bottom: 2px solid #ffffff;
}

/* beranda */
.main-section {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.main-title {
    font-size: 4rem; 
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.main-description {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 45px;
    color: #e2e8f0;
}

.btn-utama {
    background-color: #ffffff; 
    color: #182551; 
    padding: 16px 45px;
    border-radius: 8px; 
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-utama:hover {
    background-color: #f1f5f9;
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* baca panduan */
.panduan-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 60px;
}

.panduan-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    letter-spacing: 0.5px;
}

.panduan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    max-width: 1100px;
    margin-bottom: 50px;
}

.panduan-item {
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    background-color: rgba(255, 255, 255, 0.05); 
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.panduan-item:hover {
    transform: translateY(-5px); 
    background-color: rgba(255, 255, 255, 0.08);
}

.panduan-item .angka {
    font-size: 2.5rem;
    font-weight: 700;
    color: #93c5fd; 
    line-height: 1;
    margin-bottom: 10px;
}

.panduan-img {
    width: 100%;
    height: 240px; 
    object-fit: cover; 
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1); 
    margin-bottom: 15px;
}

.panduan-item p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
    text-align: left;
}

.panduan-item strong {
    color: #ffffff;
    font-weight: 600;
}

.panduan-action {
    text-align: center;
    margin-bottom: 20px;
}

.panduan-action p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #e2e8f0;
}

/* praktik alfabet */
.praktik-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 40px;
}

.praktik-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.praktik-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    justify-content: space-between;
}

.grid-abjad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-content: start;
}

.abjad-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.abjad-btn.active {
    background-color: #ffffff;
    color: #182551;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.kamera-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background-color: #0f172a;
}

.kamera-feed {
    flex: 1;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.kamera-placeholder {
    color: #94a3b8;
    font-size: 1.2rem;
}

.hasil-deteksi {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 400;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#huruf-terdeteksi {
    font-weight: 700;
    color: #93c5fd;
}

.panel-kanan {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 300px;
}

.target-container {
    display: flex;
    gap: 15px;
}

.target-huruf {
    width: 200px;
    height: 160px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: 700;
}

.gambar-referensi {
    width: 200px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
}

.validasi-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.ikon-centang {
    width: 80px;
    height: auto;
}

.teks-validasi {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4ade80; 
}

.ikon-centang, .teks-validasi, .btn-utama-kecil {
    display: none;
}

.aksi-container {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-sekunder {
    flex: 1;
    background-color: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sekunder:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-utama-kecil {
    flex: 1;
    background-color: #ffffff;
    color: #182551;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-utama-kecil:hover {
    background-color: #e2e8f0;
}

/* selesai belajar */
.selesai-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 60px;
}

.piala-img {
    width: 180px; 
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.4)); 
}

.selesai-teks {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.4;
    max-width: 900px;
    margin-bottom: 50px;
    color: #ffffff;
}

.selesai-action {
    display: flex;
    gap: 20px;
}

.btn-sekunder-link {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 14px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-sekunder-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.footer {
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* media req mobile responsif */
@media screen and (max-width: 850px) {
    .navbar {
        flex-direction: column !important;
        padding: 20px 15px !important;
        gap: 15px !important;
        text-align: center;
    }
    .logo-container {
        align-items: center !important;
    }
    .nav-links {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 15px !important;
    }

    .praktik-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 0 15px !important;
    }

    /* grid huruf di hp */
    .grid-abjad {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        width: 100% !important; 
        max-width: 100vw !important;
        padding-bottom: 10px !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }
    .abjad-btn {
        flex: 0 0 50px !important; 
        height: 50px !important;
    }

    .kamera-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .kamera-feed {
        width: 100% !important;
        height: 350px !important; 
        position: relative !important;
        overflow: hidden !important;
    }

    .kamera-feed video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .panel-kanan {
        width: 100% !important;
        align-items: center !important;
    }
    
    .target-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .target-huruf, .gambar-referensi {
        width: 140px !important;
        height: 120px !important;
        font-size: 3rem !important;
    }

    .aksi-container {
        flex-direction: column !important;
        width: 100% !important;
    }
    .btn-sekunder, .btn-utama-kecil {
        width: 100% !important;
    }

    .main-title { font-size: 2.2rem !important; }
    .main-description { font-size: 1rem !important; padding: 0 10px !important; }
    .panduan-title { font-size: 1.8rem !important; text-align: center; }
    .panduan-section { padding: 20px 15px !important; }
    .panduan-grid { grid-template-columns: 1fr !important; }
    .selesai-section { padding: 30px 15px !important; }
    .selesai-action { flex-direction: column !important; width: 100% !important; }
    .selesai-action .btn-utama, .selesai-action .btn-sekunder-link { width: 100% !important; }
}