/* C:\laragon\www\TenRusl-DiffView\assets\css\app.css */
/* =========================================================
   APP LAYOUT & DIFF VIEW (kept from your original app.css)
   File: app.css
   ========================================================= */

/* === base layout === */
.popover {
    position: absolute;
    right: 16px;
    top: 64px;
    width: min(720px, 92vw);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: pop 0.12s ease;
    z-index: 60;
}
@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.popover-body {
    padding: 12px;
}
.search {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    outline: none;
    margin-bottom: 12px;
}
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.lang-grid .lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
}
.lang-grid .lang-item:hover {
    border-color: var(--ring);
}
.lang-grid .lang-item[data-active="true"] {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25) inset;
}
.lang-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid var(--border);
}
.lang-label {
    font-size: 13px;
}

/* Layout */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 42vh;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.08s ease;
}
.btn:hover {
    background: var(--brand-strong);
}
.btn:active {
    transform: scale(0.98);
}
.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.icon {
    width: 18px;
    height: 18px;
    display: block;
}
.sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    display: inline-block;
    vertical-align: middle;
}

/* Inputs (A & B) */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
}
.dropzone {
    position: relative;
    flex: 1;
    display: grid;
}
.dropzone.drag {
    outline: 2px dashed var(--ring);
    outline-offset: -8px;
    background: rgba(167, 139, 250, 0.08);
}
#inputA,
#inputB {
    width: 100%;
    height: 240px;
    padding: 12px;
    border: none;
    outline: none;
    resize: vertical;
    font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: var(--surface);
    color: var(--text);
}
.drop-hint {
    position: absolute;
    right: 12px;
    bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}
.options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: center; /* center opsi & tombol export */
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}
.opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.flex-spacer {
    flex: 1;
}

/* Preview */
.diff-wrap {
    position: relative;
    overflow: auto;
    background: var(--surface);
}
@media print {
    .app-main {
        padding: 0;
    }
    .panel.right {
        border: none;
    }
}

/* === Diff grid & lines === */
.diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
}
.diff-grid.wrap .line {
    white-space: pre-wrap;
    word-break: break-word;
}
.pane {
    border-right: 1px solid var(--border);
}
.pane.right {
    border-right: none;
}
.line {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0;
    align-items: stretch;
    font-size: 13px;
}
.line .gutter {
    padding: 4px 8px;
    color: var(--muted);
    user-select: none;
    text-align: right;
    border-right: 1px solid var(--border);
}
.line .content {
    padding: 4px 10px;
}

/* states */
.line.eq .content {
    background: transparent;
}
.line.add .content,
.line.modR .content {
    background: rgba(16, 185, 129, 0.14);
}
.line.rem .content,
.line.modL .content {
    background: rgba(239, 68, 68, 0.16);
}
.line.blank .content {
    background: transparent;
    opacity: 0.55;
}

.ch {
    white-space: pre;
}
.ch-eq {
    background: transparent;
}
.ch-add {
    background: rgba(16, 185, 129, 0.24);
}
.ch-rem {
    background: rgba(239, 68, 68, 0.28);
}

/* high contrast toggle */
:root.diff-contrast .line.add .content,
:root.diff-contrast .line.modR .content {
    background: rgba(16, 185, 129, 0.35);
}
:root.diff-contrast .line.rem .content,
:root.diff-contrast .line.modL .content {
    background: rgba(239, 68, 68, 0.45);
}
:root.diff-contrast .ch-add {
    background: rgba(16, 185, 129, 0.5);
}
:root.diff-contrast .ch-rem {
    background: rgba(239, 68, 68, 0.6);
}

/* Watermark */
.diff-grid .wm {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 72px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.06);
    transform: rotate(-18deg);
}

/* Mobile */
@media (max-width: 980px) {
    .app-main {
        grid-template-columns: 1fr;
    }
    .btn .label {
        display: none;
    }
    .input-grid {
        grid-template-columns: 1fr;
    }
}

/* ==== Diff Inputs: lebih lega & toolbar di bawah judul ==== */
.panel.left .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px 14px;
}
.panel.left .panel-head h2 {
    margin: 0;
}

/* toolbar melebar penuh & tetap dua baris sesuai DOM */
#diffToolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
#diffToolbar .row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

/* opsional: layar kecil */
@media (max-width: 520px) {
    #diffToolbar .row {
        gap: 6px;
    }
    .panel.left .panel-head {
        padding: 18px 12px;
    }
}
