/* Print Styles - Optimized for performance and readability */

@media print {
    /* Reset and base print styles */
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Page setup */
    @page {
        margin: 1.5cm;
        size: A4;
    }
    
    @page :first {
        margin-top: 1cm;
    }
    
    /* Basic typography for print */
    body {
        font-family: 'Georgia', 'Times New Roman', serif !important;
        font-size: 11pt !important;
        line-height: 1.6 !important;
        color: #000 !important;
        background: white !important;
    }
    
    /* Headers hierarchy */
    h1 {
        font-size: 20pt !important;
        font-weight: bold !important;
        margin: 10pt 0 !important;
        page-break-after: avoid;
    }
    
    h2 {
        font-size: 16pt !important;
        font-weight: bold !important;
        margin: 8pt 0 !important;
        page-break-after: avoid;
        border-bottom: 1pt solid #000 !important;
        padding-bottom: 4pt !important;
    }
    
    h3 {
        font-size: 13pt !important;
        font-weight: bold !important;
        margin: 6pt 0 !important;
        page-break-after: avoid;
    }
    
    h4 {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin: 4pt 0 !important;
        page-break-after: avoid;
    }
    
    p {
        margin: 6pt 0 !important;
        orphans: 3;
        widows: 3;
    }
    
    /* Links - show URLs */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    a[href^="http"]:after,
    a[href^="https"]:after {
        content: " (" attr(href) ")" !important;
        font-size: 9pt !important;
        font-style: italic !important;
    }
    
    a[href^="tel:"]:after {
        content: " (" attr(href) ")" !important;
        font-size: 9pt !important;
    }
    
    a[href^="mailto:"]:after {
        content: " (" attr(href) ")" !important;
        font-size: 9pt !important;
    }
    
    /* Prevent breaking URLs */
    a[href^="#"]:after,
    a[href^="javascript:"]:after,
    .no-print-url a:after {
        content: "" !important;
    }
    
    /* Lists */
    ul, ol {
        margin: 6pt 0 6pt 20pt !important;
    }
    
    li {
        margin: 3pt 0 !important;
        page-break-inside: avoid;
    }
    
    /* Hide non-essential elements */
    .accessibility-widget,
    .search-container,
    .quick-filters,
    #back-to-top,
    .mobile-menu-toggle,
    .print-section-btn,
    .widget-toggle,
    .skip-link,
    nav,
    footer .footer-links,
    .no-print,
    .toast,
    .menu-overlay,
    video,
    audio,
    iframe {
        display: none !important;
    }
    
    /* Optimize header for print */
    header {
        position: static !important;
        border-bottom: 2pt solid #000 !important;
        margin-bottom: 12pt !important;
        padding: 0 !important;
    }
    
    .compact-header {
        display: block !important;
        text-align: center !important;
        padding: 0 !important;
    }
    
    .logo-section {
        justify-content: center !important;
        margin-bottom: 6pt !important;
    }
    
    .logo-icon {
        display: none !important;
    }
    
    .site-title {
        font-size: 18pt !important;
        color: #000 !important;
        margin: 0 !important;
    }
    
    .site-tagline {
        font-size: 10pt !important;
        color: #333 !important;
        margin: 4pt 0 0 0 !important;
    }
    
    /* Content sections */
    .content-section {
        page-break-before: auto;
        page-break-after: auto;
        margin: 12pt 0 !important;
        padding: 0 !important;
    }
    
    .section-header {
        margin-bottom: 8pt !important;
        page-break-after: avoid;
    }
    
    .section-title {
        font-size: 14pt !important;
        margin-bottom: 6pt !important;
        display: block !important;
    }
    
    .section-title i {
        display: none !important;
    }
    
    .section-description {
        font-size: 10pt !important;
        color: #333 !important;
        margin-bottom: 6pt !important;
    }
    
    /* Cards and boxes */
    .card {
        border: 1pt solid #000 !important;
        margin: 8pt 0 !important;
        page-break-inside: avoid;
        background: white !important;
        padding: 0 !important;
    }
    
    .card-header {
        background: #f0f0f0 !important;
        border-bottom: 1pt solid #000 !important;
        padding: 4pt 8pt !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .card-body {
        padding: 8pt !important;
    }
    
    .emergency-card .card-header {
        background: #fff !important;
        border: 2pt solid #000 !important;
        font-weight: bold !important;
    }
    
    /* Optimize grids for print */
    .cards-grid {
        display: block !important;
    }
    
    .cards-grid > * {
        width: 100% !important;
        margin: 8pt 0 !important;
    }
    
    /* Info boxes and callouts */
    .info-box,
    .info-callout {
        border: 1pt solid #000 !important;
        padding: 8pt !important;
        margin: 8pt 0 !important;
        background: #f9f9f9 !important;
        page-break-inside: avoid;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .alert {
        border: 1pt solid #000 !important;
        padding: 8pt !important;
        margin: 8pt 0 !important;
        page-break-inside: avoid;
    }
    
    .alert-warning {
        background: #fff !important;
        border-left: 3pt solid #000 !important;
    }
    
    .alert-heading {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin-bottom: 4pt !important;
    }
    
    /* Contact information */
    .contact-item {
        background: white !important;
        border: none !important;
        padding: 2pt 0 !important;
        margin: 2pt 0 !important;
    }
    
    .contact-item i {
        display: none !important;
    }
    
    .contact-item strong {
        font-weight: bold !important;
        display: inline !important;
    }
    
    .contact-info {
        border-top: 1pt solid #ccc !important;
        padding-top: 6pt !important;
        margin-top: 6pt !important;
    }
    
    .contact-info p {
        margin: 3pt 0 !important;
    }
    
    .contact-info i {
        display: none !important;
    }
    
    /* Lists */
    .services-list,
    .provisions-list {
        list-style-type: disc !important;
        margin-left: 20pt !important;
        padding: 0 !important;
    }
    
    .services-list li,
    .provisions-list li {
        background: none !important;
        padding: 2pt 0 !important;
        margin: 2pt 0 !important;
        list-style-type: disc !important;
    }
    
    .services-list li::before,
    .provisions-list li::before {
        display: none !important;
    }
    
    .steps-list {
        list-style-type: decimal !important;
        margin-left: 20pt !important;
    }
    
    .steps-list li::before {
        display: none !important;
    }
    
    /* Badges */
    .badge {
        border: 1pt solid #000 !important;
        padding: 1pt 4pt !important;
        margin: 0 2pt !important;
        font-size: 9pt !important;
        display: inline !important;
        background: white !important;
    }
    
    /* Tables (if any) */
    table {
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    table, th, td {
        border: 1pt solid #000 !important;
    }
    
    th, td {
        padding: 4pt !important;
    }
    
    th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    /* Footer - simplified */
    footer {
        margin-top: 20pt !important;
        padding-top: 10pt !important;
        border-top: 2pt solid #000 !important;
    }
    
    .footer-content {
        display: none !important;
    }
    
    .footer-bottom {
        text-align: center !important;
        font-size: 9pt !important;
        color: #666 !important;
    }
    
    /* Emergency section special styling */
    .emergency-section {
        background: white !important;
        border: 2pt solid #000 !important;
        padding: 8pt !important;
    }
    
    .emergency-cards {
        display: block !important;
    }
    
    /* Tabs - show all content */
    .tab-buttons {
        display: none !important;
    }
    
    .tab-panel {
        display: block !important;
        page-break-before: auto;
    }
    
    .tab-panel[hidden] {
        display: block !important;
    }
    
    /* Icons - hide all for cleaner print */
    .bi,
    [class^="bi-"],
    [class*=" bi-"] {
        display: none !important;
    }
    
    /* Disclaimer and important info */
    .disclaimer {
        font-size: 9pt !important;
        font-style: italic !important;
        margin-top: 6pt !important;
    }
    
    /* Page breaks */
    .page-break {
        page-break-after: always;
    }
    
    .no-break {
        page-break-inside: avoid;
    }
    
    /* Optimize images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    /* Row and column optimization */
    .row {
        display: block !important;
    }
    
    [class*="col-"] {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }
    
    /* Print header for sections */
    .print-header {
        display: block !important;
        text-align: center !important;
        font-size: 10pt !important;
        margin-bottom: 10pt !important;
        padding-bottom: 6pt !important;
        border-bottom: 1pt solid #000 !important;
    }
    
    /* Add page numbers via CSS (modern browsers) */
    @page {
        @bottom-right {
            content: "Page " counter(page) " of " counter(pages);
            font-size: 9pt;
            color: #666;
        }
    }
}

/* Print utility classes */
@media screen {
    .print-only {
        display: none !important;
    }
}

@media print {
    .print-only {
        display: block !important;
    }
    
    .screen-only {
        display: none !important;
    }
}

/* High contrast print mode */
@media print and (prefers-contrast: high) {
    * {
        background: white !important;
        color: black !important;
    }
    
    .card-header,
    .info-box,
    .info-callout,
    th {
        background: white !important;
        border: 2pt solid black !important;
    }
}