/* Material Test Report Styles */

.mtr-container {
    font-family: Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.4;
    color: #333;
    background: #f5f5f5;
    padding: 20px;
}

.mtr-page {
    width: 210mm;
    min-height: 297mm;
    background: white;
    margin: 0 auto 20px auto;
    padding: 15mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.mtr-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.mtr-company-info {
    flex: 1;
}

.mtr-company-name {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 5px;
}

.mtr-company-address {
    font-size: 9pt;
    line-height: 1.3;
}

.mtr-report-title-section {
    text-align: center;
    flex: 1;
}

.mtr-report-title {
    font-size: 12pt;
    font-weight: bold;
    border: 2px solid #333;
    padding: 8px 20px;
    display: inline-block;
}

.mtr-report-meta {
    flex: 1;
    text-align: right;
    font-size: 9pt;
}

.mtr-report-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.mtr-rating-section {
    margin-top: 10px;
}

.mtr-rating-box {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0;
}

.mtr-dates-section {
    margin-top: 10px;
    text-align: left;
}

.mtr-date-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0;
}

/* Two Column Layout */
.mtr-two-column {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.mtr-column {
    flex: 1;
}

/* Section Styles */
.mtr-section {
    margin-bottom: 15px;
    border: 1px solid #333;
    padding: 10px;
}

.mtr-section-title {
    font-weight: bold;
    font-size: 10pt;
    margin-bottom: 8px;
    text-decoration: underline;
}

.mtr-form-row {
    display: flex;
    margin-bottom: 5px;
    align-items: baseline;
}

.mtr-form-label {
    font-weight: normal;
    min-width: 150px;
    font-size: 9pt;
}

.mtr-form-value {
    flex: 1;
    border-bottom: 1px solid #999;
    padding-left: 5px;
    min-height: 16px;
    font-size: 9pt;
}

.mtr-checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mtr-checkbox-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9pt;
}

.mtr-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid #333;
}

/* Form Inputs */
.mtr-form-input {
    border: 1px solid #ccc;
    padding: 2px 5px;
    font-size: 9pt;
    min-width: 150px;
    flex: 1;
}

.mtr-form-input-sm {
    border: 1px solid #ccc;
    padding: 2px 5px;
    font-size: 8pt;
    width: 100px;
}

/* Summary Table */
.mtr-summary-header {
    text-align: center;
    font-weight: bold;
    font-size: 11pt;
    margin-bottom: 15px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.mtr-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8pt;
}

.mtr-summary-table th,
.mtr-summary-table td {
    border: 1px solid #333;
    padding: 4px 6px;
    text-align: left;
    vertical-align: top;
}

.mtr-summary-table th {
    background: #f0f0f0;
    font-weight: bold;
}

.mtr-summary-table .col-no {
    width: 25px;
    text-align: center;
}

.mtr-summary-table .col-test {
    width: auto;
}

.mtr-summary-table .col-status {
    width: 30px;
    text-align: center;
}

.mtr-summary-table .test-name {
    font-size: 7.5pt;
}

.mtr-summary-table .test-method {
    font-size: 7pt;
    color: #555;
}

/* Detail Test Section */
.mtr-test-detail {
    margin-bottom: 20px;
    border: 1px solid #333;
    padding: 10px;
    flex: 1;
}

.mtr-test-header {
    font-weight: bold;
    font-size: 10pt;
    margin-bottom: 5px;
}

.mtr-test-subheader {
    font-size: 8pt;
    color: #555;
    margin-bottom: 10px;
    font-style: italic;
}

/* Data Tables */
.mtr-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    margin-bottom: 10px;
}

.mtr-data-table th,
.mtr-data-table td {
    border: 1px solid #333;
    padding: 5px 8px;
    text-align: center;
}

.mtr-data-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.mtr-data-table .text-left {
    text-align: left;
}

.mtr-data-table .text-right {
    text-align: right;
}

.mtr-data-table .sub-header {
    background: #e8e8e8;
    font-weight: bold;
}

/* Two Column Test Layout */
.mtr-test-two-col {
    display: flex;
    gap: 15px;
}

.mtr-test-two-col-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.mtr-test-two-col-wrap .mtr-test-detail {
    flex: 0 0 calc(50% - 5px);
    min-width: 0;
    align-self: flex-start;
}

/* Footer */
.mtr-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #333;
    font-size: 8pt;
    text-align: center;
}

