/*
 * Mobile-friendly overrides for ReportGenerator HTML reports.
 * This CSS is injected post-generation to improve readability on mobile devices
 * without affecting desktop display.
 */

/* Mobile-specific styles */
@media screen and (max-width: 768px) {
    /* Make tables horizontally scrollable */
    .table-responsive,
    .overview {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent assembly/class names from wrapping */
    .overview th,
    .overview td {
        white-space: nowrap;
    }

    /* Override table-fixed layout to allow natural content sizing */
    table.table-fixed {
        table-layout: auto;
        width: max-content;
        min-width: 100%;
    }

    /* Risk Hotspots table - ensure names stay on one line */
    .overview th:first-child,
    .overview td:first-child {
        min-width: 200px;
    }

    /* Adjust card layout for narrow screens */
    .card-group {
        flex-direction: column;
    }

    .card-group .card {
        width: 100%;
        max-width: 100%;
    }

    /* Ensure coverage percentage bars don't get too squished */
    .coverage {
        min-width: 100px;
    }

    /* Detail view: Line analysis table (source code coverage) 
       This table shows file contents with line-by-line coverage.
       We need horizontal scrolling to prevent code wrapping. */
    
    /* Force table to expand to natural content width instead of shrinking */
    table.lineAnalysis {
        width: max-content;
        min-width: 100%;
    }

    .lineAnalysis th,
    .lineAnalysis td {
        white-space: nowrap;
    }

    /* Prevent code cells from wrapping - these contain the actual source code */
    .lineAnalysis td code {
        white-space: pre;
    }

    /* Ensure the code column has minimum width for readability */
    .lineAnalysis td:last-child {
        min-width: 300px;
    }
}

/* Tablet adjustments */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .overview th,
    .overview td {
        white-space: nowrap;
    }

    .table-responsive,
    .overview {
        display: block;
        overflow-x: auto;
    }

    /* Override table-fixed layout to allow natural content sizing */
    table.table-fixed {
        table-layout: auto;
        width: max-content;
        min-width: 100%;
    }

    /* Detail view: Line analysis table for tablet */
    
    /* Force table to expand to natural content width instead of shrinking */
    table.lineAnalysis {
        width: max-content;
        min-width: 100%;
    }

    .lineAnalysis th,
    .lineAnalysis td {
        white-space: nowrap;
    }

    .lineAnalysis td code {
        white-space: pre;
    }

    /* Ensure the code column has minimum width for readability */
    .lineAnalysis td:last-child {
        min-width: 300px;
    }
}
