/**
 * Strict A4 Print Stylesheet for Bangladesh Official Forms
 * Font-family: 'Kalpurush', 'SolaimanLipi', 'Segoe UI', Tahoma, Arial, sans-serif
 */

/* Kalpurush Font Definition - Bold is synthesized algorithmically */
@font-face {
    font-family: 'Kalpurush';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Kalpurush'),
        url('../assets/fonts/kalpurush.woff2') format('woff2');
}

@page {
    margin: 8mm 10mm;
}

@page portrait_mode {
    size: A4 portrait;
    margin: 8mm 10mm;
}

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

@media print {

    html,
    body {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Kalpurush', 'SolaimanLipi', 'Segoe UI', Tahoma, Arial, sans-serif !important;
        font-synthesis: weight style !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    * {
        font-family: 'Kalpurush', 'SolaimanLipi', 'Segoe UI', Tahoma, Arial, sans-serif !important;
        font-synthesis: weight style !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    b,
    strong,
    th,
    .font-bold,
    .title-main,
    .tr-title,
    .schedule-header {
        font-weight: bold !important;
    }

    /* Multi-layer Print Isolation: strictly hide all UI chrome, ads, and third-party injections */
    .no-print,
    .app-header,
    .tab-navigation,
    .calculator-form,
    .floating-action-bar,
    .floating-bar,
    .preview-top-bar,
    .faq-section,
    .footer,
    .app-footer,
    .ad-rail,
    .ad-sticky-rail,
    .ad-infeed-container,
    .ad-sticky-bottom,
    .ad-slot-wrapper,
    .ad-generating-slot,
    .generating-modal,
    #generatingBillModal,
    .adsbygoogle,
    iframe[id^="google_ads"],
    iframe[id^="aswift"],
    div[id^="google_ads"],
    div[class*="adsbygoogle"] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
    }

    #reportContainer,
    .report-view-wrapper,
    .print-area {
        display: block !important;
        background: transparent !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .sheet-portrait,
    .a4-sheet {
        page: portrait_mode !important;
        width: 210mm !important;
        min-height: 296mm !important;
        margin: 0 auto !important;
        padding: 10mm 15mm !important;
        box-sizing: border-box !important;
        page-break-after: always !important;
        break-after: page !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        display: block !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
    }

    .sheet-landscape {
        page: landscape_mode !important;
        width: 297mm !important;
        min-height: 209mm !important;
        margin: 0 auto !important;
        padding: 10mm 15mm !important;
        box-sizing: border-box !important;
        page-break-after: always !important;
        break-after: page !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        display: block !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
    }

    /* Preserve Flexbox in Print for alignment */
    .tr-top-bar {
        display: block !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        width: 100% !important;
        margin-bottom: 6px !important;
    }

    .tr-meta-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }

    .tr-meta-row>div {
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }

    .tr-sign-area,
    .tr-token-row,
    .meta-info-grid,
    .signature-row-3,
    .cheque-row {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    .opcode-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    .opcode-grid {
        display: flex !important;
    }

    .opcode-cell {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .tr-sign-right {
        display: flex !important;
        align-items: flex-end !important;
        gap: 16px !important;
    }

    .revenue-stamp {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    table {
        border-collapse: collapse !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        color: #000000 !important;
    }

    th,
    td {
        border: 1px solid #000000 !important;
        padding: 6px 5px !important;
        vertical-align: middle !important;
        text-align: center !important;
    }

    th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
        text-align: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .font-bold,
    b,
    strong,
    th {
        font-weight: bold !important;
    }

    .text-center {
        text-align: center !important;
    }

    .text-left {
        text-align: left !important;
    }

    .text-right {
        text-align: right !important;
    }

    .bg-header-gray {
        background-color: #e2e8f0 !important;
    }

    .bg-gray {
        background-color: #f1f5f9 !important;
    }

    .bg-highlight {
        background-color: #f0fdf4 !important;
    }

    .bg-total {
        background-color: #f1f5f9 !important;
    }

    .text-danger {
        color: #b91c1c !important;
    }

    .text-warning {
        color: #b45309 !important;
    }

    .text-emerald {
        color: #006a4e !important;
    }

    .eco-code-tr-15 {
        font-size: 7px !important;
    }

    .tr-massive-table tbody td {
        font-size: 1em !important;
        padding: 6px 2px !important;
    }
}