/* ─── Prior Code Diff Viewer ──────────────────────────────────────────────
   Terminal-style animated diff viewer + full patched-file block.
   Uses .pt-dot / .pt-dots from terminal-animations.css for the title bar.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Wrapper (holds diff viewer + full-code block together) ─────────────── */

.pdiff-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0.8rem 0;
}

/* ══ Diff viewer terminal window ════════════════════════════════════════ */

.pdiff-win {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    background: #0d0f14;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.45);
    animation: pdiff-in 0.22s ease;
}

@keyframes pdiff-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Title bar ─────────────────────────────────────────────────────────── */

.pdiff-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.75rem;
    background: #13161e;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    user-select: none;
}

.pdiff-title {
    flex: 1;
    color: rgba(255,255,255,0.5);
    font-size: 0.73rem;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdiff-stats {
    display: flex;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
}
.pdiff-stat-add { color: #3fb950; }
.pdiff-stat-rem { color: #f85149; }

/* ── Diff body ─────────────────────────────────────────────────────────── */

.pdiff-body {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.pdiff-body::-webkit-scrollbar       { width: 3px; }
.pdiff-body::-webkit-scrollbar-track { background: transparent; }
.pdiff-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Lines ─────────────────────────────────────────────────────────────── */

.pdiff-line {
    display: flex;
    align-items: stretch;
    line-height: 1.65;
    white-space: pre;
    animation: pdiff-row 0.1s ease;
}

@keyframes pdiff-row {
    from { opacity: 0; transform: translateX(-5px); }
    to   { opacity: 1; transform: translateX(0); }
}

.pdiff-add { background: rgba(63, 185, 80, 0.1); }
.pdiff-rem { background: rgba(248, 81, 73, 0.1); }
.pdiff-ctx { background: transparent; }

.pdiff-gutter {
    width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 0 0.2rem;
    font-size: 0.76rem;
    line-height: inherit;
}
.pdiff-add .pdiff-gutter { color: #3fb950; background: rgba(63,185,80,0.1); }
.pdiff-rem .pdiff-gutter { color: #f85149; background: rgba(248,81,73,0.1); }
.pdiff-ctx .pdiff-gutter { color: rgba(255,255,255,0.2); }

.pdiff-code {
    padding: 0 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdiff-ctx .pdiff-code { color: rgba(255,255,255,0.6); }
.pdiff-add .pdiff-code { color: #a8d8ae; }
.pdiff-rem .pdiff-code { color: #f09090; text-decoration: line-through; text-decoration-color: rgba(248,81,73,0.45); }

/* ══ Full updated-file block ════════════════════════════════════════════ */

.pdiff-full-block {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    background: #0d0f14;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    animation: pdiff-in 0.28s ease;
    margin-top: 0.8rem;
}

/* ── Full-code header ──────────────────────────────────────────────────── */

.pdiff-full-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.75rem;
    background: #0f1219;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    user-select: none;
}

.pdiff-full-lang {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(var(--rgb-theme-color, 0,255,204), 0.7);
    background: rgba(var(--rgb-theme-color, 0,255,204), 0.08);
    border: 1px solid rgba(var(--rgb-theme-color, 0,255,204), 0.2);
    border-radius: 4px;
    padding: 1px 6px;
}

.pdiff-full-title {
    flex: 1;
    color: rgba(255,255,255,0.45);
    font-size: 0.73rem;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdiff-full-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.pdiff-copy-btn,
.pdiff-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    font-family: inherit;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pdiff-copy-btn:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.25);
}
.pdiff-save-btn {
    border-color: rgba(var(--rgb-theme-color, 0,255,204), 0.3);
    color: rgba(var(--rgb-theme-color, 0,255,204), 0.75);
}
.pdiff-save-btn:hover {
    background: rgba(var(--rgb-theme-color, 0,255,204), 0.1);
    border-color: rgba(var(--rgb-theme-color, 0,255,204), 0.6);
    color: var(--theme-color, #00ffcc);
}

/* ── Full-code body ────────────────────────────────────────────────────── */

.pdiff-full-body {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.pdiff-full-body::-webkit-scrollbar        { width: 4px; height: 4px; }
.pdiff-full-body::-webkit-scrollbar-track  { background: transparent; }
.pdiff-full-body::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.12); border-radius: 2px; }

.pdiff-full-pre {
    margin: 0;
    padding: 0.65rem 0.85rem;
    color: rgba(255,255,255,0.78);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.65;
    white-space: pre;
    tab-size: 4;
}
