/* css/pages/exam-slip.css */

.exam-slip-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    border: 2px solid #333;
    color: #000;
    font-family: 'Times New Roman', serif;
    position: relative;
}

.slip-header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
    gap: 20px;
}

.slip-logo {
    width: 100px;
    height: auto;
}

.slip-title-box {
    flex: 1;
    text-align: center;
}

.slip-title-box h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
}

.slip-title-box p {
    margin: 5px 0 0 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.slip-main-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.info-item {
    display: flex;
    gap: 10px;
}

.info-label {
    font-weight: bold;
    min-width: 120px;
}

.info-value {
    border-bottom: 1px dotted #333;
    flex: 1;
}

.slip-schedule-title {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
}

.slip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.slip-table th,
.slip-table td {
    border: 1px solid #333;
    padding: 10px;
    text-align: center;
}

.slip-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.barcode-placeholder {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    border: 1px dashed #ccc;
}

#barcode-img {
    max-width: 100%;
}

.signature-box {
    width: 250px;
}

.slip-notes {
    margin-top: 40px;
    font-size: 0.9rem;
    font-style: italic;
    border-top: 1px dashed #333;
    padding-top: 15px;
    line-height: 1.4;
}

/* Print Specific Styles */
@media print {

    /* Ép trình duyệt không in Header/Footer (Ngày tháng, URL) */
    @page {
        size: A4;
        margin: 0mm !important;
    }

    html,
    body {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    /* Ẩn TRIỆT ĐỂ các thành phần không liên quan */
    header,
    footer,
    aside,
    .scroll-buttons,
    #welcome-title,
    .dashboard-header,
    #my-classes-grid,
    #mock-exam-status-card,
    #reports-stats-card,
    .modal-header,
    .modal-footer {
        display: none !important;
    }

    /* Đưa Modal ra làm thành phần chính của trang in và XOÁ THANH CUỘN */
    .modal-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        visibility: visible !important;
        overflow: visible !important;
        /* Xoá cột kéo */
    }

    .modal-content {
        position: relative !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        /* Xoá cột kéo */
    }

    #exam-slip-printable-area {
        margin: 0 !important;
        padding: 8mm 12mm !important;
        /* Thu gọn lề */
        background: #fff !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
        zoom: 0.90 !important;
        /* Tự động scale để vừa trang mà không cần chỉnh tay */
    }

    #exam-slip-content {
        display: block !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    /* Đảm bảo màu sắc và barcode hiện rõ */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Tối ưu các thành phần để tiết kiệm diện tích */
    .slip-title-section {
        margin: 15px 0 !important;
    }

    .slip-main-info {
        margin-bottom: 15px !important;
        gap: 10px !important;
    }

    .barcode-placeholder {
        margin: 15px 0 !important;
        padding: 5px !important;
    }

    #barcode-svg-element {
        transform: scale(0.9);
        /* Thu nhỏ mã vạch một chút */
    }

    .slip-footer {
        margin-top: 15px !important;
    }

    .signature-box div {
        height: 50px !important;
        /* Thu hẹp thêm khoảng cách ký tên */
    }

    .slip-notes {
        margin-top: 20px !important;
    }
}