/* Continuous test flow container (screen) */
.mtr-test-flow {
    width: 210mm;
    background: white;
    margin: 0 auto 20px auto;
    padding: 15mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Sample Images Section */
.mtr-sample-images {
    margin-top: 20px;
    border: 1px solid #333;
    padding: 15px;
    min-height: 150px;
}

.mtr-sample-images-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.mtr-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mtr-image-placeholder {
    border: 1px dashed #999;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 9pt;
    position: relative;
    overflow: hidden;
}

.mtr-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mtr-file-input {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 8pt;
    opacity: 0.7;
}

/* Notes */
.mtr-notes {
    font-size: 8pt;
    margin-top: 10px;
    font-style: italic;
}

/* Action Buttons */
.mtr-action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mtr-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mtr-btn-primary {
    background: #3498db;
    color: white;
}

.mtr-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.mtr-btn-secondary {
    background: #95a5a6;
    color: white;
}

.mtr-btn-secondary:hover {
    background: #7f8c8d;
}

.mtr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Print styles */
@page {
    size: A4;
    margin: 0;
}

@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .mtr-container {
        background: white;
        padding: 0;
        margin: 0;
        width: 210mm;
    }
    
    .mtr-page {
        box-shadow: none;
        margin: 0;
        padding: 12mm 15mm;
        page-break-after: always;
        break-after: page;
        width: 210mm;
        box-sizing: border-box;
    }

    .mtr-test-flow {
        page-break-after: always;
        break-after: page;
        padding: 8mm 15mm;
    }

    .mtr-test-flow .mtr-test-detail {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .mtr-page-summary {
        padding-top: 10mm;
        padding-bottom: 10mm;
    }

    .mtr-footer {
        display: none !important;
    }

    .mtr-data-table,
    .mtr-summary-table,
    .mtr-data-table tr,
    .mtr-summary-table tr,
    .mtr-form-row {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .mtr-header {
        margin-bottom: 8px;
        padding-bottom: 5px;
    }

    .mtr-summary-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
        font-size: 10pt;
    }

    .mtr-page-summary .mtr-summary-table {
        font-size: 7.1pt;
        line-height: 1.15;
    }

    .mtr-page-summary .mtr-summary-table th,
    .mtr-page-summary .mtr-summary-table td {
        padding: 2px 3px;
    }

    .mtr-page-summary .test-name {
        font-size: 6.5pt;
        line-height: 1.1;
    }

    .mtr-page-summary .test-method {
        font-size: 5.9pt;
        line-height: 1.05;
    }

    .mtr-summary-notes {
        margin-top: 6px;
        font-size: 7pt;
        line-height: 1.2;
    }

    .mtr-rating-meta-row {
        min-height: auto;
    }
    
    .no-print {
        display: none !important;
    }

    .overall-status-bar {
        display: block !important;
    }
    
    .mtr-action-buttons {
        display: none !important;
    }
    
    .mtr-two-column,
    .mtr-rating-meta-row,
    .mtr-test-two-col,
    .mtr-test-two-col-wrap {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
    }

    .mtr-test-two-col-wrap {
        align-content: flex-start;
    }

    .mtr-two-column > .mtr-column {
        flex: 1 1 50% !important;
        max-width: 50% !important;
    }

    .mtr-rating-left {
        flex: 0 0 40% !important;
    }

    .mtr-meta-right {
        flex: 1 1 60% !important;
    }

    .mtr-section {
        border: 1px solid #333 !important;
        padding: 10px !important;
    }

    .mtr-form-input,
    .mtr-form-input-sm {
        border: none;
        background: transparent;
    }
    
    input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 12px;
        height: 12px;
        border: 1px solid #333;
        position: relative;
    }
    
    input[type="checkbox"]:checked::after {
        content: '✓';
        position: absolute;
        top: -2px;
        left: 1px;
        font-size: 10px;
        color: black;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .mtr-page {
        width: 100%;
        padding: 10px;
    }
    
    .mtr-two-column,
    .mtr-test-two-col {
        flex-direction: column;
    }
    
    .mtr-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .mtr-report-meta {
        text-align: left;
    }
    
    .mtr-summary-table {
        font-size: 7pt;
    }
    
    .mtr-summary-table th,
    .mtr-summary-table td {
        padding: 2px 3px;
    }
}
