@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-gov: #004282;
    --secondary-gov: #005bba;
    --success-grad: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-grad: linear-gradient(135deg, #cb2d3e 0%, #ef473a 100%);
    --warning-grad: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #f0f4f8, #d9e2ec, #bcccdc, #9fb3c8);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.navbar-gov {
    background: rgba(0, 66, 130, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid #ffc107;
}

.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.btn-primary-gov {
    background: var(--primary-gov);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s;
}

.btn-primary-gov:hover {
    background: var(--secondary-gov);
    box-shadow: 0 8px 20px rgba(0, 91, 186, 0.4);
}

.form-control-lg {
    border-radius: 50px;
    border: 2px solid #e2e8f0;
    padding: 15px 25px;
}

.result-box {
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.lulus { background: var(--success-grad); }
.tidak-lulus { background: var(--danger-grad); }
.not-found { background: var(--warning-grad); }

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

footer { margin-top: auto; padding: 20px 0; background: transparent; }

/* ==================================================
   ATURAN KHUSUS CETAK / PRINT (Fix Mobile & A4)
   ================================================== */
@media print {
    @page {
        size: A4; /* Paksa ukuran kertas A4 */
        margin: 1.5cm; /* Margin standar dokumen Word */
    }

    body {
        background: white !important;
        animation: none !important;
        color: black !important;
        font-family: 'Times New Roman', Times, serif !important; /* Font standar surat resmi */
        font-size: 12pt !important;
    }
    
    /* Sembunyikan semua elemen UI Web */
    .navbar-gov, .btn, footer, .alert, canvas, .d-print-none {
        display: none !important;
    }
    
    /* Reset layout container agar melebar penuh di kertas */
    .container, .container-fluid, .row, .col-md-7 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Hilangkan efek Card */
    .card-glass {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: white !important;
        padding: 0 !important;
    }

    /* Paksa Grid Bootstrap agar TIDAK turun ke bawah saat di-print via Mobile */
    .row { display: flex !important; flex-wrap: nowrap !important; }
    .col-2 { width: 16.666667% !important; }
    .col-10 { width: 83.333333% !important; }
    .col-4 { width: 33.333333% !important; }
    .col-8 { width: 66.666667% !important; }
    .col-5 { width: 41.666667% !important; }
    .col-7 { width: 58.333333% !important; }

    /* Format Kop Surat */
    .kop-surat h4 { font-size: 14pt !important; margin-bottom: 2px !important; }
    .kop-surat h3 { font-size: 18pt !important; margin-bottom: 2px !important; }
    .kop-surat p { font-size: 10pt !important; }
    
    .garis-kop {
        border-bottom: 4px solid #000 !important;
        margin-bottom: 2px !important;
        width: 100% !important;
    }
    .garis-kop-tipis {
        border-bottom: 1px solid #000 !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    /* Format Data Siswa */
    .bg-white.border { border: none !important; padding: 0 !important; margin-bottom: 20px !important; }
    .text-muted { color: black !important; }
    
    /* Format Kotak Lulus/Tidak Lulus */
    .result-box {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        border: 2px solid #000 !important;
        padding: 15px !important;
        border-radius: 0 !important;
        margin: 20px 0 !important;
    }
    .result-box h1 { font-size: 24pt !important; color: black !important; margin-bottom: 0 !important; }
    .result-box p, .result-box i { display: none !important; /* Sembunyikan ikon dan teks motivasi saat print */ }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-gov: #004282;
    --secondary-gov: #005bba;
    --success-grad: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-grad: linear-gradient(135deg, #cb2d3e 0%, #ef473a 100%);
    --warning-grad: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #f0f4f8, #d9e2ec, #bcccdc, #9fb3c8);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.navbar-gov {
    background: rgba(0, 66, 130, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid #ffc107;
}

.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.btn-primary-gov {
    background: var(--primary-gov);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s;
}

.btn-primary-gov:hover {
    background: var(--secondary-gov);
    box-shadow: 0 8px 20px rgba(0, 91, 186, 0.4);
}

.form-control-lg {
    border-radius: 50px;
    border: 2px solid #e2e8f0;
    padding: 15px 25px;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2px;
}

/* =========================================
   STYLE UNTUK WAKTU MUNDUR (COUNTDOWN)
   ========================================= */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.countdown-box {
    background: var(--primary-gov);
    color: white;
    width: 80px;
    padding: 15px 10px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 66, 130, 0.3);
    text-align: center;
}

.countdown-box h2 {
    font-weight: 700;
    margin-bottom: 0;
    font-size: 2rem;
}

.countdown-box span {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 576px) {
    .countdown-box { width: 65px; padding: 10px 5px; }
    .countdown-box h2 { font-size: 1.5rem; }
    .countdown-box span { font-size: 0.7rem; }
}

.result-box {
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.lulus { background: var(--success-grad); }
.tidak-lulus { background: var(--danger-grad); }
.not-found { background: var(--warning-grad); }

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

footer { margin-top: auto; padding: 20px 0; background: transparent; }

/* ATURAN KHUSUS CETAK / PRINT (Fix Mobile & A4) */
@media print {
    @page { size: A4; margin: 1.5cm; }
    body { background: white !important; animation: none !important; color: black !important; font-family: 'Times New Roman', Times, serif !important; font-size: 12pt !important; }
    .navbar-gov, .btn, footer, .alert, canvas, .d-print-none { display: none !important; }
    .container, .container-fluid, .row, .col-md-7, .col-md-8 { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .card-glass { box-shadow: none !important; border: none !important; border-radius: 0 !important; background: white !important; padding: 0 !important; }
    .row { display: flex !important; flex-wrap: nowrap !important; }
    .col-2 { width: 16.666667% !important; }
    .col-10 { width: 83.333333% !important; }
    .col-4 { width: 33.333333% !important; }
    .col-8 { width: 66.666667% !important; }
    .col-5 { width: 41.666667% !important; }
    .col-7 { width: 58.333333% !important; }
    .kop-surat h4 { font-size: 14pt !important; margin-bottom: 2px !important; }
    .kop-surat h3 { font-size: 18pt !important; margin-bottom: 2px !important; }
    .kop-surat p { font-size: 10pt !important; }
    .garis-kop { border-bottom: 4px solid #000 !important; margin-bottom: 2px !important; width: 100% !important; }
    .garis-kop-tipis { border-bottom: 1px solid #000 !important; margin-bottom: 20px !important; width: 100% !important; }
    .bg-white.border { border: none !important; padding: 0 !important; margin-bottom: 20px !important; }
    .text-muted { color: black !important; }
    .result-box { background: transparent !important; color: black !important; box-shadow: none !important; border: 2px solid #000 !important; padding: 15px !important; border-radius: 0 !important; margin: 20px 0 !important; }
    .result-box h1 { font-size: 24pt !important; color: black !important; margin-bottom: 0 !important; }
    .result-box p, .result-box i { display: none !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}