/* =========================================================
   PDF Studio — στυλ για προεπισκόπηση, σύγκριση, σάρωση, γλώσσα
   ========================================================= */

/* ---------- Κουμπί γλώσσας ---------- */
.lang-btn { width: auto; padding: 0 10px; gap: 6px; font-weight: 700; font-size: 13px; }
.lang-btn .i { width: 16px; height: 16px; }

/* ---------- Μικρογραφίες ---------- */
.file-thumb { position: relative; }
.file-thumb.clickable { cursor: zoom-in; }
.file-thumb.clickable:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb-pages { position: absolute; right: 2px; bottom: 2px; background: rgba(20, 22, 40, .75); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 4px; padding: 0 4px; line-height: 15px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Προεπισκόπηση (viewer) ---------- */
.viewer { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: rgba(14, 16, 24, .94); animation: fade .15s; color: #e9ebf3; }
.vw-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #171a23; border-bottom: 1px solid #2a2f3e; flex-wrap: wrap; }
.vw-title { flex: 1; min-width: 160px; display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.vw-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-meta { color: #8b91a8; font-size: 13px; white-space: nowrap; }
.vw-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vw-tools > span { display: inline-flex; align-items: center; gap: 6px; }
.vw-tools .hidden { display: none !important; }
.vw-btn { min-width: 36px; height: 36px; border-radius: 9px; border: 1px solid #343a4c; background: #222736; color: #e9ebf3; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 18px; font-weight: 600; padding: 0 8px; }
.vw-btn.wide { font-size: 13.5px; padding: 0 12px; }
.vw-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.vw-btn:hover { filter: brightness(1.15); }
.vw-btn .i { width: 16px; height: 16px; }
.vw-zoom, .vw-pageinfo, .vw-count { font-size: 13px; color: #b9bed0; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.vw-pageinfo { min-width: 96px; }
.vw-body { flex: 1; overflow: auto; position: relative; outline: none; }
.vw-body.vw-center { display: flex; align-items: center; justify-content: center; padding: 16px; }
.vw-body.vw-col { display: flex; flex-direction: column; }
.vw-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 20px 16px 40px; min-width: min-content; }
.vw-page { position: relative; background: #fff; box-shadow: 0 3px 16px rgba(0, 0, 0, .5); flex: none; }
.vw-page canvas { display: block; }
.vw-pno { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 100%); font-size: 11px; color: #8b91a8; padding-top: 3px; }
.vw-img { max-width: none; cursor: zoom-out; box-shadow: 0 3px 16px rgba(0, 0, 0, .5); background: #fff; }
.vw-img.fit { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.vw-text { margin: 0; padding: 20px 24px; white-space: pre-wrap; font: 13px/1.55 "Cascadia Code", Consolas, monospace; color: #e4e6ee; }
.vw-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.vw-frame-holder { flex: 1; min-height: 0; }
.vw-tabs { display: flex; gap: 4px; padding: 8px 12px; background: #1d2130; flex-wrap: wrap; }
.vw-tabs button { border: 1px solid #343a4c; background: #262b3b; color: #cfd3e3; border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.vw-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vw-loading, .vw-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: #9aa0b6; font-size: 14px; text-align: center; padding: 20px; }
.vw-loading .spinner { border-color: #343a4c; border-top-color: var(--accent); }
@media (max-width: 640px) { .vw-btn.wide span { display: none; } .vw-pageinfo { min-width: 0; } }

/* ---------- Σύγκριση ---------- */
.cmp-files { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cmp-files > div { background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 6px; margin-right: 8px; color: #fff; }
.cmp-tag.a { background: #d63a46; }
.cmp-tag.b { background: #1f9d55; }
.cmp-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.cmp-stats .stat { background: var(--bg-soft); border-radius: 12px; padding: 10px 14px; font-size: 12.5px; color: var(--text-soft); min-width: 130px; }
.cmp-stats .stat b { display: block; font-size: 22px; color: var(--text); }
.cmp-stats .stat.del b { color: #d63a46; }
.cmp-stats .stat.ins b { color: #1f9d55; }
.cmp-tabs { margin-bottom: 12px; max-width: 320px; }
.cmp-only { margin: 4px 0 10px; }
.diff-view { max-height: 640px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--bg-elev); font-size: 14px; line-height: 1.55; }
.df-eq { color: var(--text-soft); padding: 4px 10px; margin: 2px 0; white-space: pre-wrap; }
.df-del { background: color-mix(in srgb, #e5484d 13%, transparent); border-left: 3px solid #e5484d; padding: 6px 10px; margin: 4px 0; border-radius: 0 8px 8px 0; text-decoration: line-through; text-decoration-color: rgba(229, 72, 77, .55); white-space: pre-wrap; }
.df-ins { background: color-mix(in srgb, #1f9d55 13%, transparent); border-left: 3px solid #1f9d55; padding: 6px 10px; margin: 4px 0; border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.df-mod { background: color-mix(in srgb, #d9a400 9%, transparent); border-left: 3px solid #d9a400; padding: 6px 10px; margin: 4px 0; border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.df-mod del { background: color-mix(in srgb, #e5484d 30%, transparent); color: inherit; border-radius: 3px; }
.df-mod ins { background: color-mix(in srgb, #1f9d55 30%, transparent); text-decoration: none; border-radius: 3px; }
.df-skip { color: var(--text-mute); text-align: center; font-size: 12.5px; margin: 6px 0; }
.df-pg { display: block; font-size: 11px; color: var(--text-mute); text-decoration: none; margin-bottom: 2px; }
.cmp-row { margin: 0 0 18px; }
.cmp-row h4 { margin: 0 0 8px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.cmp-badge { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; background: var(--bg-soft); color: var(--text-soft); }
.cmp-badge.changed { background: color-mix(in srgb, #d9a400 18%, transparent); color: color-mix(in srgb, #b07f00 80%, var(--text)); }
.cmp-badge.added { background: color-mix(in srgb, #1f9d55 18%, transparent); color: #1f9d55; }
.cmp-badge.removed { background: color-mix(in srgb, #e5484d 18%, transparent); color: #e5484d; }
.cmp-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cmp-imgs figure { margin: 0; }
.cmp-imgs img { width: 100%; display: block; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: zoom-in; }
.cmp-imgs figcaption { text-align: center; font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.cmp-none { aspect-ratio: 0.71; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-strong); border-radius: 6px; color: var(--text-mute); }
@media (max-width: 640px) { .cmp-imgs { grid-template-columns: 1fr; } .cmp-files { grid-template-columns: 1fr; } }

/* ---------- Σάρωση ---------- */
.scan-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.scan-hint { color: var(--text-mute); font-size: 13px; margin: 10px 0 0; }
.cam { margin-top: 14px; }
.cam-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; max-height: 70vh; display: flex; justify-content: center; }
.cam-stage video { display: block; max-width: 100%; max-height: 70vh; }
.cam-overlay { position: absolute; left: 50%; top: 0; transform: translateX(-50%); pointer-events: none; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.cam-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cam-opts { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.cam-status { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(15, 17, 25, .72); color: #fff; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; transition: background .2s; }
.cam-status:empty { display: none; }
.cam-status.ok { background: rgba(18, 161, 80, .9); }
.cam-status.wait { background: rgba(217, 119, 6, .88); }
.cam-counter { position: absolute; right: 12px; bottom: 12px; background: rgba(91, 91, 246, .9); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 8px; pointer-events: none; }
.cam-counter:empty { display: none; }
.shutter { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--accent); background: #fff; cursor: pointer; box-shadow: 0 0 0 4px var(--accent-soft); transition: transform .08s; }
.shutter:active { transform: scale(.92); }
.scan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; flex-wrap: wrap; }
.scan-head h3 { margin: 0; }
.scan-tip { font-size: 12.5px; color: var(--text-mute); }
.scan-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.scan-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 8px; cursor: grab; }
.scan-card.dragging { opacity: .4; }
.scan-thumb { height: 170px; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); border-radius: 8px; overflow: hidden; cursor: pointer; }
.scan-thumb img { max-width: 100%; max-height: 100%; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.scan-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.scan-warn { width: 18px; height: 18px; border-radius: 50%; background: var(--warning); color: #fff; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: help; }
.scan-btns { margin-left: auto; display: flex; gap: 2px; }
.scan-btns button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.scan-btns button:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text); }
.scan-btns button.danger:hover { color: var(--danger); }
.scan-btns .i { width: 15px; height: 15px; }
.scan-editor { margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .ed-grid { grid-template-columns: 1fr; } }
.ed-stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; }
.ed-img { display: block; max-width: 100%; max-height: 68vh; border-radius: 6px; }
.ed-poly { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ed-poly polygon { fill: rgba(91, 91, 246, .16); stroke: #6d6dff; stroke-width: 2.5px; vector-effect: non-scaling-stroke; }
.ed-h { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(255, 255, 255, .9); border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); cursor: grab; touch-action: none; }
.ed-h:active { cursor: grabbing; transform: scale(1.15); }
.ed-side { display: flex; flex-direction: column; gap: 10px; }
.ed-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-mute); }
.ed-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-row.end { justify-content: flex-end; }
.ed-preview { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; min-height: 160px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.ed-preview img { max-width: 100%; max-height: 320px; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
