/* 
 * KOT.Blazor - Standardized Print Styles
 * This file contains consistent print styles for all pages
 * Include this in _Host.cshtml or App.razor for global application
 */

/* ========================================
   GLOBAL PRINT STYLES
   ======================================== */

@media print {
    /* Hide navigation and layout elements */
    .sidebar,
    .top-row,
    nav,
    .nav-menu {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide the page structure */
    .page {
        display: block !important;
    }

    .page > .sidebar {
        display: none !important;
    }

    /* Make main content full width */
    main {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        margin-left: 0 !important;
    }

    .content {
        padding: 10px !important;
        margin: 0 !important;
    }

    /* Hide elements marked as no-print */
    .no-printing,
    .no-print,
    .hide-print {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide interactive elements */
    button:not(.print-only button),
    .btn:not(.print-only .btn),
    .form-select:not(.print-only .form-select),
    .form-control:not(.print-only .form-control),
    .form-label:not(.print-only .form-label),
    .alert:not(.print-only .alert),
    input:not(.print-only input),
    select:not(.print-only select),
    textarea:not(.print-only textarea) {
        display: none !important;
    }

    /* Show elements marked as print-only */
    .print-only,
    .show-print {
        display: block !important;
        visibility: visible !important;
    }

    /* Table handling */
    .table-responsive {
        overflow: visible !important;
        display: block !important;
    }

    table {
        display: table !important;
        visibility: visible !important;
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group !important;
    }

    tbody {
        display: table-row-group !important;
        visibility: visible !important;
    }

    tr {
        display: table-row !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
    }

    td, th {
        display: table-cell !important;
        visibility: visible !important;
        padding: 5px !important;
    }

    /* Table headers */
    .row-header,
    thead tr {
        page-break-after: avoid;
        background-color: #e9ecef !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Remove link styling in print */
    a {
        text-decoration: none !important;
        color: black !important;
    }

    /* Font size adjustments for print */
    body {
        font-size: 8pt !important;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    h3 {
        margin-bottom: 10px !important;
        font-size: 12pt !important;
    }

    table {
        font-size: 8pt !important;
    }

    td, th {
        font-size: 8pt !important;
        padding: 3px !important;
    }

    /* Remove hover effects */
    *:hover {
        background-color: transparent !important;
    }

    /* Page break helpers */
    .page-break-before {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .avoid-page-break {
        page-break-inside: avoid;
    }

    /* Color adjustment for backgrounds */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========================================
   SCREEN-ONLY STYLES
   ======================================== */

@media screen {
    /* Hide print-only elements on screen */
    .print-only,
    .show-print {
        display: none !important;
    }

    /* Show no-print elements on screen */
    .no-printing,
    .no-print,
    .hide-print {
        /* Visible on screen - no special styles needed */
    }
}
