* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.file-inputs {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.file-input-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-input-group:last-child {
    margin-bottom: 0;
}

.file-input-group label {
    font-weight: 600;
    min-width: 150px;
    color: #333;
}

.file-input-group input[type="file"] {
    padding: 8px;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    flex: 0 0 auto;
}

.file-name {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

.action-buttons {
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

button {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#process-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

#clear-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.status {
    padding: 15px 30px;
    font-weight: 500;
    text-align: center;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
}

.results {
    padding: 30px;
}

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

.results-header h2 {
    color: #333;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-label {
    font-weight: 600;
    color: #333;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
}

.legend-item.added {
    background: #d4edda;
    color: #155724;
}

.legend-item.removed {
    background: #f8d7da;
    color: #721c24;
}

.legend-item.changed {
    background: #fff3cd;
    color: #856404;
}

.results-content {
    min-height: 200px;
}

.placeholder {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 1.1em;
}

.diff-tree {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

.diff-item {
    margin: 8px 0;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid transparent;
    transition: opacity 0.2s ease;
}

.diff-item.filtered-out {
    display: none;
}

.diff-item.added {
    background: #d4edda;
    border-left-color: #28a745;
}

.diff-item.removed {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.diff-item.changed {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.diff-path {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    cursor: pointer;
    user-select: none;
}

.diff-path:hover {
    opacity: 0.8;
}

.diff-path::before {
    content: '▶ ';
    display: inline-block;
    transition: transform 0.2s ease;
    margin-right: 5px;
}

.diff-path.expanded::before {
    transform: rotate(90deg);
}

.diff-details {
    margin-top: 8px;
    padding-left: 20px;
    display: none;
}

.diff-details.visible {
    display: block;
}

.diff-value {
    margin: 5px 0;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    word-break: break-all;
}

.diff-label {
    font-weight: 600;
    margin-right: 8px;
    color: #555;
}

.diff-nested {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 2px solid #e0e0e0;
}

.summary {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #0066cc;
}

.summary h3 {
    color: #0066cc;
    margin-bottom: 10px;
}

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

.summary-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-stat .count {
    font-weight: 700;
    font-size: 1.2em;
}

.summary-stat.added .count {
    color: #28a745;
}

.summary-stat.removed .count {
    color: #dc3545;
}

.summary-stat.changed .count {
    color: #ffc107;
}

.no-differences {
    text-align: center;
    padding: 40px;
    background: #d4edda;
    border-radius: 6px;
    color: #155724;
    font-size: 1.2em;
    font-weight: 600;
}

.collapse-all-btn {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.collapse-all-btn:hover {
    background: #5a6268;
}

/* Pagination styles */
.pagination-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.pagination-info {
    color: #555;
    font-size: 0.95em;
    font-weight: 500;
    text-align: center;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: 600;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    cursor: default;
}

.pagination-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
    font-weight: 600;
    user-select: none;
}

