/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .fixed-top,
    .site-header,
    .search-container,
    .action-buttons,
    nav.breadcrumb,
    footer,
    .modal,
    .modal-backdrop,
    [data-bs-toggle="modal"],
    .toast-container {
        display: none !important;
    }

    /* Adjust page margins and font */
    @page {
        margin: 1.5cm;
        size: letter portrait;
    }

    body {
        font-size: 12pt;
        line-height: 1.3;
        background: none;
        color: #000;
        display: block !important;
    }

    main {
        display: block !important;
        min-height: auto !important;
    }

    /* Improve header styling */
    .test-header {
        margin-bottom: 2em;
        border-bottom: 1px solid #ccc;
        padding-bottom: 1em;
    }

    .test-title h1 {
        font-size: 24pt;
        margin-bottom: 0.5em;
    }

    /* Enhance content readability */
    .content-section {
        page-break-inside: auto;
        break-inside: auto;
    }

    .detail-item {
        margin-bottom: 1em;
        page-break-inside: avoid;
    }

    .detail-item h6 {
        font-weight: bold;
        color: #333;
    }

    /* Remove shadows and borders */
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    /* Ensure links are readable */
    a {
        text-decoration: none !important;
        color: #000 !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
        color: #666;
    }

    /* Don't show URLs for internal or javascript links */
    a[href^="/"]:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    /* Improve table readability */
    table {
        border-collapse: collapse !important;
    }

    table td,
    table th {
        background-color: #fff !important;
        border: 1px solid #999 !important;
    }

    /* Force background colors to print */
    .alert {
        border: 1px solid #999 !important;
        padding: 1em !important;
        margin: 1em 0 !important;
        background-color: #fff !important;
        color: #000 !important;
    }

    /* Ensure proper page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    img {
        page-break-inside: avoid;
        max-width: 100% !important;
    }

    /* Remove unnecessary spacing */
    .container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide tooltips */
    .tooltip {
        display: none !important;
    }
}
