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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1d1d1f;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ignore-fields {
    flex: 1;
    margin-right: 20px;
}

.ignore-fields label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #424245;
}

.ignore-fields input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'SF Mono', Monaco, monospace;
    transition: border-color 0.2s ease;
}

.ignore-fields input:focus {
    outline: none;
    border-color: #007aff;
}

.compare-btn {
    padding: 12px 24px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.compare-btn:hover {
    background: #0056b3;
}

.compare-btn:active {
    transform: translateY(1px);
}

.status-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: none;
}

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

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
    display: block;
}

.comparison-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-panel h3 {
    margin-bottom: 15px;
    color: #1d1d1f;
    font-weight: 600;
}

.textarea-container {
    position: relative;
    height: 500px;
}

textarea {
    width: 100%;
    height: 100%;
    padding: 16px;
    border: 2px solid #d2d2d7;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: none;
    background: #fafafa;
    transition: border-color 0.2s ease;
    position: relative;
    z-index: 1;
}

textarea:focus {
    outline: none;
    border-color: #007aff;
    background: white;
}

textarea.has-diff {
    border-color: #ff3b30;
    background: #fff5f5;
}

textarea.json-syntax-invalid {
    border-color: #ff3b30;
    background: #fff5f5;
    animation: shake 0.3s ease-in-out;
}

textarea.comparison-success {
    border-color: #34c759;
    background: #f0fff0;
}

textarea.comparison-error {
    border-color: #ff3b30;
    background: #fff5f5;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.highlight-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    padding: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    border-radius: 8px;
}

.diff-line {
    background-color: rgba(255, 59, 48, 0.2);
    display: inline-block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.diff-summary {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
}

.diff-summary.show {
    display: block;
}

.diff-summary h3 {
    margin-bottom: 15px;
    color: #1d1d1f;
    font-weight: 600;
}

.diff-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fff5f5;
    border-left: 4px solid #ff3b30;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

.diff-path {
    font-weight: 600;
    color: #ff3b30;
}

.diff-values {
    margin-top: 4px;
    color: #424245;
}

@media (max-width: 768px) {
    .comparison-area {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .ignore-fields {
        margin-right: 0;
    }
}