/* Perfect Text Diff Checker Styles */
.text-diff-checker-wrapper {
    max-width: 1300px;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff !important;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

.diff-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f4f8;
}

.diff-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.diff-description {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

.diff-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 20px;
}

.control-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

#swap-texts:focus {
    color: black !important;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white !important    ;
    color: #475569;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.diff-options {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #475569;
    position: relative;
    transition: color 0.2s ease;
}

.option-label:hover {
    color: #334155;
}

.option-label input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    transform: scale(1.05);
}

.option-label input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.text-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.3s ease;
}

.text-panel:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
}

.char-count {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    padding: 4px 8px;
    background: #e2e8f0;
    border-radius: 6px;
}

.text-input {
    width: 100%;
    border: none;
    padding: 24px;
    resize: vertical;
    font-family: "SFMono-Regular", "Monaco", "Inconsolata", "Fira Code", "Fira Mono", "Droid Sans Mono", "Consolas", "Liberation Mono", "Menlo", monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: white !important;
    color: #1e293b;
    outline: none;
    transition: background-color 0.2s ease;
    min-height: 200px;
}

.text-input:focus {
    background: #fafbfc;
}

.text-input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.diff-results {
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.diff-stats {
    display: flex;
    gap: 18px;
    align-items: center;
}

.stat {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e2e8f0;
}

.result-panel {
    background: white;
    padding: 0;
}

.result-title {
    margin: 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

.result-content {
    padding: 24px;
    font-family: "SFMono-Regular", "Monaco", "Inconsolata", "Fira Code", "Fira Mono", "Droid Sans Mono", "Consolas", "Liberation Mono", "Menlo", monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 800px;
    overflow-y: auto;
    background: #fafbfc;
}

.diff-line {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
    min-height: 24px;
    padding: 2px 0;
}

.diff-line:hover {
    background: rgba(0,0,0,0.02);
}

.line-number {
    display: inline-block;
    width: 50px;
    text-align: right;
    padding-right: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    user-select: none;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
    margin-right: 12px;
    line-height: 1.5;
}

.line-content {
    flex: 1;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.line-added {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
}

.line-added .line-number {
    background: #dcfce7;
    color: #166534;
}

.line-removed {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}

.line-removed .line-number {
    background: #fee2e2;
    color: #991b1b;
}

.line-unchanged .line-number {
    color: #64748b;
}

.line-empty {
    background: #f8fafc;
    border-left: 3px solid #e2e8f0;
    min-height: 24px;
}

.line-empty .line-number {
    color: transparent;
    background: #f1f5f9;
}

.line-empty .line-content {
    color: transparent;
}

.result-content::-webkit-scrollbar {
    width: 8px;
}

.result-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.diff-added {
    /* background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    padding: 3px 6px;
    border-radius: 4px;
    margin: 0 1px;
    border: 1px solid #86efac;
    font-weight: 500; */
    background: #bbf7d0;
    color: #065f46;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 500;
}

.diff-removed {
    /* background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 3px 6px;
    border-radius: 4px;
    margin: 0 1px;
    text-decoration: line-through;
    border: 1px solid #f87171;
    font-weight: 500; */
    background: #fecaca;
    color: #991b1b;
    padding: 1px 3px;
    border-radius: 3px;
    text-decoration: line-through;
    font-weight: 500;
}

.diff-unchanged {
    color: #475569;
}

.diff-legend {
    display: flex;
    justify-content: center;
    gap: 35px;
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.legend-color.added {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #86efac;
}

.legend-color.removed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
}

.legend-color.unchanged {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Loading State */
.btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth animations */
.diff-results {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for active elements */
.btn:focus {
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Notification animations */
@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutNotification {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .text-diff-checker-wrapper {
        margin: 10px;
        padding: 15px;
    }
    
    .diff-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .diff-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .diff-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .control-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .diff-options {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .diff-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .diff-legend {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .diff-title {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .text-diff-checker-wrapper {
        margin: 5px;
        padding: 10px;
    }
    
    .diff-controls {
        padding: 15px;
    }
    
    .panel-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .text-input {
        padding: 16px;
        font-size: 0.85rem;
    }
    
    .result-content {
        padding: 16px;
        font-size: 0.85rem;
    }
    
    .control-buttons {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
        font-size: 11px;
        padding-right: 29px;
    }
}

/* Dark mode support */
/*@media (prefers-color-scheme: dark) {*/
/*    .text-diff-checker-wrapper {*/
/*        background: #1e293b !important;*/
/*        color: #e2e8f0;*/
/*        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);*/
/*    }*/
    
/*    .text-panel,*/
/*    .diff-results {*/
/*        background: #334155 !important;*/
/*        border-color: #475569;*/
/*    }*/
    
/*    .panel-header,*/
/*    .results-header,*/
/*    .diff-controls,*/
/*    .result-title {*/
/*        background: #475569 !important;*/
/*        color: #e2e8f0;*/
/*    }*/
    
/*    .panel-title,*/
/*    .results-header h3 {*/
/*        color: #e2e8f0;*/
/*    }*/
    
/*    .char-count {*/
/*        background: #64748b;*/
/*        color: #e2e8f0;*/
/*    }*/
    
/*    .text-input {*/
/*        background: #475569 !important;*/
/*        color: #f1f5f9;*/
/*        border: 1px solid #64748b;*/
/*    }*/
    
/*    .text-input:focus {*/
/*        background: #64748b !important;*/
/*    }*/
    
/*    .text-input::placeholder {*/
/*        color: #94a3b8;*/
/*    }*/
    
/*    .result-content {*/
/*        background: #475569 !important;*/
/*        color: #f1f5f9;*/
/*    }*/
    
/*    .diff-unchanged {*/
/*        color: #e2e8f0;*/
/*    }*/
    
/*    .line-number {*/
/*        color: #94a3b8;*/
/*        border-color: #64748b;*/
/*    }*/
/*}*/

/* Print styles */
@media print {
    .diff-controls,
    .diff-legend {
        display: none;
    }
    
    .text-diff-checker-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .diff-container {
        page-break-inside: avoid;
    }
}