* {
    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: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 16px;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

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

.controls select {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    background: white;
}

.controls button {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#compareBtn {
    background: #667eea;
    color: white;
}

#compareBtn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

#clearBtn {
    background: #e0e0e0;
    color: #333;
}

#clearBtn:hover {
    background: #d0d0d0;
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.text-input h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.text-input textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

.text-input textarea:focus {
    border-color: #667eea;
}

.output-section {
    margin-top: 30px;
}

.output-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.legend-color.removed {
    background: #ffebee;
    border: 2px solid #ef5350;
}

.legend-color.added {
    background: #e8f5e9;
    border: 2px solid #66bb6a;
}

.legend-color.unchanged {
    background: #f5f5f5;
    border: 2px solid #999;
}

.output {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

.diff-line {
    margin: 2px 0;
    padding: 3px 5px;
    border-radius: 3px;
}

.diff-removed {
    background-color: #ffebee;
    color: #c62828;
    text-decoration: line-through;
}

.diff-added {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.diff-unchanged {
    color: #666;
}

.diff-word {
    display: inline;
    padding: 2px 4px;
    border-radius: 2px;
    margin: 0 1px;
}

@media (max-width: 768px) {
    .input-section {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 20px;
    }
    
    .controls {
        justify-content: center;
    }
    
    .legend {
        flex-direction: column;
        gap: 10px;
    }
}
