/* AcademyScanner - Print Styles */
@media print {
    /* Page setup */
    @page {
        size: A4;
        margin: 1.5cm 2cm;
    }

    @page :first {
        margin-top: 2cm;
    }

    /* Hide non-printable elements */
    .navbar, .footer-section, .dashboard-sidebar, .no-print,
    .btn, button, form, .toast-container-custom,
    .dark-mode-toggle, .nav-search-input,
    .fab-container, select, input,
    canvas.sparkline-cell, .trend-sparkline-wrap,
    details, .breadcrumb { display: none !important; }

    /* Reset backgrounds and colors */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.5;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Glass-card print normalization */
    .card, .glass-card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #fff !important;
        margin-bottom: 0.75rem !important;
    }

    /* Headers */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000 !important;
    }

    /* University header - preserve branding */
    .university-header {
        background: #1e3a8a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 1.5rem !important;
    }

    /* Report sections */
    .report-section {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    .page-break {
        page-break-before: always;
    }

    /* Score displays */
    .score-value { font-size: 1.8rem; }

    /* Preserve colors for badges, progress bars, category cards */
    .grade-badge,
    .badge,
    .progress-bar,
    .category-score-fill,
    .webo-bar-fill,
    .bg-success, .bg-danger, .bg-warning, .bg-primary, .bg-info, .bg-secondary {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge {
        border: 1px solid currentColor;
    }

    /* Progress bars visible in print */
    .progress {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: #e5e7eb !important;
    }

    /* Charts - controlled size */
    canvas {
        max-height: 250px !important;
        page-break-inside: avoid;
    }

    /* Print header */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 1.5cm;
        border-bottom: 2px solid #1e3a8a;
        padding-bottom: 0.5cm;
    }

    /* Print footer */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 8pt;
        color: #999;
        border-top: 1px solid #ddd;
        padding-top: 4pt;
    }

    .print-only {
        display: block !important;
    }

    /* Links - no decoration */
    a[href]::after { content: none !important; }
    a { color: #000 !important; text-decoration: none !important; }

    /* Table styles for print */
    .table {
        border-collapse: collapse;
        font-size: 9pt;
    }
    .table th, .table td {
        border: 1px solid #ddd !important;
        padding: 4px 8px;
    }
    .table thead {
        display: table-header-group;
    }
    .table tr {
        page-break-inside: avoid;
    }

    /* Ensure dark text for muted elements */
    .text-muted { color: #666 !important; }
    .text-secondary { color: #444 !important; }
    .text-primary { color: #1e3a8a !important; }
    .text-success { color: #047857 !important; }
    .text-danger { color: #b91c1c !important; }
    .text-warning { color: #92400e !important; }

    /* Row grid for print */
    .row { display: flex !important; flex-wrap: wrap !important; }

    /* Gauge chart visible */
    .gauge-container canvas {
        max-height: 160px !important;
    }
}
