/*
 * Print Styles for BlazorHRMS
 * Used for printable documents like Service Records, Leave Cards, etc.
 */

/* ========================================== */
/* PRINT MEDIA QUERY - GLOBAL PRINT STYLES */
/* ========================================== */

@media print {
    /* Reset body margin and remove scrollbars */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: auto !important;
    }

    /* Force color printing and remove scrollbars */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        overflow: visible !important;
    }

    /* Hide navigation and non-printable elements */
    .nav-container,
    .sidebar,
    .top-row,
    .navbar,
    nav,
    .no-print,
    .print-controls,
    .btn-group,
    .breadcrumb,
    #blazor-error-ui,
    .toast-container,
    ::-webkit-scrollbar {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
    }

    /* Make main content full width */
    main,
    .page,
    .content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
    }

    /* Container adjustments */
    .container-fluid,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        overflow: visible !important;
    }

    /* Card shadows removal */
    .card {
        box-shadow: none !important;
        border: none !important;
    }

    /* Link styling */
    a {
        text-decoration: none !important;
        color: inherit !important;
    }

    /* Page break controls */
    .page-break-before {
        page-break-before: always !important;
    }

    .page-break-after {
        page-break-after: always !important;
    }

    .avoid-break {
        page-break-inside: avoid !important;
    }

    /* Table styles for print */
    table {
        page-break-inside: auto !important;
        overflow: visible !important;
    }

    tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    thead {
        display: table-header-group !important;
    }

    tfoot {
        display: table-footer-group !important;
    }

    /* Remove any scrollbar styles */
    *::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
}

/* ========================================== */
/* PRINTABLE DOCUMENT COMMON STYLES */
/* ========================================== */

/* Government Document Header */
.gov-doc-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
}

.gov-doc-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.gov-doc-logo {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.gov-doc-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gov-doc-logo-placeholder {
    width: 70px;
    height: 70px;
    border: 2px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #333;
}

.gov-doc-header-text {
    text-align: center;
}

.gov-doc-header-line {
    margin: 0;
    font-size: 11pt;
    font-family: 'Times New Roman', Times, serif;
}

.gov-doc-header-agency {
    font-weight: bold;
    font-size: 13pt;
    text-transform: uppercase;
}

.gov-doc-header-office {
    font-weight: bold;
    font-size: 12pt;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Document Title */
.gov-doc-title {
    text-align: center;
    margin: 20px 0;
}

.gov-doc-title h2 {
    font-size: 16pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 3px;
    font-family: 'Times New Roman', Times, serif;
}

.gov-doc-title-ref {
    font-size: 9pt;
    font-style: italic;
    margin: 5px 0 0 0;
}

/* Signature Blocks */
.gov-doc-signatures {
    margin-top: 30px;
}

.gov-doc-signature-row {
    display: flex;
    justify-content: space-between;
    gap: 50px;
}

.gov-doc-signature-block {
    flex: 1;
    text-align: center;
}

.gov-doc-sig-line {
    border-bottom: 1px solid #000;
    margin-bottom: 5px;
    min-height: 40px;
}

.gov-doc-sig-label {
    font-size: 9pt;
    margin: 0;
}

.gov-doc-sig-name {
    font-weight: bold;
    text-transform: uppercase;
    margin: 5px 0;
    min-height: 18px;
}

.gov-doc-sig-title {
    font-size: 9pt;
    margin: 0;
}

/* Document Footer */
.gov-doc-footer {
    margin-top: 30px;
    border-top: 1px solid #000;
    padding-top: 10px;
}

.gov-doc-footer-note {
    font-size: 8pt;
    text-align: justify;
    margin: 0;
}

.gov-doc-footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
    margin-top: 10px;
    color: #666;
}

/* ========================================== */
/* PAGE SIZE CONFIGURATIONS */
/* Default: 8.5 x 13 inches (Legal/Folio) */
/* ========================================== */

@page {
    size: 8.5in 13in; /* Legal/Folio - default for Philippines government forms */
    margin: 0.25in;
}

@page letter {
    size: letter portrait;
    margin: 0.5in;
}

@page letter-landscape {
    size: letter landscape;
    margin: 0.5in;
}

@page legal {
    size: legal portrait;
    margin: 0.5in;
}

@page folio {
    size: 8.5in 13in;
    margin: 0.25in;
}

@page a4 {
    size: A4 portrait;
    margin: 0.5in;
}

/* ========================================== */
/* SERVICE RECORD SPECIFIC PRINT STYLES */
/* ========================================== */

@media print {
    .service-record-page {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0.3in !important;
        max-width: none !important;
        min-height: auto !important;
        overflow: visible !important;
        page-break-after: always;
    }

    .sr-current-record {
        background: #fffde7 !important;
    }

    .sr-table-header th,
    .sr-table-subheader th {
        background: #f0f0f0 !important;
    }

    .sr-footer-info {
        color: #333 !important;
    }

    .sr-table-container {
        overflow: visible !important;
    }

    .sr-signatures,
    .sr-certification,
    .sr-footer {
        page-break-inside: avoid !important;
    }
}

/* ========================================== */
/* LEAVE CARD SPECIFIC PRINT STYLES */
/* ========================================== */

@media print {
    .leave-card-page {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0.25in !important;
        max-width: none !important;
        page-break-after: always;
        overflow: visible !important;
    }
}

/* ========================================== */
/* DTR SPECIFIC PRINT STYLES */
/* ========================================== */

@media print {
    .dtr-page {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0.25in !important;
        max-width: none !important;
        page-break-after: always;
        overflow: visible !important;
    }
}
