/* ── Translate Agent Layout ───────────────────────────────────────────────── */

/* Hide everything else, show both translate panels */
.nd-translate-active .nd-code-explorer      { display: none !important; }
.nd-translate-active .nd-code-viewer        { display: none !important; }
.nd-translate-active .nd-code-chat-panel    { display: none !important; }
.nd-translate-active .nd-translate-input-panel { display: flex !important; }
.nd-translate-active .nd-translate-preview  { display: flex !important; }
/* Hide model picker — model is locked */
.nd-translate-active .nd-model-picker       { display: none !important; }

/* ── Left input panel ────────────────────────────────────────────────────── */
.nd-translate-input-panel {
    flex: 0 0 50%;
    display: none;
    flex-direction: column;
    background: #0d0d14;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

/* ── Mode tabs ───────────────────────────────────────────────────────────── */
.nd-tr-mode-bar {
    display: flex;
    gap: 2px;
    padding: 8px 12px 0;
    flex-shrink: 0;
}
.nd-tr-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px 6px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.nd-tr-mode-btn:hover { color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.04); }
.nd-tr-mode-btn.active {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}

/* ── Lang bar ────────────────────────────────────────────────────────────── */
.nd-tr-lang-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}
.nd-tr-select {
    flex: 1;
    height: 28px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-family: inherit;
    padding: 0 28px 0 9px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.3)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.nd-tr-select:focus { border-color: rgba(99,102,241,0.5); }
.nd-tr-select option { background: #1a1a2a; color: #fff; }

.nd-tr-swap-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.nd-tr-swap-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

/* ── Textarea area ───────────────────────────────────────────────────────── */
.nd-tr-input-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}
.nd-tr-input {
    flex: 1;
    min-height: 0;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: rgba(255,255,255,0.88);
    font-size: 15px;
    line-height: 1.75;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
    padding: 22px 24px;
    caret-color: rgba(99,102,241,0.9);
}
.nd-tr-input::placeholder {
    color: rgba(255,255,255,0.18);
}
.nd-tr-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.nd-tr-input-count {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    font-variant-numeric: tabular-nums;
    min-width: 48px;
}
.nd-tr-clear-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 11.5px;
    cursor: pointer;
    font-family: inherit;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.nd-tr-clear-btn:hover {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.06);
}

/* ── Document mode ───────────────────────────────────────────────────────── */
.nd-tr-doc-mode {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.nd-tr-doc-mode[hidden] { display: none; }

/* Drop zone */
.nd-tr-drop-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 24px;
    margin: 12px;
    border: 1.5px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.nd-tr-drop-zone:hover,
.nd-tr-drop-zone.drag-over {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.04);
}
.nd-tr-drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    margin-bottom: 4px;
}
.nd-tr-drop-label {
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
}
.nd-tr-drop-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.25);
}
.nd-tr-drop-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.nd-tr-drop-btn:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); }
.nd-tr-drop-types {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* File info (after load) */
.nd-tr-file-info {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.nd-tr-file-info[hidden] { display: none; }
.nd-tr-file-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.nd-tr-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(99,102,241,0.8);
    flex-shrink: 0;
}
.nd-tr-file-icon.pdf  { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.2);  color: #f87171; }
.nd-tr-file-icon.docx { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.2); color: #60a5fa; }
.nd-tr-file-icon.pptx { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.2); color: #fb923c; }
.nd-tr-file-icon.txt  { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }
.nd-tr-file-meta { flex: 1; min-width: 0; }
.nd-tr-file-name {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nd-tr-file-size {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}
.nd-tr-file-change {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.nd-tr-file-change:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); }

.nd-tr-extracted-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
}
.nd-tr-extracted {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    line-height: 1.7;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
    padding: 14px 16px;
    cursor: default;
}

.nd-tr-doc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.nd-tr-doc-chars {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
}
.nd-tr-translate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 7px;
    background: rgba(99,102,241,0.85);
    border: none;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.nd-tr-translate-btn:hover { background: rgba(99,102,241,1); }
.nd-tr-translate-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Model badge ─────────────────────────────────────────────────────────── */
.nd-tr-model-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.01);
    font-size: 10.5px;
    color: rgba(255,255,255,0.22);
    flex-shrink: 0;
}
.nd-tr-model-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(74,222,128,0.55);
    flex-shrink: 0;
}

/* ── Right preview panel ──────────────────────────────────────────────────── */
.nd-translate-preview {
    flex: 1;
    min-width: 0;
    display: none;
    flex-direction: column;
    background: #0a0a12;
    overflow: hidden;
}

.nd-tr-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    height: 44px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nd-tr-preview-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nd-tr-preview-lang {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.01em;
}
.nd-tr-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nd-tr-spinner {
    display: flex;
    align-items: center;
    color: rgba(99,102,241,0.7);
}
.nd-tr-spin {
    animation: ndTrSpin 0.75s linear infinite;
}
@keyframes ndTrSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.nd-tr-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.nd-tr-copy-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.16);
}
.nd-tr-copy-btn.copied {
    color: #4ade80;
    border-color: rgba(74,222,128,0.3);
    background: rgba(74,222,128,0.07);
}

/* ── Output area ─────────────────────────────────────────────────────────── */
.nd-tr-output-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
}
.nd-tr-output-area::-webkit-scrollbar { width: 5px; }
.nd-tr-output-area::-webkit-scrollbar-track { background: transparent; }
.nd-tr-output-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.nd-tr-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    pointer-events: none;
}
.nd-tr-empty[hidden] { display: none; }
.nd-tr-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.15);
}
.nd-tr-empty-label {
    font-size: 12px;
    color: rgba(255,255,255,0.2);
    line-height: 1.7;
    white-space: pre-line;
}

.nd-tr-result {
    font-size: 15px;
    line-height: 1.75;
    color: rgba(255,255,255,0.82);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}
.nd-tr-result[hidden] { display: none; }
.nd-tr-result.streaming::after {
    content: '▋';
    color: rgba(99,102,241,0.6);
    animation: ndTrBlink 0.85s step-end infinite;
    margin-left: 1px;
}
@keyframes ndTrBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Download button (right panel) ──────────────────────────────────────── */
.nd-tr-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 0 16px 12px;
    padding: 10px 16px;
    border-radius: 9px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.nd-tr-download-btn span { color: rgba(255,255,255,0.5); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nd-tr-download-btn:hover { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.5); }
.nd-tr-download-btn[hidden] { display: none; }

/* ── Footer char count ───────────────────────────────────────────────────── */
.nd-tr-footer {
    padding: 6px 24px 10px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.nd-tr-footer[hidden] { display: none; }
.nd-tr-char-count {
    font-size: 11px;
    color: rgba(255,255,255,0.18);
    font-variant-numeric: tabular-nums;
}
