/* Import font profesional */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
/* Font Keren untuk Sertifikat */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Great+Vibes&family=Montserrat:wght@300;400;600&display=swap');

/* ---- Variabel Warna (Sesuai Permintaan Anda) ---- */
:root {
    --color-blue: #0D47A1;    /* Biru tua profesional */
    --color-white: #ffffff;   /* Putih bersih */
    --color-gold: #d4af37;    /* Emas elegan */
    --color-bg: #f8f9fa;      /* Latar abu-abu sangat muda */
    --color-text: #333333;    /* Teks abu-abu tua */
    --color-grey: #bbbbbb;    /* Abu-abu untuk 'coming soon' */
}

/* ---- Gaya Global ---- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    padding: 0;
}

/* ---- Header (Biru & Putih) ---- */
header {
    background-color: var(--color-blue);
    color: var(--color-white);
    text-align: center;
    padding: 40px 20px;
    border-bottom: 5px solid var(--color-gold); /* Aksen Emas */
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header p {
    margin: 5px 0 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ---- Konten Utama ---- */
main {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.learning-path h2 {
    font-size: 1.8rem;
    color: var(--color-blue);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.path-description {
    font-size: 1rem;
    color: #555;
}

/* ---- Grid Modul (Inti Dashboard) ---- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; /* Jarak antar kartu */
    margin-top: 20px;
}

/* ---- Kartu Modul (Putih & Aksen) ---- */
.module-card {
    background-color: var(--color-white);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none; /* Menghilangkan garis bawah dari tag <a> */
    color: var(--color-text);
    display: flex;
    flex-direction: column;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-blue);
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.module-card h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--color-blue);
}

.module-description {
    flex-grow: 1; /* Mendorong status ke bawah */
    color: #666;
}

.module-status {
    margin-top: 20px;
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    font-weight: 700;
}

.module-status.active {
    background-color: var(--color-gold);
    color: #333;
}

/* ---- Kartu "Coming Soon" ---- */
.module-card.coming-soon {
    background-color: #f9f9f9;
    color: var(--color-grey);
    opacity: 0.7;
    cursor: not-allowed;
}

.module-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #e0e0e0;
}

.module-card.coming-soon h3 {
    color: var(--color-grey);
}

.module-card.coming-soon .module-status {
    background-color: #e0e0e0;
    color: #888;
}

/* ---- Footer ---- */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #999;
}

/* ---- Gaya untuk Tombol Kembali ---- */
.back-link {
    margin-top: 30px; /* Jarak dari konten di atasnya */
    text-align: center;
}

.back-link a {
    color: #0D47A1; /* Warna biru utama kita */
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
}

/* ---- Progress Bar Dashboard ---- */
.progress-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
    text-align: center;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #555;
}
.progress-bar-bg {
    width: 100%;
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background-color: #28a745; /* Hijau Sukses */
    transition: width 0.5s ease;
}

/* ---- Kartu Modul yang SUDAH SELESAI (Completed) ---- */
.module-card.completed {
    border: 2px solid #28a745; /* Border Hijau */
    background-color: #f0fff4; /* Latar Hijau Muda */
    position: relative; /* Untuk ikon centang */
}

/* Menambahkan Ikon Centang di Pojok Kanan Atas */
.module-card.completed::after {
    content: "✅";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
}

/* Ubah status text jadi 'Selesai' */
.module-card.completed .module-status {
    background-color: #28a745;
    color: white;
}
.module-card.completed .module-status::before {
    content: "Tuntas! "; /* Teks tambahan */
}

