/* Text Difference Checker Styles */

.text-difference-tool {
    min-height: 100vh;
    background: white;
    padding: 2rem 0;
}

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

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tool-header h1 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.tool-description {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
}

.difference-interface {
    margin-bottom: 3rem;
}

.difference-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* View Toggle Section */
.view-toggle-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.view-toggle-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.view-toggle-section h4 i {
    margin-right: 0.5rem;
    color: #667eea;
}

.toggle-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toggle-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

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

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

.input-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.input-label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.input-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.input-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #667eea;
}

.action-btn:hover {
    background: #667eea;
    color: white;
}

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.input-status-container {
    display: flex;
    align-items: center;
}

.input-status-container i {
    margin-right: 0.25rem;
    color: #667eea;
}

/* Options Section */
.options-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e8ebff;
}

.options-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.options-section h4 i {
    margin-right: 0.5rem;
    color: #667eea;
}

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

.option-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.option-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.option-item input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

/* Compare Section */
.compare-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.compare-btn, .reset-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    justify-content: center;
}

.compare-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.compare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.reset-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.reset-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Error and Loading */
.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fcc;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: #667eea;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

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

.result-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Comparison Views */
.comparison-view {
    margin-bottom: 2rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-column {
    background: #fafafa;
}

.column-header {
    background: #f0f0f0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.column-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-content {
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

/* Unified Diff View */
.unified-header {
    background: #f0f0f0;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e0e0e0;
    border-bottom: none;
}

.unified-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unified-content {
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

/* Difference Highlighting */
.diff-line {
    padding: 0.2rem 0.5rem;
    margin: 0.1rem 0;
    border-radius: 4px;
    position: relative;
}

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

.diff-deleted {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.diff-modified {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

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

.line-number {
    display: inline-block;
    width: 40px;
    color: #999;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    text-align: right;
}

/* Comparison Statistics */
.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e8ebff;
}

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

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

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

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

.stat-value.deleted {
    color: #dc3545;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .difference-card {
        padding: 1rem;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .toggle-buttons {
        justify-content: center;
    }
    
    .compare-section {
        flex-direction: column;
        align-items: center;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .comparison-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Examples Section */
.examples-section {
    margin-bottom: 3rem;
}

.examples-section h3 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.examples-section h3 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

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

.example-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.example-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.example-title i {
    margin-right: 0.5rem;
    color: #667eea;
}

.example-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Information Section */
.info-section {
    margin-top: 4rem;
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.info-card h3 i {
    margin-right: 0.75rem;
    color: #667eea;
    font-size: 1.3rem;
}

.info-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #444;
    margin: 1.5rem 0 0.75rem 0;
}

.info-card p {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1rem;
}

.info-card ul {
    margin: 1rem 0;
    padding-left: 0;
}

.info-card li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-card li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.info-card ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-card ol li {
    padding-left: 0.5rem;
}

.info-card ol li::before {
    display: none;
}

.info-card strong {
    color: #333;
    font-weight: 600;
}

@media (max-width: 768px) {
    .examples-section h3 {
        font-size: 1.5rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 1.5rem;
    }

    .info-card h3 {
        font-size: 1.3rem;
    }

    .info-card h4 {
        font-size: 1.1rem;
    }
}
