/* Text Diff Tool Styles */

.diff-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.control-group select {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.875rem;
}

.control-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

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

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

.text-input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.text-input-group textarea {
    min-height: 200px;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.text-input-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Stats Container */
.diff-stats {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #495057;
}

.stat-item.added .stat-value {
    color: #28a745;
}

.stat-item.removed .stat-value {
    color: #dc3545;
}

.stat-item.modified .stat-value {
    color: #ffc107;
}

.stat-item.unchanged .stat-value {
    color: #6c757d;
}

/* Diff Container */
#diff-container {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
    overflow: hidden;
}

.no-diff {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Side by Side View */
.diff-side-by-side {
    display: flex;
    flex-direction: column;
}

.diff-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.diff-column-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e9ecef;
}

.diff-column-header:last-child {
    border-right: none;
}

.left-header {
    background: #fff5f5;
}

.right-header {
    background: #f0fff4;
}

.diff-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 600px;
    overflow-y: auto;
}

.diff-column {
    border-right: 1px solid #e9ecef;
}

.diff-column:last-child {
    border-right: none;
}

.diff-line {
    display: flex;
    min-height: 1.5rem;
    line-height: 1.5;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.line-number {
    display: inline-block;
    width: 3rem;
    padding: 0 0.5rem;
    background: #f8f9fa;
    color: #6c757d;
    text-align: right;
    border-right: 1px solid #e9ecef;
    user-select: none;
    flex-shrink: 0;
}

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

/* Diff line types */
.diff-line.unchanged {
    background: white;
}

.diff-line.added {
    background: #d4edda;
}

.diff-line.removed {
    background: #f8d7da;
}

.diff-line.modified {
    background: #fff3cd;
}

.diff-line.added.has-change {
    background: #c3e6cb;
}

.diff-line.removed.has-change {
    background: #f5c6cb;
}

/* Unified View */
.diff-unified {
    display: flex;
    flex-direction: column;
}

.diff-unified .diff-header {
    display: block;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.diff-title {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #495057;
}

.diff-unified .diff-content {
    display: block;
    max-height: 600px;
    overflow-y: auto;
}

.diff-unified .diff-line {
    display: flex;
    min-height: 1.5rem;
    line-height: 1.5;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.line-marker {
    display: inline-block;
    width: 1.5rem;
    padding: 0 0.25rem;
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
    border-right: 1px solid #e9ecef;
    user-select: none;
    flex-shrink: 0;
    font-weight: bold;
}

.diff-unified .diff-line.added .line-marker {
    background: #d4edda;
    color: #155724;
}

.diff-unified .diff-line.removed .line-marker {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .diff-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button-group {
        margin-left: 0;
        justify-content: center;
    }
    
    .text-input-section {
        grid-template-columns: 1fr;
    }
    
    .diff-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .diff-header {
        grid-template-columns: 1fr;
    }
    
    .diff-content {
        grid-template-columns: 1fr;
    }
    
    .diff-column {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .diff-column:last-child {
        border-bottom: none;
    }
    
    .line-number {
        width: 2.5rem;
    }
}

@media (max-width: 480px) {
    .text-input-group textarea {
        min-height: 150px;
    }
    
    .diff-content {
        max-height: 400px;
    }
    
    .line-content {
        padding: 0 0.5rem;
    }
}