/**
 * Dershane True A4 Physical Exam Print Specification
 * Exact 210mm x 297mm physical sheet formatting and pagination rules.
 */

@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    /* Hide all application chrome, navigation, headers, footers, toolbars */
    #kt_header,
    #kt_aside,
    #kt_footer,
    #kt_toolbar,
    .no-print,
    .btn,
    .menu,
    .card-toolbar,
    #kt_activities {
        display: none !important;
    }

    body, html {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        height: auto !important;
    }

    #kt_wrapper, #kt_content, #kt_content_container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .exam-print-page {
        width: 210mm !important;
        min-height: 297mm !important;
        height: 297mm !important;
        box-sizing: border-box !important;
        padding: 14mm 16mm !important;
        background: #ffffff !important;
        page-break-after: always !important;
        break-after: page !important;
        position: relative !important;
        overflow: hidden !important;
    }
}

/* On-screen Preview Styling (Maintains exact 210mm x 297mm A4 geometry) */
.exam-print-page {
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    padding: 14mm 16mm;
    background: #ffffff;
    margin: 0 auto 24px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    position: relative;
    font-family: "Inter", Helvetica, sans-serif;
    color: #181C32;
}

.exam-doc-header {
    border-bottom: 2px solid #181C32;
    padding-bottom: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.exam-doc-header h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #181C32;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exam-meta {
    font-size: 12px;
    color: #5E6278;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.student-field {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #181C32;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #E4E6EF;
}

.field-line {
    border-bottom: 1px solid #181C32;
    display: inline-block;
    min-width: 120px;
}

.print-q {
    margin-bottom: 18px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.print-q-subject {
    font-size: 11px;
    font-weight: 700;
    color: #009EF7;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.print-q-stem {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
    color: #181C32;
}

.print-opts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    font-size: 12px;
}

.print-opts-1col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.print-opt {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
    color: #3F4254;
}

.print-opt-letter {
    font-weight: 700;
    color: #181C32;
    flex-shrink: 0;
}

.print-page-num {
    position: absolute;
    bottom: 10mm;
    left: 16mm;
    right: 16mm;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 600;
    color: #7E8299;
    border-top: 1px solid #E4E6EF;
    padding-top: 6px;
}

.print-answer-key {
    background: #F9F9FC;
    border: 1px solid #E4E6EF;
    border-radius: 6px;
    padding: 14px;
    margin-top: 12px;
}

.print-answer-key h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #181C32;
}

.answer-key-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    font-size: 12px;
}

.answer-key-item {
    padding: 6px 8px;
    background: #FFFFFF;
    border: 1px solid #E4E6EF;
    border-radius: 4px;
    text-align: center;
}
