/* Grade Report Modal Styles */

.grade-report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.grade-report-modal-overlay * {
    box-sizing: border-box;
}

.grade-report-container {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.grade-report-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.grade-report-close-btn:hover {
    color: #333;
    background: #f0f0f0;
    border-radius: 50%;
}

.grade-report-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.grade-report-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.grade-report-content {
    margin-bottom: 20px;
}

.grade-report-block {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #019d50;
}

.grade-report-block h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.grade-report-field {
    margin: 5px 0;
    padding: 0;
}

.grade-report-field strong {
    color: #333;
    font-size: 14px;
}

.grade-report-field-value {
    display: inline;
}

/* Conclusion / Rating section - matching grade_blank styles */
.grade-report-conclusion {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.grade-report-conclusion h3 {
    margin-top: 0;
    color: #333;
    text-align: center;
}

.overall-rating {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.overall-rating h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.overall-rating .rating-display {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.score-risk {
    margin-top: 0.5rem;
    text-align: center;
}

.score-risk span {
    display: block;
    font-weight: bold;
    color: #333;
}

.risk-value {
    font-size: 22px;
    font-weight: bold;
    margin-top: 0.25rem;
}

.rating-display {
    font-size: 2rem;
    font-weight: bold;
}

/* Thickness table styles - matching grade_blank */
.pdf-table-container {
    font-size: 13px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    overflow-x: auto;
}

.grade-report-thickness-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    table-layout: fixed;
    margin: 0 0 5px 0;
}

.grade-report-thickness-table td {
    border: none;
    vertical-align: top;
}

.grade-report-thickness-table tr.spacer td {
    padding: 8px 0;
}

.part-label {
    width: 60%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.header-avg {
    width: 20%;
    text-align: right;
    font-weight: 600;
}

.header-dev {
    width: 20%;
    text-align: right;
    font-weight: 600;
}

/* Thickness table header - same style as AVG/DEV but left-aligned */
.thickness-header-label {
    width: 60%;
    text-align: left;
    font-weight: 600;
}

.thickness-values {
    width: 60%;
    text-align: left;
}

.value-avg {
    width: 20%;
    text-align: right;
}

.value-dev {
    width: 20%;
    text-align: right;
}

/* Damage section styles */
.grade-report-damage-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.grade-report-damage-section h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 14px;
    color: #333;
}

.grade-report-damage-item {
    margin-bottom: 0.5rem;
    font-size: 14px;
}

.grade-report-damage-item strong {
    color: #555;
}

/* Scan errors section */
.grade-report-scan-errors-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.grade-report-scan-errors-section h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 14px;
    color: #333;
}

.scan-error-result {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
}

.scan-error-result.success {
    border-left: 3px solid #28a745;
}

.scan-error-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.scan-error-details p {
    margin: 0;
    font-size: 13px;
}

.scan-error-details strong {
    color: #555;
}

/* Points display */
.points {
    color: #999;
    font-weight: normal;
    margin-left: 8px;
}

/* Remove top margin for first scan errors field */
.no-top-margin {
    margin-top: 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .grade-report-container {
        width: 95%;
        padding: 15px;
        max-height: 95vh;
    }

    .grade-report-header h2 {
        font-size: 20px;
    }

    .rating-display {
        font-size: 1.75rem;
    }

    .risk-value {
        font-size: 18px;
    }

    .grade-report-block {
        padding: 10px;
    }

    .part-label, .thickness-values {
        width: 50%;
    }

    .header-avg, .header-dev, .value-avg, .value-dev {
        width: 25%;
    }
}

/* Hide scrollbar arrows */
.grade-report-container::-webkit-scrollbar {
    width: 10px;
}

.grade-report-container::-webkit-scrollbar-button {
    display: none;
}
