/* Translate PDF — uses theme vars from style.css */
.tr-wrap { max-width: 620px; margin: 0 auto; padding: 56px 22px 90px; }
.tr-head { text-align: center; margin-bottom: 30px; }
.tr-head .eyebrow { margin-bottom: 16px; }
.tr-head h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.tr-head p { color: var(--txt2); margin-top: 12px; font-weight: 400; }
.tr-stage { animation: fadeUp .4s cubic-bezier(.22,1,.36,1) both; }
.hidden { display: none !important; }

.tr-drop { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; padding: 44px 22px; border: 1.5px dashed var(--line2); border-radius: var(--r-lg); background: var(--card); transition: all .25s; }
.tr-drop:hover, .tr-drop.drag { border-color: var(--lime); background: rgba(194,240,74,0.04); }
.tr-drop-ic { width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; display: grid; place-items: center; background: var(--lime); color: #0a0b0d; transition: transform .25s; }
.tr-drop:hover .tr-drop-ic { transform: translateY(-4px); }
.tr-drop .t { font-size: 1.15rem; font-weight: 700; }
.tr-drop .s { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: var(--txt3); margin-top: 6px; }
.tr-drop .s strong { color: var(--lime); }

.tr-langs { display: flex; align-items: flex-end; gap: 12px; margin-top: 20px; }
.tr-lang-col { flex: 1; }
.tr-label { display: block; font-family: 'JetBrains Mono', monospace; font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); margin-bottom: 8px; }
.tr-select { width: 100%; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--line2); border-radius: 12px; color: var(--txt); font-size: .92rem; outline: none; cursor: pointer; }
.tr-select:focus { border-color: var(--lime); }
.tr-arrow { padding-bottom: 12px; color: var(--lime); font-size: 1.3rem; font-weight: 700; }

.tr-check, .tr-tip { margin-top: 16px; }
.tr-check { display: flex; align-items: center; gap: 9px; font-size: .85rem; color: var(--txt2); cursor: pointer; }
.tr-check input { width: 16px; height: 16px; accent-color: var(--lime); }

.tr-tip { display: flex; gap: 11px; padding: 13px 15px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--card); font-size: .82rem; line-height: 1.55; color: var(--txt2); }
.tr-tip-ic { flex-shrink: 0; }
.tr-tip b { color: var(--txt); }
.tr-tip a { color: var(--lime); text-decoration: none; border-bottom: 1px solid transparent; }
.tr-tip a:hover { border-bottom-color: var(--lime); }

/* loader / result */
.tr-scan-box, .tr-result-card { text-align: center; padding: 40px 26px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.tr-spin { width: 50px; height: 50px; margin: 0 auto 20px; border: 2px solid var(--surface2); border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; box-shadow: 0 0 20px -6px var(--lime); }
.tr-scan-box h3 { font-size: 1.3rem; } .tr-scan-box p { color: var(--txt3); margin-top: 10px; font-size: .82rem; }
.tr-check-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: #0a0b0d; box-shadow: 0 0 36px -6px rgba(194,240,74,0.7); }
.tr-result-card h3 { font-size: 1.5rem; }
.tr-result-card > p { color: var(--txt2); margin-top: 8px; font-weight: 400; font-family: 'JetBrains Mono', monospace; font-size: .8rem; }
.tr-preview { text-align: left; margin: 20px 0; padding: 16px 18px; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: .9rem; line-height: 1.7; color: var(--txt2); white-space: pre-wrap; }
.tr-btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 520px){
  .tr-langs { flex-direction: column; align-items: stretch; }
  .tr-arrow { display: none; }
  .tr-btn-row .btn { flex: 1; }
}

/* mode switch: upload vs paste */
.tr-modes { display: flex; gap: 8px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; padding: 5px; }
.tr-mode { flex: 1; padding: 10px; border: none; border-radius: 8px; background: transparent; color: var(--txt2); font-family: 'Plus Jakarta Sans',sans-serif; font-weight: 700; font-size: .88rem; cursor: pointer; transition: all .15s; }
.tr-mode.sel { background: var(--lime); color: #0a0b0d; }
.tr-paste { width: 100%; min-height: 200px; padding: 16px 18px; background: var(--card); border: 1.5px solid var(--line2); border-radius: var(--r-lg); color: var(--txt); font-size: .95rem; line-height: 1.7; font-family: 'Plus Jakarta Sans', sans-serif; resize: vertical; outline: none; }
.tr-paste:focus { border-color: var(--lime); }
.tr-paste::placeholder { color: var(--txt3); }

/* OCR option in translate */
.tr-ocr { margin-top: 12px; }
.tr-ocr-lang { margin-top: 12px; }
.tr-ocr-lang .tr-label { margin-bottom: 6px; }

/* ===== step-by-step OCR->translate flow ===== */
.tr-card { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-lg); padding: 22px; margin-bottom: 16px; animation: fadeUp .35s cubic-bezier(.22,1,.36,1) both; }
.tr-step-h { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; margin-bottom: 16px; }
.tr-step-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: #0a0b0d; font-size: .85rem; font-weight: 800; flex-shrink: 0; }
.tr-ocr-row { margin-top: 14px; }
.tr-text-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tr-text-label { font-family: 'JetBrains Mono', monospace; font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--txt3); }
.tr-copy { padding: 6px 14px; border: 1px solid var(--line2); border-radius: 100px; background: var(--surface); color: var(--txt2); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: .76rem; cursor: pointer; transition: all .15s; }
.tr-copy:hover { border-color: var(--lime); color: var(--lime); }
.tr-textbox { width: 100%; min-height: 170px; max-height: 360px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--txt); font-size: .92rem; line-height: 1.7; font-family: 'Plus Jakarta Sans', sans-serif; resize: vertical; outline: none; }
.tr-textbox:focus { border-color: var(--lime); }
.tr-textbox::placeholder { color: var(--txt3); }

/* full-screen translate loading overlay */
.tr-loader { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(8,9,11,0.78); backdrop-filter: blur(4px); }
.tr-loader-box { text-align: center; padding: 40px 44px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.tr-loader-spin { width: 54px; height: 54px; margin: 0 auto 22px; border: 3px solid var(--surface2); border-top-color: var(--lime); border-radius: 50%; animation: spin .75s linear infinite; box-shadow: 0 0 24px -6px var(--lime); }
.tr-loader-box h3 { font-size: 1.3rem; font-weight: 800; }
.tr-loader-box p { color: var(--txt3); margin-top: 10px; font-size: .85rem; }
@keyframes spin { to { transform: rotate(360deg); } }