/* ---- Bagian Klaim Sertifikat (Di Dashboard) ---- */
.hidden-section { display: none; margin: 40px 0; text-align: center; }
.congrats-box {
    background: linear-gradient(135deg, #fff3cd, #ffecb3);
    padding: 30px; border-radius: 15px;
    border: 2px solid #ffc107; display: inline-block;
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.3);
}
.btn-gold {
    background: linear-gradient(to bottom, #ffd700, #ffb900);
    color: #333; font-weight: bold; font-size: 1.2rem;
    padding: 15px 30px; border: none; border-radius: 50px;
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.btn-gold:hover { transform: scale(1.05); }

/* ---- Desain Sertifikat (Awalnya Sembunyi) ---- */
.certificate-container { display: none; } /* Sembunyi di layar biasa */

/* ---- Modal Untuk Klaim Sertifikat ---- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Latar belakang agak gelap */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Pastikan modal selalu di atas */
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%; /* Responsive */
    animation: fadeIn 0.3s ease-out; /* Animasi muncul */
}

.modal-content h3 {
    color: var(--color-blue);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.modal-content input[type="text"] {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 12px;
    font-size: 1rem;
    box-sizing: border-box; /* Pastikan padding di dalam width */
    margin-bottom: 20px;
}

.modal-content input[type="text"]::placeholder {
    color: #aaa;
}

.modal-button {
    background-color: var(--color-blue);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.2s;
    margin: 5px; /* Spasi antar tombol */
}

.modal-button:hover {
    background-color: #0a3a80;
}

/* Tombol Batal/Tutup di modal */
.modal-content button[data-action="close-modal"] {
    background: none;
    border: none;
    color: #777;
    font-size: 1rem;
    margin-top: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-content button[data-action="close-modal"]:hover {
    color: #333;
}

/* Animasi Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#printable-certificate {
    display: none; /* Sembunyikan sertifikat di layar browser biasa */
}

/* ---- SETTINGAN CETAK PREMIUM ---- */
@media print {
    @page {
        size: A4 landscape; /* Paksa kertas tidur (landscape) */
        margin: 0; /* Hilangkan margin browser putih jelek */
    }
    
    body > *:not(#printable-certificate) {
        display: none !important;
    }

    /* Tampilkan Sertifikat & Paksa Muncul */
    #printable-certificate, #printable-certificate * {
        visibility: visible;
    }

    /* 3. Tampilkan Sertifikat */
    #printable-certificate {
        display: flex !important; /* Munculkan! */
        position: absolute; /* Pakai absolute saja, jangan fixed */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    /* 4. Container Sertifikat */
    .cert-container {
        width: 270mm; /* Pas untuk A4 Landscape */
        height: 180mm; 
        position: relative;
        background-color: #fcfcfc;
        color: #333;
        overflow: hidden;
        border: 1px solid #eee;
    }

    /* Pattern Background Techy (Titik-titik halus) */
    .cert-bg-pattern {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background-image: radial-gradient(#dbeafe 1px, transparent 1px);
        background-size: 20px 20px;
        opacity: 0.5;
        z-index: 0;
    }

    /* Bingkai Mewah */
    .cert-frame {
        position: absolute;
        top: 15px; left: 15px; right: 15px; bottom: 15px;
        border: 2px solid #0D47A1; /* Garis Biru Luar */
        z-index: 1;
        display: flex; flex-direction: column; justify-content: center;
    }
    
    /* Sudut-sudut Techy */
    .cert-corner {
        position: absolute; width: 40px; height: 40px;
        border: 4px solid #d4af37; /* Emas */
    }
    .top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
    .top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
    .bottom-left { bottom: -2px; left: -2px; border-right: none; border-top: none; }
    .bottom-right { bottom: -2px; right: -2px; border-left: none; border-top: none; }

    .cert-content-wrapper {
        padding: 40px;
        text-align: center;
        z-index: 2;
        position: relative;
    }

    /* Header */
    .company-name {
        font-family: 'Montserrat', sans-serif;
        font-weight: 700; letter-spacing: 4px; color: #0D47A1;
        margin: 0; font-size: 1.2rem;
    }
    .company-tagline {
        font-family: 'Montserrat', sans-serif;
        font-size: 0.7rem; letter-spacing: 2px; color: #666;
        margin-top: 5px; text-transform: uppercase;
    }

    /* Judul Besar */
    .cert-title { margin: 30px 0; }
    .cert-title h1 {
        font-family: 'Cinzel', serif;
        font-size: 4rem; margin: 0; line-height: 1;
        color: #1e293b; letter-spacing: 2px;
    }
    .of-completion {
        font-family: 'Montserrat', sans-serif;
        font-size: 1rem; letter-spacing: 8px; color: #d4af37;
        font-weight: 600; display: block; margin-top: 10px;
    }

    /* Body */
    .awarded-to {
        font-family: 'Montserrat', sans-serif; font-size: 0.9rem;
        color: #777; margin-bottom: 10px; font-style: italic;
    }
    #cert-student-name {
        font-family: 'Great Vibes', cursive; /* Font Tanda Tangan Keren */
        font-size: 4.5rem; color: #0D47A1;
        margin: 10px 0 20px 0;
        text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
        border-bottom: 1px solid #eee; display: inline-block; padding: 0 50px;
    }
    .cert-desc {
        font-family: 'Montserrat', sans-serif; font-size: 1rem;
        color: #444; line-height: 1.6; max-width: 80%; margin: 0 auto;
    }

    /* Footer */
    .cert-footer {
        display: flex; justify-content: space-between; align-items: flex-end;
        margin-top: 50px; padding: 0 50px;
    }
    .signature-block { text-align: center; width: 200px; }
    .date-text { font-family: 'Montserrat', sans-serif; font-weight: 600; margin-bottom: 5px; }
    .line { height: 2px; background-color: #0D47A1; width: 100%; margin-bottom: 5px; }
    .label { font-family: 'Montserrat', sans-serif; font-size: 0.7rem; color: #888; letter-spacing: 1px; }
    .sub-label { font-family: 'Montserrat', sans-serif; font-size: 0.6rem; color: #0D47A1; font-weight: 700; }
    
    .sign-img {
        font-family: 'Great Vibes', cursive; font-size: 2rem; color: #000;
        margin-bottom: -10px;
    }

    /* Stempel */
    .seal-block { flex-grow: 1; display: flex; justify-content: center; }
    .cert-seal {
        width: 100px; height: 100px;
        border: 3px solid #d4af37; border-radius: 50%;
        display: flex; justify-content: center; align-items: center;
        color: #d4af37;
    }
    .seal-inner {
        text-align: center; border: 1px dashed #d4af37;
        width: 85px; height: 85px; border-radius: 50%;
        display: flex; flex-direction: column; justify-content: center; align-items: center;
    }
    .seal-inner span { font-weight: 900; font-size: 1.5rem; font-family: 'Cinzel', serif; }
    .seal-inner small { font-size: 0.6rem; letter-spacing: 1px; margin-top: 5px; }

    .cert-id {
        position: absolute; bottom: 10px; right: 20px;
        font-size: 0.6rem; color: #ccc; font-family: monospace;
    }
}
