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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

/* Free badge styling */
.free-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    margin: 15px auto 0;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.input-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95rem;
}

.input-group textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.compare-btn, .clear-btn, .swap-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

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

.clear-btn {
    background: #ff6b6b;
    color: white;
}

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

.swap-btn {
    background: #4ecdc4;
    color: white;
}

.swap-btn:hover {
    background: #45b7aa;
    transform: translateY(-2px);
}

.result-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.result-section h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-width: 120px;
    position: relative;
}

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

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-color-info {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.diff-side h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1rem;
}

.diff-content {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Character-level detailed diff styles */
.diff-char-added {
    background-color: #d4edda;
    color: #155724;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

.diff-char-deleted {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
    text-decoration: line-through;
}

.diff-char-changed {
    background-color: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Basic diff-line styles */
.diff-line {
    padding: 2px 5px;
    margin: 1px 0;
    border-radius: 3px;
    line-height: 1.8;
}

.diff-added {
    background-color: #d4edda;
    color: #155724;
    border-left: 3px solid #28a745;
}

.diff-deleted {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

.diff-changed {
    background-color: #fff8e1;
    border-left: 3px solid #ffc107;
}

.diff-unchanged {
    background-color: transparent;
    color: #333;
}

.example-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.example-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.example-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.example-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Features section styling */
.features-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.features-section h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

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

.feature-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-item h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-item p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Free info section styling */
.free-info {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border: 2px solid #28a745;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.1);
}

.free-info h3 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.free-info p {
    color: #555;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.free-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.free-features span {
    background: white;
    color: #28a745;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #28a745;
}

/* Responsive design */
@media (max-width: 768px) {
    .text-input-container {
        grid-template-columns: 1fr;
    }
    
    .diff-container {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .free-features {
        flex-direction: column;
        align-items: center;
    }
    
    .free-features span {
        width: 100%;
        text-align: center;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Scrollbar styling */
.diff-content::-webkit-scrollbar {
    width: 8px;
}

.diff-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.diff-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.diff-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
