/* ==========================================================================
   1. Konfigurasi Dasar & Variabel (Tema MBS ZAM-ZAM)
   ========================================================================== */
:root {
    /* Palet Warna MBS */
    --mbs-blue: #0A2540;       /* Biru Dongker / Navy */
    --mbs-blue-light: #153a66; /* Biru Terang untuk Hover */
    --mbs-gold: #D4AF37;       /* Emas Elegan */
    
    --background-start: #f4f7f9;
    --background-end: #e9ecef;
    --card-shadow: rgba(10, 37, 64, 0.1);
}

html, body {
    overflow-x: hidden; /* Mencegah scroll horizontal tak terduga */
    font-family: 'Inter', sans-serif;
    background-color: var(--background-start);
}

/* ==========================================================================
   2. Layout Utama
   ========================================================================== */
/* Perbaikan Scroll Vertikal & Penyesuaian dengan Fixed Topbar */
.main-wrapper {
    display: flex;
    flex-direction: column;
    /* Mengurangi 85px (padding-top body) agar tidak memicu scrollbar berlebih */
    min-height: calc(100vh - 85px); 
    width: 100%;
}

.main-wrapper > .container,
.main-wrapper > .container-fluid {
    flex: 1; /* Mendorong konten mengisi ruang kosong */
    display: flex;
    flex-direction: column;
}

/* Mendorong footer agar selalu menempel di bawah (Sticky Footer) */
footer {
    margin-top: auto !important; 
}

/* ==========================================================================
   3. Komponen Card
   ========================================================================== */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

.app-card {
    border-radius: 1rem;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto;
}

.app-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem !important;
}

.app-logo {
    max-height: 70px;
    width: auto;
    object-fit: contain;
}

.soal-card {
    transition: box-shadow 0.3s ease-in-out, border-color 0.3s ease;
}

.soal-card:hover {
    box-shadow: 0 4px 12px var(--card-shadow);
    border-color: var(--mbs-gold); /* Sorotan emas saat hover soal */
}

/* ==========================================================================
   4. Elemen Interaktif (Tombol & Progress Bar)
   ========================================================================== */
.progress {
    border-radius: 0.5rem;
}

.progress-bar {
    background-color: var(--mbs-gold) !important; /* Tema Emas */
    transition: width 0.4s ease-in-out; 
    border-radius: 0.5rem;
}

.form-check-label {
    cursor: pointer;
    width: 100%;
}

/* Tombol Primary (Tema Biru MBS) */
.btn-primary {
    background-color: var(--mbs-blue);
    border-color: var(--mbs-blue);
    color: #ffffff;
    box-shadow: 0 4px 15px -2px rgba(10, 37, 64, 0.3);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover, 
.btn-primary:focus {
    background-color: var(--mbs-blue-light);
    border-color: var(--mbs-blue-light);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -2px rgba(10, 37, 64, 0.4);
}

.btn-lg .fa-arrow-right {
    transition: transform 0.2s ease-in-out;
}

.btn-lg:hover .fa-arrow-right {
    transform: translateX(5px);
}

/* ==========================================================================
   5. Utility Classes & Print Styles
   ========================================================================== */
.print-only {
    display: none;
}

@media print {
    @page {
        size: legal portrait;
        margin: 0.3cm;
    }

    /* RESET UNIVERSAL UNTUK PRINT */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html, body {
        width: 100%;
        height: 100%;
        background: #fff !important;
        font-family: 'Times New Roman', Times, serif;
        font-size: 11pt;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: none !important;
    }

    .print-only {
        display: block !important;
        page-break-inside: avoid !important;
        transform: scale(0.95);
        transform-origin: center top;
        width: 100%;
    }
    
    .container, .container-fluid {
        max-width: 100%;
        padding: 0;
    }

    #hasil-cetak {
        padding: 0.5cm;
    }
    
    .kop-surat {
        text-align: center;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 30px;
    }
    
    .kop-surat img {
        max-width: 100%;
        height: auto;
        margin-bottom: 10px;
    }

    .kop-surat h4, .kop-surat p {
        display: none;
    }

    .surat-body {
        line-height: 1.25;
    }

    .surat-body .data-siswa {
        margin: 15px 15px;
        text-align: left;
    }
    
    .surat-body .data-siswa td {
        padding: 2px 8px;
        vertical-align: top;
    }
    
    .hasil-jurusan-print {
        text-align: center;
        font-size: 1.3rem;
        font-weight: bold;
        margin: 15px 0;
        padding: 10px;
        border: 1px solid #000;
    }
    
    .ttd-section {
        margin-top: 40px;
        width: 100%;
    }

    .ttd-row-print {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 5px;
    }
    
    .ttd-col-print {
        width: 32%;
        text-align: center;
    }
    
    .ttd-section p {
        margin-bottom: 0;
    }

    .footer-surat img {
        max-height: 150px;
        width: 100%;
        object-fit: contain;
    }
}