/* Print styles cho Sổ Khám Sức Khỏe */
@media print {
    /* Reset cho print */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* Ẩn tất cả elements trừ medical form content */
    body > *:not(#medical-form-content) {
        display: none !important;
    }
    
    body {
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    
    #medical-form-content {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Ẩn navigation và buttons */
    .flex.justify-between.items-center.mb-6,
    button,
    .bg-red-100,
    .animate-spin,
    .btn,
    .button {
        display: none !important;
    }
    
    /* Page settings */
    @page {
        size: A4;
        margin: 1cm;
    }
    
    /* Medical form styles */
    .ksk-header {
        text-align: center;
        font-weight: bold;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .ksk-title {
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        margin: 20px 0;
        page-break-inside: avoid;
    }
    
    .ksk-form {
        width: 100%;
        margin-bottom: 30px;
        page-break-inside: avoid;
    }
    
    .ksk-row {
        display: flex;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .ksk-photo {
        width: 120px;
        height: 160px;
        border: 1px solid #000;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 20px;
        flex-shrink: 0;
    }
    
    .ksk-info {
        flex: 1;
    }
    
    .ksk-info-row {
        display: flex;
        margin-bottom: 8px;
        align-items: center;
    }
    
    .ksk-info-label {
        font-weight: bold;
        margin-right: 8px;
        white-space: nowrap;
    }
    
    .ksk-info-value {
        border-bottom: 1px solid #000;
        min-width: 100px;
        padding: 2px 4px;
        margin-right: 4px;
    }
    
    .ksk-note {
        font-style: italic;
        margin: 20px 0;
        padding: 10px;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .ksk-table-wrap {
        margin: 20px 0;
        page-break-inside: avoid;
    }
    
    .ksk-table {
        width: 100%;
        border-collapse: collapse;
        border: 1px solid #000;
    }
    
    .ksk-table th,
    .ksk-table td {
        border: 1px solid #000;
        padding: 8px;
        text-align: center;
        vertical-align: middle;
    }
    
    .ksk-table th {
        background-color: #f5f5f5;
        font-weight: bold;
    }
    
    .ls-specialty {
        text-align: left;
        font-weight: bold;
    }
    
    .ls-label {
        text-align: right;
        padding-right: 10px;
    }
    
    .ls-cell-small {
        text-align: left;
        padding: 6px;
    }
    
    .ls-doctor-cell {
        text-align: center;
        min-width: 100px;
    }
    
    .ksk-signature-row {
        display: flex;
        justify-content: space-between;
        margin: 10px 0;
        page-break-inside: avoid;
    }
    
    .ksk-signature-box {
        text-align: center;
        width: 45%;
        border: none;
        padding: 10px;
        min-height: 100px;
    }
    
    /* Ngăn page break ở các vị trí không mong muốn */
    .ksk-form,
    .ksk-table,
    .ksk-signature-row,
    .medical-section {
        page-break-inside: avoid;
    }
    
    /* Đảm bảo heading luôn đi cùng với content */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    /* Typography cho print */
    .font-bold {
        font-weight: bold !important;
    }
    
    .text-center {
        text-align: center !important;
    }
    
    .mb-2, .mb-4, .mb-6 {
        margin-bottom: 8px !important;
    }
    
    .ml-4 {
        margin-left: 16px !important;
    }
    
    .space-y-1 > * + * {
        margin-top: 4px !important;
    }
    
    .text-sm {
        font-size: 12px !important;
    }
}

/* Screen styles (không ảnh hưởng đến print) */
@media screen {
    #medical-form-content {
        font-family: 'Times New Roman', Times, serif !important;
    }
} 