/* Print-specific styles for HF Propagation Planner */

/* Hide print heading on screen */
#print-heading {
    display: none;
}

@media print {
    /* Hide navigation/header elements outside container */
    body > *:not(.container-xxl):not(footer) {
        display: none !important;
    }

    /* Hide specific elements within container */
    .container-xxl > h2,
    .container-xxl > .card:has(#helptext),
    form,
    .alert,
    .no-print {
        display: none !important;
    }

    /* Show print heading (without breaking its display mode) */
    #print-heading {
        display: block !important;
        page-break-after: avoid;
        margin-bottom: 1rem;
    }

    #print-heading h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    #print-heading p {
        margin-bottom: 0.5rem;
    }

    /* Prevent page break after BCR legend */
    #bcr-table-normal,
    #bcr-table-md {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    #bcr-table-normal table,
    #bcr-table-md table {
        page-break-inside: avoid;
    }

    #bcr-table-normal caption,
    #bcr-table-md caption {
        page-break-before: avoid;
        page-break-after: avoid;
    }

    /* Ensure result cards print properly - two per row */
    #results-row .col {
        flex: 0 0 auto;
        width: 48%;
    }

    .result-card {
        page-break-inside: avoid;
        font-size: 0.82rem;
    }

    .result-card .card-header {
        font-size: 0.9rem;
        padding: 0.25rem 0.5rem;
        font-weight: 600;
    }

    .result-card .card-header h4 {
        font-size: 0.9rem;
        margin: 0;
    }

    /* Remove loading overlays for print */
    .overlay-wrapper .overlay {
        display: none !important;
    }

    /* Force background colors to print */
    * {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    /* Ensure BCR colors print with borders as fallback */
    .bcr-0, .bcr-1, .bcr-2, .bcr-3, .bcr-4, .bcr-5, .bcr-6, .bcr-7, .bcr-8, .bcr-9 {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    .noise-0, .noise-1, .noise-2, .noise-3, .noise-4, .noise-5, .noise-6, .noise-7, .noise-8, .noise-9 {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
}
