/* ========================================
   CODE DIFF VIEWER
======================================== */

/* ========================================
   EDITOR
======================================== */

.editor {
    display: flex;
    height: 40rem;
    overflow: hidden;

    background: white;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
}

.dark .editor {
    background: #020617;
}

.editor textarea {
    flex: 1;

    padding: 0.75rem;

    border: 0;
    outline: 0;
    resize: none;

    background: transparent;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 14px;
    line-height: 22px;

    overflow: auto;
}

/* ========================================
   GUTTERS
======================================== */

.gutter,
.gutter-viewport {
    width: 48px;

    background: #f8fafc;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.dark .gutter,
.dark .gutter-viewport {
    background: #0b1220;
}

.gutter {
    flex-shrink: 0;
    padding-top: 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    user-select: none;
}

.gutter-viewport {
    position: absolute;
    inset: 0 auto 0 0;

    overflow: hidden;
}

.gutter-inner {
    position: relative;
    will-change: transform;
}

.gutter-line,
.line-num {
    font-family: monospace;
    font-size: 11px;

    color: #94a3b8;

    text-align: right;
}

.gutter-line {
    height: 22px;
    line-height: 22px;
    padding-right: 8px;
}

.line-num {
    padding: 4px 6px;
}

/* ========================================
   DIFF GRID
======================================== */

.diff-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px 40px 1fr;
    align-items: start;

    border-bottom: 1px solid rgba(148, 163, 184, 0.2);

    transition: background-color 0.15s ease;
}

.diff-row:hover {
    background: rgba(148, 163, 184, 0.08);
}

.diff-mid {
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-text {
    position: relative;

    min-height: 22px;

    padding: 3px 8px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 12px;
    line-height: 20px;

    white-space: pre;
    overflow-x: auto;
}

/* ========================================
   CHANGE STATES
======================================== */

.add {
    background: rgba(34, 197, 94, 0.18);
    border-left: 4px solid #22c55e;
}

.remove {
    background: rgba(239, 68, 68, 0.18);
    border-left: 4px solid #ef4444;
}

.change {
    background: rgba(245, 158, 11, 0.1);
}

/* ========================================
   ACTION BUTTONS
======================================== */

.diff-btn {
    padding: 2px 6px;

    font-size: 11px;

    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
}