﻿.print-document {
    padding: 0.5in;
    background: white;
    font-family: Arial, sans-serif;
    color: #000;
    font-size: 7.8pt !important;
}

.print-header {
    text-align: center;
    padding-bottom: 0.1in;
    border-bottom: 1px solid #000;
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    margin-bottom: 0.2in;
}

.print-logo {
    min-width: 1in;
    max-width: 1.5in;
}

    .print-logo img {
        filter: invert(100%) grayscale(100%);
        width: 100%;
        height: auto;
    }

.print-title {
    min-width: 3in;
    max-width: 3.5in;
}

.print-timestamp {
    min-width: 1.5in;
    max-width: 2in;
}

.print-body {
    height: 100%;
    max-height: 10in;
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
    flex-grow: 1;
}


.label {
    font-weight: bold;
    color: #2c3e50;
}

.axle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.5in, 1fr));
    gap: 0.15in;
    margin-top: 0.2in;
}

.axle-item {
    padding: 0.1in;
    background: #f8f9fa;
    border-radius: 4px;
}

.tandem {
    margin-left: 0.1in;
    font-size: 0.9em;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.2in 0;
}

.print-table th,
.print-table td {
    border: 1px solid #dee2e6;
    padding: 0.1in;
    text-align: left;
}

.print-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.factors-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3in;
}

.factors-list {
    display: flex;
    flex-direction: column;
    gap: 0.1in;
}

.factor-item {
    padding: 0.1in;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.1in;
}

.factor-item i {
    font-size: 0.9em;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.2in;
    margin-top: 0.2in;
}

.image-item {
    text-align: center;
}

.image-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.image-label {
    margin-top: 0.1in;
    font-size: 0.9em;
    color: #666;
}

.print-footer {
    margin-top: 0.5in;
    padding-top: 0.2in;
    border-top: 1px solid #000;
    text-align: center;
    font-size: 9pt;
    color: #666;
}

.violation {
    color: #dc3545;
}

.warning {
    color: #ffc107;
}

.success {
    color: #28a745;
}

.half-page-vertical {
    min-width: 3in;
    max-width: 3.5in;
}

/* Basic print styles */
@media screen {
    /* Only hide on screen */
    .print-only {
        display: none;
    }
}

/* Tandem positioning in tables */
.tandem-cell {
    position: relative !important;
}

.tandem-info {
    position: absolute !important;
    right: 10px !important;
    top: 100% !important;  /* Position at the bottom of the cell */
    transform: translateY(-50%) !important;  /* Move up by half its height */
    background: #3576a0 !important;
    color: white !important;
    padding: 4px 6px !important;
    border-radius: 4px !important;
    z-index: 2 !important;
    line-height: 1 !important;  /* Tighter line height */
}

.tandem-info.violation {
    background: #b8170f !important;  /* Your violation color */
}

/* Compact print layout */
.print-section {
    margin-bottom: 0.2rem !important;  /* Reduce space between sections */
}

.print-section .table {
    margin-bottom: 0.1rem !important;  /* Reduce table bottom margins */
}

.print-section .table td,
.print-section .table th {
    padding: 0.1rem 0.1rem !important;  /* Reduce cell padding */
}

/* Make WIM and Tire sections more compact */
.wimContainer {
    padding: 0.1rem !important;
}

.wimDisplay {
    padding: 0.1rem !important;
}

#TireAnomaly {
    margin: 0 !important;
    padding: 0 !important;
}

#TireAnomaly li {
    margin-bottom: 0.1rem !important;
}

.table-tas td {
    padding: 0.1rem 0.1rem !important;  /* Extra compact for tire anomaly table */
}

/* Reduce image sizes slightly */
.print-section img {
    max-height: 150px !important;  /* Limit image height */
    width: auto !important;
    object-fit: contain !important;
}

@media print {
    /* Page settings */
    @page {
        size: letter;
        margin: 0;
    }
    /* Hide everything except our print content */
    #main-content { display: none !important; }

    html { print-color-adjust: exact; }

    /* Force show print content */
    .print-only {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: white !important;
        color: black !important;
        padding: 20px !important;
        margin: 0 !important;
        /* Reset any inherited styles that might affect positioning */
        transform: none !important;
        float: none !important;
        clear: both !important;
    }

    /* Ensure images in print view are properly sized */
    .print-only img {
        max-width: 100% !important;
        height: auto !important;
    }

    .wimViolation {
        text-decoration: underline !important;
    }

    .tandemViolation {
        border: 1px dashed red !important;
        text-decoration: underline !important;
        background-color: #f0f0f0 !important; /* Solid light gray that will show in print */
        color: black !important;
        -webkit-print-color-adjust: exact;
        position: fixed;
        transform: translateX(2em);
    }

    .tandemOffset {
        border: 1px dashed black !important;
        background-color: #f0f0f0 !important; /* Solid light gray that will show in print */
        color: black !important;
        -webkit-print-color-adjust: exact;
        position: fixed;
        transform: translateX(2em);
    }

    .striped-list {
        padding: 0.25em inherit 0.25em inherit !important;
    }

    .striped-list li:nth-child(even) {
        background-color: #f0f0f0 !important; /* Solid light gray that will show in print */
        -webkit-print-color-adjust: exact;
    }

    .table-danger, .text-danger, .alert-danger {
        text-decoration: underline !important;
    }
}