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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    min-height: 100vh;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c5aa0;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.controls {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.compare-options {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.compare-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.compare-options input[type="radio"],
.compare-options input[type="checkbox"] {
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.primary-btn {
    background: #2c5aa0;
    color: white;
}

.primary-btn:hover {
    background: #1e3f73;
    transform: translateY(-2px);
}

.secondary-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.secondary-btn:hover {
    background: #e0e0e0;
}

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

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

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

.panel-header h3 {
    color: #2c5aa0;
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload label {
    background: #84fab0;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.file-upload label:hover {
    background: #6ee89a;
}

.input-panel textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s;
}

.input-panel textarea:focus {
    outline: none;
    border-color: #2c5aa0;
}

.text-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
    color: #666;
}

.diff-stats {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.diff-stats h3 {
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    border-radius: 5px;
    border: 2px solid;
}

.stat-item.added {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.stat-item.deleted {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.stat-item.modified {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

.stat-item.similarity {
    border-color: #2196f3;
    background: rgba(33, 150, 243, 0.1);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.diff-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

.diff-header h3 {
    color: #2c5aa0;
}

.diff-controls {
    display: flex;
    gap: 1rem;
}

.diff-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.legend-item.added {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

.legend-item.deleted {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

.legend-item.modified {
    background: rgba(255, 152, 0, 0.2);
    color: #ef6c00;
}

.legend-item.unchanged {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.diff-output {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.diff-line {
    display: flex;
    align-items: flex-start;
    min-height: 20px;
    padding: 0.25rem 0.5rem;
}

.diff-line.added {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
}

.diff-line.deleted {
    background: rgba(244, 67, 54, 0.1);
    border-left: 3px solid #f44336;
}

.diff-line.modified {
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
}

.diff-line.unchanged {
    background: transparent;
}

.line-number {
    display: inline-block;
    min-width: 40px;
    padding-right: 1rem;
    color: #999;
    text-align: right;
    user-select: none;
}

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

.features {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.features h3 {
    color: #2c5aa0;
    margin-bottom: 1.5rem;
    text-align: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

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

.feature-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-item p {
    color: #666;
    line-height: 1.5;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.ad-area {
    background: #f0f0f0;
    padding: 2rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 2px dashed #ccc;
}

@media (max-width: 768px) {
    .input-container {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .compare-options {
        justify-content: center;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .diff-legend {
        justify-content: center;
    }
    
    .diff-controls {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}