:root {
    --primary-color: #0052cc;
    --primary-hover: #0747a6;
    --success-color: #36b37e;
    --danger-color: #de350b;
    --warning-color: #ffab00;
    --neutral-color: #6b778c;
    --background: #ffffff;
    --surface: #f4f5f7;
    --surface-hover: #ebecf0;
    --text-primary: #172b4d;
    --text-secondary: #6b778c;
    --border-color: #dfe1e6;
    --added-bg: #e3fcef;
    --added-border: #36b37e;
    --deleted-bg: #ffebe6;
    --deleted-border: #de350b;
    --modified-bg: #fff4e5;
    --modified-border: #ffab00;
    --unchanged-bg: #f4f5f7;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    background: var(--background);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo {
    width: 48px;
    height: 48px;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.controls {
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.view-controls {
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    border-radius: 8px;
    padding: 0.25rem;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

.view-btn.active {
    background: var(--background);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-panel {
    background: var(--background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.line-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.text-input {
    width: 100%;
    height: 300px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    background: var(--background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.stat-value.added {
    background: var(--added-bg);
    color: var(--success-color);
}

.stat-value.deleted {
    background: var(--deleted-bg);
    color: var(--danger-color);
}

.stat-value.modified {
    background: var(--modified-bg);
    color: var(--warning-color);
}

.stat-value.unchanged {
    background: var(--unchanged-bg);
    color: var(--text-secondary);
}

.result-section {
    background: var(--background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.diff-output {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.diff-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.diff-panel {
    background: var(--background);
    border-radius: 8px;
    overflow-x: auto;
}

.diff-unified {
    background: var(--background);
    border-radius: 8px;
}

.diff-lines {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.diff-line {
    display: flex;
    min-height: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.diff-line:last-child {
    border-bottom: none;
}

.line-number {
    display: inline-block;
    min-width: 3rem;
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    color: var(--text-secondary);
    text-align: right;
    font-size: 0.75rem;
    border-right: 1px solid var(--border-color);
    user-select: none;
}

.line-content {
    flex: 1;
    padding: 0.25rem 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-line.added {
    background: var(--added-bg);
}

.diff-line.added .line-content {
    color: var(--success-color);
}

.diff-line.deleted {
    background: var(--deleted-bg);
}

.diff-line.deleted .line-content {
    color: var(--danger-color);
}

.diff-line.unchanged {
    background: var(--background);
}

.diff-line.empty {
    background: var(--unchanged-bg);
}

.diff-unified .line-number {
    min-width: 2.5rem;
}

.diff-unified .diff-line {
    display: flex;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: white;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .logo {
        width: 36px;
        height: 36px;
    }
    
    .controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
        justify-content: center;
    }
    
    .view-controls {
        width: 100%;
        justify-content: center;
    }
    
    .input-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .text-input {
        height: 200px;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .diff-side-by-side {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}