/* 
 * Custom Styles for Khmer Village Citizen Management System
 * រចនាប័ទ្មបន្ថែមសម្រាប់អក្សរខ្មែរ របាយការណ៍ និងការបោះពុម្ព
 */

body {
    font-family: 'Kantumruy Pro', sans-serif;
    background-color: #f8fafc;
}

.khmer-moul {
    font-family: 'Moul', serif;
}

/* Standardize 12px font size for data display tables across all tabs */
table th,
table td {
    font-size: 12px !important;
}

/* Data touch / hover / focus feedback - make text slightly bold when hovering/focusing data */
table tbody tr:hover {
    background-color: #f1f5f9 !important;
    transition: background-color 0.15s ease;
}

table tbody tr:hover td {
    font-weight: 600 !important;
    color: #0f172a;
}

table tbody tr:active td {
    font-weight: 700 !important;
    background-color: #e2e8f0 !important;
}

/* Make input / select text slightly bold on hover and focus */
input:hover,
select:hover,
textarea:hover {
    font-weight: 600;
}

input:focus,
select:focus,
textarea:focus {
    font-weight: 600 !important;
    border-color: #1e40af !important;
}

/* Custom Webkit scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Screen styling for print cards (resembles A4 Landscape) */
.page-break {
    width: 297mm;
    height: 210mm;
    margin: 0 auto 2rem auto;
    padding: 24px;
    background-color: white;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-family: 'Siemreap', sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm 10mm;
    }

    /* Reset parent scroll/flex layouts that break page splitting and block layout */
    html,
    body,
    #app,
    main,
    #mainViewport {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .no-print {
        display: none !important;
    }

    .print-area {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .page-break {
        page-break-before: always !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;

        /* Precise fit inside A4 Landscape with margins (297mm - 2*10mm, 210mm - 2*8mm) */
        width: 277mm !important;
        height: 192mm !important;

        margin: 0 auto !important;
        padding: 8mm !important;
        border: none !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        background: white !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    .page-break:first-child {
        page-break-before: auto !important;
    }
}