/* --- Editor Layout & Sync Scroll --- */
.editor-container {
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.line-numbers {
    width: 40px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    text-align: right;
    padding: 1rem 0.5rem 1rem 0;
    color: #94a3b8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    user-select: none;
    overflow: hidden; /* Controlled by JS scroll sync */
}

.editor-textarea {
    flex: 1;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    border: none;
    outline: none;
    resize: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* Custom Scrollbars */
.editor-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.editor-textarea::-webkit-scrollbar-track {
    background: transparent;
}
.editor-textarea::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}
.editor-textarea::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* --- Drag & Drop Overlay --- */
.drag-zone {
    position: relative;
}
.drag-overlay {
    position: absolute;
    inset: 0;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.drag-zone.drag-active .drag-overlay {
    opacity: 1;
}

/* --- Diff2Html Overrides for Tailwind Aesthetic --- */
.d2h-file-wrapper {
    border: none !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}
.d2h-file-header {
    display: none !important; /* Hidden because we use our own custom header */
}
.d2h-code-line {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}
.d2h-code-linenumber {
    border-color: #e2e8f0 !important;
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
}
.d2h-del { background-color: #fee2e2 !important; border-color: #fca5a5 !important; }
.d2h-ins { background-color: #dcfce3 !important; border-color: #86efac !important; }
.d2h-info { background-color: #f1f5f9 !important; }
.d2h-file-diff .d2h-tbody > tr > td { border-bottom: 1px solid #f1f5f9 !important; }

/* View Toggle Button Styling */
.view-toggle { background: transparent; color: #64748b; }
.view-toggle.active { background: white; color: #2563eb; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Print Fixes */
@media print {
    body * { visibility: hidden; }
    #diff-results, #diff-results * { visibility: visible; }
    #diff-results { position: absolute; left: 0; top: 0; width: 100%; }
    .no-print { display: none !important; }
}