/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* T&C modal window */

.tc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.tc-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 700px;
    max-height: 85vh;
    width: 90%;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    padding: 32px;
    overflow-y: auto;
}

.tc-content h2 {
    margin: 0 0 20px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.tc-text {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 24px;
}

.tc-text p {
    margin: 0 0 16px 0;
    font-size: 15px;
}

.tc-list {
    margin: 16px 0;
    padding-left: 24px;
}

.tc-list li {
    margin-bottom: 10px;
    font-size: 14px;
    color: #4b5563;
}

.tc-accept-btn {
    width: 100%;
    padding: 14px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.tc-accept-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

body:has(#tcModal:not(.hidden)) .main-content {
    pointer-events: none;
    filter: grayscale(100%) brightness(0.6);
    transition: filter 0.3s ease;
}

.tc-modal.hidden {
    display: none;
}

.main-content {
    transition: filter 0.3s ease;
}

/* Main App stype */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header Styles - Now inside the unified white card */
.header {
    background: transparent;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.header-content {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Header Row - Logo, Title, and DATACOM aligned horizontally */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-right {
    display: flex;
    align-items: flex-start;
}

/* Header Bottom - Subtitle and Navigation */
.header-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.logo-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo-left {
    display: flex;
    align-items: center;
}

.te-whatu-ora-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.te-whatu-ora-text {
    color: #1e3a8a;
    font-weight: 600;
    font-size: 20px;
}

.health-nz-text {
    color: #0d9488;
    font-weight: 500;
    font-size: 16px;
}

.logo-right {
    display: flex;
    align-items: center;
}

.datacom-logo {
    background: #1e3a8a;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    font-family: serif;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}

.logo-square {
    width: 30px;
    height: 30px;
    background: #4CAF50;
    border-radius: 4px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}

.logo-large {
    background: #1976D2;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
}

.tag-section {
    margin-bottom: 20px;
}

.health-tag {
    background: #4CAF50;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-block;
}

.title-section {
    text-align: center;
    margin-bottom: 20px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
    text-align: center;
    max-width: none;
    white-space: nowrap;
}

.info-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.info-link {
    background: #f1f3f5;
    color: #495057;
    padding: 3px 8px;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

/* Main Content - Unified white container with header inside */
.main-content {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 36px auto !important;
    padding: 36px 42px !important;
    background: white;
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* Full-width override for XML diff section */
.xml-diff-section {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.analysis-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    max-width: none;
    margin: 0;
    padding: 0;
}

.card-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-banner {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}



.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Compare button specific styles */
#compare-btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#compare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Comparison Section */
.comparison-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 24px 24px 24px;
}

/* Disclaimer Section */
.disclaimer-section {
    margin: 12px 0;
    padding: 0 24px;
}

.disclaimer-banner {
    background-color: #fff8e5;
    color: #8A6D3B;
    font-size: 0.95em;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #FFECB3;
    font-weight: normal;
    text-align: center;
    box-shadow: 0 1px 3px rgba(255, 236, 179, 0.3);
    margin: 0;
}

.disclaimer-banner span {
    display: block;
}

/* Upload Cards Row */
.upload-row {
    display: flex;
    gap: 24px;
    margin-top: 0;
}

.upload-section {
    flex: 1;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.upload-header {
    background: #f9fafb;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 20px;
}

.hnz-icon {
    color: #10b981;
}

.pms-icon {
    color: #3b82f6;
}

.upload-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.upload-box {
    padding: 32px 20px;
    border: 2px dashed #d1d5db;
    border-radius: 0 0 12px 12px;
    background: #fafafa;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-box:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.upload-box.dragover {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-arrow {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.upload-file-icon {
    font-size: 32px;
    color: #3b82f6;
    margin-bottom: 12px;
    opacity: 0.7;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.upload-subtext {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.select-file-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}



.select-file-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.file-description {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    margin-top: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    margin-top: 12px;
}

.file-info i {
    color: #10b981;
    font-size: 16px;
}

.file-info span {
    font-size: 14px;
    color: #1f2937;
}

.format-badge {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Summary Section */
.summary-section {
    width: 100%;
}

.results-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.results-icon {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.results-placeholder h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.results-placeholder p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-width: 480px;
}

.loading-content i {
    font-size: 40px;
    color: #007bff;
    margin-bottom: 15px;
}

.loading-content p {
    font-size: 16px;
    color: #333;
    margin: 0;
    font-weight: 700; /* make progress box title bold */
}

/* Loading progress bar */
.loading-progress {
    width: 480px; /* increased width */
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

/* Error Message */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f44336;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Comparison Results Styles */
.comparison-results {
    width: 100%;
}

/* New Comparison Results Styles */
.results-content {
    max-width: 100%;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.results-header h3 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-critical {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.results-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.metric-value {
    font-size: 28px;
    font-weight: bold;
    color: #1976D2;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}



.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.results-actions .btn {
    min-width: 180px;
}








/* Responsive Design */
@media (max-width: 768px) {
    .xml-comparison-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .comparison-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .xml-comparison-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

.results-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.results-tab-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.results-tab-btn:hover {
    background: #e9ecef;
}

.results-tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.results-tab {
    display: none;
}

.results-tab.active {
    display: block;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* XML-Aware Diff Section */
.xml-diff-section {
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: none;
    transition: all 0.3s ease;
    display: none; /* Hidden by default - only show when files are ready for comparison */
    opacity: 0;
    visibility: hidden;
}

.xml-diff-section.show {
    display: block !important; /* Show when needed - with high specificity */
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Emergency fallback for visibility - highest specificity */
.xml-diff-section[style*="display: block"],
.xml-diff-section[style*="display:block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Full-Screen Mode Styles */
.xml-diff-section.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 20px !important;
    border-radius: 0 !important;
    z-index: 99999 !important;
    background: white !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
    min-height: 100vh !important;
    min-width: 100vw !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
}



.xml-diff-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Left stack: title + legend */
.xml-diff-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Diff legend styles */
.diff-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
}

.legend-swatch {
    display: inline-block;
    width: 24px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-green {
    background: #eafff1; /* same as .diff-line.moved background */
    border-color: #34c759;
}

.legend-red {
    background: #ffebee; /* same as changed/deleted */
    border-color: #f44336;
}

.xml-diff-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.diff-controls {
    display: flex;
    gap: 10px;
}
.xml-diff-pair-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.xml-diff-container {
    display: flex !important;
    width: 100% !important;
    gap: 0 !important;
    margin-bottom: 20px !important;
    height: 700px !important;
    position: relative !important;
    overflow: hidden !important;
    max-width: none !important;
}
.xml-diff-container.collapsed {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 8px !important;
}
.xml-diff-container.collapsed .xml-diff-scroll-container {
    height: auto !important;
}
.xml-diff-container.collapsed .diff-panel {
    height: auto !important;
}

/* Synchronized scrolling container */
.xml-diff-scroll-container {
    display: flex !important;
    width: 100% !important;
    gap: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: none !important;
}

.diff-panel {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 50% !important;
    max-width: 100% !important;
    height: 100% !important;
    background: #f8f9fa !important;
    border-radius: 0 !important;
    border: 1px solid #e0e0e0 !important;
    overflow: visible !important;
}

.diff-panel:first-child {
    border-right: 1px solid #e0e0e0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.diff-panel:last-child {
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.diff-panel .panel-header {
    background: #e9ecef;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    display: grid;
    grid-template-columns: 1fr auto; /* filename grows, button stays fixed */
    column-gap: 10px;
    align-items: center; /* vertically center contents */
    /* Ensure both headers (with/without Collapse) have the exact same height */
    height: 48px;
    box-sizing: border-box;
}

.file-name {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Keep filename on a single line with ellipsis */
.diff-panel .panel-header .file-name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
}

/* Keep the per-panel collapse/expand control always visible */
.pair-toggle-btn,
#pair-first-toggle {
    white-space: nowrap;
    flex-shrink: 0;
    /* Place the Collapse button at the bottom-right within the grid header */
    align-self: end;
    justify-self: end;
}

.diff-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    background: #fff;
    border: none;
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* Unified line structure - line numbers and content are in the same container */
.diff-line {
    display: flex;
    align-items: flex-start;
    padding: 2px 0;
    border-radius: 0;
    margin: 0;
    min-height: 18px;
    width: 100%;
    max-width: none;
}

/* XML Diff Line Styles - Unified structure */

.diff-line.unchanged {
    background-color: transparent;
    border-left: none;
}

.diff-line.changed {
    background-color: #ffebee;
    border-left: 3px solid #f44336;
    position: relative;
    min-width: max-content;
    width: max-content;
}

.diff-line-number {
    color: #999;
    font-size: 11px;
    text-align: right;
    padding: 2px 8px;
    user-select: none;
    background: #f5f5f5;
    font-family: 'Courier New', monospace;
    min-height: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 50px;
    flex-shrink: 0;
    border-right: 1px solid #e0e0e0;
    padding-top: 4px;
}

.diff-line-content {
    color: #333;
    padding: 2px 12px;
    white-space: pre;
    font-family: 'Courier New', monospace;
    min-width: 0;
    max-width: none;
    flex: 1;
    min-height: 18px;
    display: flex;
    align-items: center;
}

/* Highlighting for changed elements in the new structure */
.diff-line-number.changed {
    background-color: #ffebee;
    border-left: 3px solid #f44336;
}

.diff-line-content.changed {
    background-color: #ffebee;
    min-width: max-content;
    width: max-content;
}

/* Highlighting for deleted elements */
.diff-line-number.deleted {
    background-color: #ffebee;
    border-left: 3px solid #f44336;
}

.diff-line-content.deleted {
    background-color: #ffebee;
    min-width: max-content;
    width: max-content;
    color: #d32f2f;
}

/* Highlighting for inserted elements */
.diff-line-number.inserted {
    background-color: #ffebee;
    border-left: 3px solid #d32f2f;
}

.diff-line-content.inserted {
    background-color: #ffebee;
    min-width: max-content;
    width: max-content;
    color: #d32f2f;
}

/* No Differences Message Styles */
.no-differences-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    width: 400px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.no-differences-content {
    text-align: center;
    color: #6c757d;
}

.no-differences-content i {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 16px;
    display: block;
}

.no-differences-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.no-differences-content p {
    font-size: 16px;
    margin: 0;
    color: #6c757d;
}



/* No Differences Modal Styles */
.no-differences-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 400px;
    width: 90%;
}

.no-differences-modal.show {
    opacity: 1;
}

.no-differences-modal-content {
    padding: 24px;
    text-align: center;
}

.no-differences-modal-content i {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 16px;
    display: block;
}

.no-differences-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.no-differences-modal-content p {
    font-size: 16px;
    margin: 0;
    color: #6c757d;
}

/* Responsive design for No Differences message */
@media (max-width: 768px) {
    .no-differences-message {
        width: 90%;
        height: 150px;
    }
    
    .no-differences-content i {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .no-differences-content h3 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .no-differences-content p {
        font-size: 14px;
    }
    
    .no-differences-modal {
        width: 95%;
    }
    
    .no-differences-modal-content {
        padding: 20px;
    }
    
    .no-differences-modal-content i {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .no-differences-modal-content h3 {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .no-differences-modal-content p {
        font-size: 14px;
    }
}

/* Context lines styling */
.diff-line.context-line {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.diff-line.context-line .diff-line-number {
    background-color: #f8f9fa;
    color: #6c757d;
    font-style: italic;
}

.diff-line.context-line .diff-line-content {
    background-color: #f8f9fa;
    color: #6c757d;
    font-style: italic;
}

/* Separator lines styling */
.diff-line.separator-line {
    background-color: white;
    border: none;
    height: 20px;
    min-height: 20px;
}

.diff-line.separator-line .diff-line-number {
    background-color: white;
    color: white;
    border: none;
}

.diff-line.separator-line .diff-line-content {
    background-color: white;
    color: white;
}

/* Legacy support for old structure */
.diff-line.changed .diff-line-content {
    background-color: #ffebee;
    min-width: max-content;
    width: max-content;
}

.diff-line.changed .diff-line-number {
    background-color: #ffebee;
}

/* Order-mismatch (moved) indicator: subtle green background with left border */
.diff-line.moved,
.diff-line-number.moved,
.diff-line-content.moved {
    background-color: #eafff1;
}

.diff-line.moved {
    border-left: 4px solid #34c759;
}

/* Responsive Design for Diff */
@media (max-width: 768px) {
    .xml-diff-container {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
    }
    
    .xml-diff-scroll-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .diff-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .xml-diff-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* XML Syntax Highlighting for Diff */
.diff-xml-tag {
    color: #1976D2;
    font-weight: bold;
}

.diff-xml-attribute {
    color: #d32f2f;
}

.diff-xml-value {
    color: #388e3c;
}

.diff-xml-comment {
    color: #666;
    font-style: italic;
}

/* Diff Summary */
.diff-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.diff-summary h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: bold;
}

.diff-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.diff-stat-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.diff-stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.diff-stat-value.removed {
    color: #f44336;
}

.diff-stat-value.added {
    color: #4caf50;
}

.diff-stat-value.modified {
    color: #ff9800;
}

.diff-stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Connection Lines */
.diff-connection-line {
    position: absolute;
    background: linear-gradient(90deg, #f44336, #4caf50);
    height: 2px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.diff-connection-line:hover {
    opacity: 1;
}

/* Collapsible XML Sections */
.xml-collapsible {
    cursor: pointer;
    user-select: none;
}

.xml-collapsible:hover {
    background-color: #f5f5f5;
}

.xml-collapsible-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    transition: transform 0.2s ease;
    position: relative;
}

.xml-collapsible-icon::before {
    content: '▶';
    color: #666;
}

.xml-collapsible.collapsed .xml-collapsible-icon::before {
    content: '▼';
}

.xml-collapsible-content {
    margin-left: 20px;
    border-left: 2px solid #e0e0e0;
    padding-left: 10px;
    transition: all 0.3s ease;
}

.xml-collapsible.collapsed .xml-collapsible-content {
    display: none;
}

/* TextCompare.com style highlighting */
.highlight-removed {
    background-color: #ffebee;
    color: #d32f2f;
    padding: 1px 2px;
    border-radius: 2px;
}

.highlight-added {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 1px 2px;
    border-radius: 2px;
}

.highlight-modified {
    background-color: #fff3cd;
    color: #f57c00;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Context separator for collapsed sections */
.context-separator {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    margin: 5px 0;
}

/* Desktop subtitle - ensure single line */
@media (min-width: 769px) {
    .subtitle {
        white-space: nowrap;
        font-size: 15px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        margin: 20px auto !important;
        padding: 24px 20px !important;
        border-radius: 12px;
    }
    
    .header-row {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .header-left {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .header-bottom {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .info-links {
        justify-content: center;
        gap: 16px;
    }
    
    .subtitle {
        font-size: 14px;
        white-space: normal;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .te-whatu-ora-text {
        font-size: 18px;
    }
    
    .upload-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .upload-box {
        min-height: 160px;
        padding: 24px 16px;
    }
    
    .upload-arrow {
        font-size: 36px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .upload-subtext {
        font-size: 12px;
    }
    
    .disclaimer-banner {
        font-size: 0.9em;
        padding: 6px 10px;
    }
    
    .card-header {
        padding: 16px 20px;
    }
    
    .card-title {
        font-size: 22px;
    }
    

}

/* New CDA Comparison Summary Styles */
.comparison-results {
    width: 100%;
    padding: 24px;
}

.results-content {
    max-width: 100%;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.results-header h3 {
    font-size: 24px;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* New Grid Layout for Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: help;
    position: relative;
}



.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1;
    color: #3b82f6; /* Blue color for all similarity percentages */
}

/* Color coding based on percentage ranges */
.metric-value.green {
    color: #10b981; /* Green for 100% matches */
}

.metric-value.amber {
    color: #f59e0b; /* Amber for below 100% matches */
}

.metric-value.gray {
    color: #888888;
}

.metric-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.3;
}

/* Summary Field */
.summary-field {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    margin-top: 16px;
}

.summary-text {
    font-size: 24px;
    font-style: italic;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    color: #10b981; /* Default green color */
    text-align: center;
}

/* Summary text color classes to match percentage colors */
.summary-text.green {
    color: #10b981; /* Green for 100% matches and identical files */
}

.summary-text.amber {
    color: #f59e0b; /* Amber for below 100% matches */
}

/* Attachment Analysis Section */
.attachment-analysis-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    margin-top: 24px;
    margin-bottom: 24px; /* add gap to XML-Aware Document Comparison */
    overflow: hidden;
    transition: all 0.3s ease;
}

.attachment-analysis-section.show {
    opacity: 1;
    transform: translateY(0);
}

.attachment-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.attachment-analysis-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.attachment-controls {
    display: flex;
    gap: 12px;
}

/* Attachment Comparison Container */
.attachment-comparison-container {
    display: flex;
    height: 400px;
    overflow: hidden;
}

.attachment-comparison-scroll-container {
    display: flex;
    width: 100%;
    overflow: hidden;
}

/* Synchronized scrolling for attachments */
.attachment-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: white;
    scroll-behavior: auto; /* Use auto for better performance with JS-controlled scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    will-change: scroll-position; /* Optimize for scrolling */
}

.attachment-content::-webkit-scrollbar {
    width: 8px;
}

.attachment-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.attachment-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.attachment-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.attachment-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
    background: #fafafa;
}

.attachment-panel:last-child {
    border-right: none;
}

.attachment-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 500;
}

.attachment-panel .file-name {
    color: #374151;
    font-weight: 600;
}

.attachment-panel .attachment-stats {
    color: #6b7280;
    font-size: 12px;
}

.attachment-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: white;
}

/* Attachment Item Styles */
.attachment-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px; /* reduced padding to tighten card */
    margin-bottom: 10px; /* slightly reduced gap between cards */
    transition: all 0.2s ease;
    position: relative;
}

.attachment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.attachment-item.matched {
    border-left: 4px solid #10b981;
}

.attachment-item.unmatched {
    border-left: 4px solid #f59e0b;
}

/* Red side line for clearly unmatched items */
.attachment-item.red-border {
    border-left: 4px solid #dc2626;
}

.attachment-spacer {
    background: transparent;
    border: none;
    pointer-events: none;
}

.attachment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px; /* slightly tighter gap */
}

/* Tighten details spacing only within attachment cards while keeping gray background */
.attachment-item .attachment-details {
    margin-top: 6px;
    padding: 10px; /* reduced from global 20px */
    background: #f8f9fa; /* keep gray background */
    border: 1px solid #e9ecef; /* keep subtle border */
    border-radius: 6px; /* slightly smaller radius inside card */
}

.attachment-filename {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    word-break: break-all;
}

.attachment-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.attachment-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.attachment-detail-item i {
    width: 12px;
    color: #9ca3af;
}

/* Attachment action buttons: keep on one line with small gap and spacing from details */
.attachment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px; /* slightly increased gap above buttons */
    flex-wrap: nowrap;
}

/* No Attachments Message */
.no-attachments-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    text-align: center;
    padding: 40px 20px;
}

.no-attachments-message i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.no-attachments-message h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.no-attachments-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Attachment Details Styles */
.attachment-details {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.attachment-summary h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachment-summary h4 i {
    color: #6c757d;
}

.attachment-summary p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
}

.attachment-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.stat-item i {
    color: #6c757d;
}

.attachment-matches {
    margin-top: 20px;
}

.attachment-matches h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-item {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    background: white;
    transition: all 0.2s ease;
}

.match-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.match-item.high {
    border-left: 4px solid #28a745;
}

.match-item.medium {
    border-left: 4px solid #ffc107;
}

.match-item.low {
    border-left: 4px solid #dc3545;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.filename {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.similarity-score {
    font-weight: 600;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.similarity-score.high {
    background: #d4edda;
    color: #155724;
}

.similarity-score.medium {
    background: #fff3cd;
    color: #856404;
}

.similarity-score.low {
    background: #f8d7da;
    color: #721c24;
}

.match-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6c757d;
}

.match-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Action Buttons */
.results-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
    margin-top: 24px;
}

    .results-actions .btn {
        min-width: 180px;
        padding: 12px 24px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 6px;
        transition: all 0.2s ease;
    }
    
    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
    }
    
    .modal-content {
        background-color: white;
        margin: 5% auto;
        padding: 0;
        border-radius: 8px;
        width: 90%;
        max-width: 500px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        animation: modalSlideIn 0.3s ease-out;
    }
    
    @keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: translateY(-50px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .modal-header {
        background: linear-gradient(135deg, #1e3a8a 0%, #0d9488 100%);
        color: white;
        padding: 20px;
        border-radius: 8px 8px 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .modal-header h3 {
        margin: 0;
        font-size: 1.3em;
    }
    
    .close {
        color: white;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
        line-height: 1;
    }
    
    .close:hover {
        opacity: 0.7;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        display: inline-block;
        margin-bottom: 0;
        font-weight: 600;
        color: #333;
    }
    
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 14px;
        font-family: inherit;
        box-sizing: border-box;
    }
    
    .form-group textarea {
        resize: vertical;
        min-height: 100px;
    }
    
    .form-group textarea:focus,
    .form-group select:focus {
        outline: none;
        border-color: #1e3a8a;
        box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
    }
    
    .modal-footer {
        padding: 20px;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }
    
    .btn-success {
        background-color: #10b981;
        color: white;
        border: none;
    }
    
    .btn-success:hover {
        background-color: #059669;
    }

/* Responsive Design */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .results-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Footer Styles */
.app-footer {
    background: transparent;
    border-top: 1px solid #e5e7eb;
    padding: 24px 20px 20px 20px;
    text-align: center;
    margin-top: 40px;
}

.app-footer p {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

/* Mobile responsiveness for footer */
@media (max-width: 768px) {
    .app-footer {
        padding: 20px 16px 16px 16px;
        margin-top: 32px;
    }
    
    .app-footer p {
        font-size: 12px;
        line-height: 1.3;
    }
}

/* Multiple File Pairs Styles */
.multiple-pairs-info {
    color: #6b7280;
    margin-top: 8px;
    font-size: 14px;
}

.multiple-pairs-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.multiple-pairs-section h4 {
    margin-bottom: 20px;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
}

.file-pairs-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.file-pair-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.file-pair-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
    transform: translateY(-2px);
}

.file-pair-card.selected {
    border-color: #3b82f6;
    background: #f8faff;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.file-pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.file-pair-header h5 {
    margin: 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.file-pair-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.file-pair-status.green {
    background-color: #10b981;
}

.file-pair-status.amber {
    background-color: #f59e0b;
}

.file-pair-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-pair-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    min-height: 44px;
}

.file-info i {
    font-size: 14px;
}

.file-info .hnz-icon {
    color: #059669;
}

.file-info .pms-icon {
    color: #dc2626;
}

.file-name {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    flex: 1;
}

/* Ensure XML viewer filenames are not truncated, including after fullscreen toggles */
.diff-panel .panel-header .file-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    flex: 1 1 auto !important;
}

.file-pair-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mini-metric {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.mini-value {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.mini-value.green {
    color: #065f46;
    background-color: #d1fae5;
}

.mini-value.amber {
    color: #92400e;
    background-color: #fef3c7;
}

.mini-value.gray {
    color: #4b5563;
    background-color: #f3f4f6;
}

.file-pair-actions {
    display: flex;
    justify-content: flex-end;
}

/* Simple utility for red text */
.text-red {
    color: #dc2626 !important;
}

.btn.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.metric-value.blue {
    color: #1e40af;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

/* Responsive adjustments for file pairs - single column layout */
@media (max-width: 768px) {
    .file-pairs-list {
        gap: 12px;
    }
    
    .file-pair-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .file-pair-metrics {
        flex-direction: column;
        gap: 8px;
    }
    
    .file-name {
        max-width: 280px;
    }
}