/* Text Compare Tool Styles */

:root {
    --primary-color: #e67e22;
    --primary-hover: #d35400;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --gradient-start: #e67e22;
    --gradient-end: #2c3e50;
    --diff-added: #d4edda;
    --diff-removed: #f8d7da;
    --diff-modified: #fff3cd;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    padding: 4rem 0;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.hero-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="2"/></g></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    color: white;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-feature {
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-feature i {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Tool Container */
.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow-x: auto;
    gap: 0.25rem;
}

.mode-tab {
    flex: 1;
    min-width: 160px;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    white-space: nowrap;
}

.mode-tab:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.mode-tab.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.mode-tab i {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    min-height: 600px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.input-header h3 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 120px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

/* Comparison Inputs */
.comparison-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: start;
}

.text-input-container {
    display: flex;
    flex-direction: column;
}

.input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.input-label h4 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.text-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.text-meta span {
    white-space: nowrap;
}

#text1, #text2 {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

#text1:focus, #text2:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

#text1::placeholder, #text2::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Comparison VS */
.comparison-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0.5rem;
}

.vs-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.vs-indicator i {
    font-size: 1.5rem;
}

/* Input Actions */
.input-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Quick Options */
.quick-options {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.quick-options h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.option-item label {
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Summary Card */
.summary-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary-color);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-header h3 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-meta {
    display: flex;
    gap: 1rem;
}

.similarity-score, .change-count {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.similarity-score {
    background: var(--primary-color);
    color: white;
}

.change-count {
    background: var(--light-bg);
    color: var(--text-primary);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Comparison Results */
.comparison-results {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h3 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.diff-container {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 500px;
    overflow-y: auto;
}

/* Diff Styling */
.diff-line {
    display: flex;
    align-items: flex-start;
    padding: 0.25rem 0.5rem;
    margin: 1px 0;
    border-left: 3px solid transparent;
}

.diff-line.added {
    background-color: var(--diff-added);
    border-left-color: var(--success-color);
}

.diff-line.removed {
    background-color: var(--diff-removed);
    border-left-color: var(--accent-color);
}

.diff-line.modified {
    background-color: var(--diff-modified);
    border-left-color: var(--warning-color);
}

.diff-line.unchanged {
    background-color: transparent;
    border-left-color: transparent;
}

.line-number {
    display: inline-block;
    width: 3rem;
    text-align: right;
    margin-right: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    user-select: none;
}

.diff-prefix {
    margin-right: 0.5rem;
    font-weight: bold;
    user-select: none;
}

.diff-prefix.added {
    color: var(--success-color);
}

.diff-prefix.removed {
    color: var(--accent-color);
}

.diff-content {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Changes Section */
.changes-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.changes-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.changes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.change-item {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.change-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.change-description {
    color: var(--text-primary);
    line-height: 1.5;
}

/* Export Section */
.export-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.export-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Advanced Section */
.advanced-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.advanced-header h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.options-category {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

.options-category h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-schemes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.scheme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.algorithm-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-range {
    width: 100%;
}

#context-lines-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Batch Section */
.batch-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.batch-header h3 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.batch-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.batch-list {
    min-height: 400px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

/* History Section */
.history-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-header h3 {
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-list {
    min-height: 400px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0;
}

/* Guide Section */
.guide-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.guide-section h3 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-content {
    max-width: 800px;
}

.guide-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.guide-card h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.method-explanations, .use-cases {
    display: grid;
    gap: 1.5rem;
}

.method-item, .use-case-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.method-item h5, .use-case-item h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.method-item p, .use-case-item p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip-category {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

.tip-category h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tip-category ul {
    margin: 0;
    padding-left: 1rem;
}

.tip-category li {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-features {
        gap: 1rem;
    }
    
    .hero-feature {
        font-size: 0.9rem;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-tab {
        min-width: auto;
    }
    
    .comparison-inputs {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .comparison-vs {
        flex-direction: row;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .vs-indicator {
        flex-direction: row;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .input-controls {
        width: 100%;
    }
    
    .form-select {
        flex: 1;
        min-width: auto;
    }
    
    .input-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .algorithm-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .input-section {
        padding: 1rem;
    }
    
    #text1, #text2 {
        min-height: 200px;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .comparison-results {
        padding: 1rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Success/Error States */
.success-message {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    background: var(--accent-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
