/* DocTrans Pro Immersive Translate (app.immersivetranslate.com/pdf/) Continuous Multi-Page Workspace CSS v10.0.0 */

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(18, 24, 38, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #e11d48; /* Immersive Pink/Red */
    --accent-hover: #be123c;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================================= */
/* 1. Immersive Full Screen PDF Workspace (app.immersivetranslate.com/pdf/ Style) */
/* ========================================================= */
.immersive-pdf-workspace {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background-color: #18181c;
    display: flex;
    flex-direction: column;
}

/* Top Dark Navbar */
.immersive-top-bar {
    height: 48px;
    background: #19191d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: #fff;
    user-select: none;
    z-index: 100;
}

.top-bar-left, .top-bar-center, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.top-select-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #9ca3af;
}

.top-dropdown {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.top-dropdown option {
    background: #19191d;
    color: #fff;
}

.nav-btn-group, .zoom-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
}

.top-nav-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.page-num-display {
    font-size: 0.82rem;
    color: #d1d5db;
    font-weight: 500;
}

.page-num-display input {
    width: 38px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-align: center;
    border-radius: 3px;
    font-weight: 600;
    padding: 2px;
}

.v-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 6px;
}

.btn-primary-pink {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
}

.btn-primary-pink:hover {
    background: #be123c;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Immersive Canvas Grid Container */
.immersive-canvas-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 48px);
    background: #18181c;
    overflow: hidden;
}

.canvas-view-panel {
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 60px;
    background: #18181c;
    position: relative;
}

.left-panel {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-watermark {
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.76rem;
    font-weight: 600;
    color: #9ca3af;
    background: rgba(24, 24, 28, 0.95);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Continuous Multi-Page Wrapper (100% Width Fill) */
.continuous-pages-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.pdf-page-card {
    position: relative;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

.page-number-tag {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    font-weight: 500;
}

/* Loading Overlay */
.immersive-loading-overlay {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 48px);
    background: rgba(24, 24, 28, 0.92);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    gap: 16px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(225, 29, 72, 0.2);
    border-top-color: #e11d48;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ========================================================= */
/* 2. Home Landing Hub Styles                                */
/* ========================================================= */
.background-decor { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }
.glow-orb { position: absolute; border-radius: 50%; opacity: 0.16; }
.orb-1 { width: 380px; height: 380px; background: radial-gradient(circle, #6366f1, transparent 70%); top: -60px; left: -60px; }
.orb-2 { width: 420px; height: 420px; background: radial-gradient(circle, #c084fc, transparent 70%); bottom: -100px; right: -60px; }

.glass-panel { background: var(--card-bg); border: 1px solid var(--border-color); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); border-radius: var(--radius-lg); }
.app-header { border-bottom: 1px solid var(--border-color); background: rgba(9, 13, 22, 0.95); }
.header-container { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--primary)); display: flex; align-items: center; justify-content: center; color: #fff; }
.badge { display: inline-block; font-size: 0.72rem; padding: 2px 8px; border-radius: 20px; background: rgba(225, 29, 72, 0.15); color: #f43f5e; border: 1px solid rgba(225, 29, 72, 0.3); }
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }
.status-indicator .dot { width: 8px; height: 8px; border-radius: 50%; background-color: #10b981; }

.main-content { max-width: 1150px; margin: 20px auto; padding: 0 20px; }
.hero-section { text-align: center; margin-bottom: 24px; }
.hero-title { font-family: 'Outfit', sans-serif; font-size: 2.3rem; font-weight: 700; margin-bottom: 8px; }
.text-gradient { background: linear-gradient(135deg, #f43f5e, #c084fc, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { color: var(--text-muted); font-size: 0.98rem; }

.format-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.format-card { background: rgba(18, 24, 38, 0.6); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.format-card.active { background: rgba(225, 29, 72, 0.15); border-color: #f43f5e; }
.fmt-icon { font-size: 1.8rem; }
.fmt-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.fmt-info p { font-size: 0.76rem; color: var(--text-muted); }

.translator-card { padding: 24px; margin-bottom: 28px; }
.control-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(11, 15, 25, 0.6); padding: 14px 18px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 20px; flex-wrap: wrap; }
.lang-selector-group { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.lang-selector-group label { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.lang-select { width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: var(--text-main); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; outline: none; cursor: pointer; }
.lang-select option { background-color: var(--bg-dark); }
.swap-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); display: flex; align-items: center; justify-content: center; color: var(--text-muted); margin-top: 16px; cursor: pointer; }

.drop-zone { border: 2px dashed rgba(255, 255, 255, 0.15); border-radius: var(--radius-md); padding: 40px 20px; text-align: center; background: rgba(0, 0, 0, 0.2); cursor: pointer; }
.drop-zone-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 16px; background: rgba(225, 29, 72, 0.12); display: flex; align-items: center; justify-content: center; color: #f43f5e; }
.drop-title { font-size: 1.15rem; margin-bottom: 6px; }
.highlight-text { color: #f43f5e; text-decoration: underline; }
.drop-subtitle { font-size: 0.85rem; color: var(--text-muted); }

.file-selected-info { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; padding: 10px 16px; background: rgba(225, 29, 72, 0.15); border: 1px solid rgba(225, 29, 72, 0.3); border-radius: var(--radius-sm); }
.file-name { font-weight: 600; color: #ffe4e6; }
.file-size { font-size: 0.82rem; color: var(--text-muted); }
.btn-clear { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }

.action-row { margin-top: 20px; display: flex; justify-content: flex-end; }
.btn-primary { padding: 14px 28px; border-radius: var(--radius-md); font-size: 1rem; font-weight: 600; border: none; cursor: pointer; background: linear-gradient(135deg, var(--accent), #be123c); color: white; box-shadow: 0 4px 16px rgba(225, 29, 72, 0.4); }
.btn-success { background: #10b981; color: white; padding: 10px 20px; border-radius: var(--radius-md); border: none; font-weight: 600; cursor: pointer; }

.result-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.preview-box { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; }
.preview-box pre { white-space: pre-wrap; font-family: monospace; font-size: 0.88rem; color: #d1d5db; max-height: 180px; overflow-y: auto; }

.hidden { display: none !important; }

/* ============ AI Settings Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-card {
  width: 460px; max-width: 100%; background: #161a23;
  border: 1px solid var(--border-color, #2a3040); border-radius: 14px;
  overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-color, #2a3040);
}
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-close { background: none; border: none; color: #9aa0b0; font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 18px 20px; }
.modal-hint { font-size: .82rem; color: #9aa0b0; margin: 0 0 16px; line-height: 1.5; }
.form-field { margin-bottom: 14px; display: flex; flex-direction: column; }
.form-field label { font-size: .8rem; color: #c7ccd8; margin-bottom: 6px; }
.form-field input {
  background: #0f1219; border: 1px solid #2a3040; border-radius: 8px;
  padding: 9px 11px; color: #fff; font-size: .9rem; width: 100%;
  box-sizing: border-box;
}
.form-field input:focus { outline: none; border-color: #6d7cff; }
.field-sub { font-size: .72rem; color: #6b7280; margin: 5px 0 0; }
.key-status { font-size: .72rem; margin-left: 8px; color: #34d399; }
.test-result { padding: 10px 12px; border-radius: 8px; font-size: .85rem; margin-top: 4px; line-height: 1.5; }
.test-result.ok { background: rgba(52,211,153,.15); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.test-result.err { background: rgba(248,113,113,.15); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.modal-footer {
  display: flex; align-items: center; padding: 14px 20px;
  border-top: 1px solid var(--border-color, #2a3040); gap: 8px;
  background: #131720;
}
.flex-spacer { flex: 1; }
.btn-primary-m {
  background: linear-gradient(135deg,#f472b6,#8b5cf6); color:#fff; border:none;
  border-radius: 8px; padding: 8px 14px; font-size:.85rem; cursor:pointer; font-weight:500;
}
.btn-secondary-m { background:#232a3a; color:#e5e7eb; border:1px solid #333b4d; border-radius:8px; padding:8px 14px; font-size:.85rem; cursor:pointer; }
.btn-ghost-m { background:none; color:#9aa0b0; border:1px solid transparent; border-radius:8px; padding:8px 12px; font-size:.85rem; cursor:pointer; }
.btn-ghost-m:hover { color:#fff; }
.ai-settings-btn {
  background: rgba(255,255,255,.06); color:#e5e7eb; border:1px solid rgba(255,255,255,.14);
  border-radius: 8px; padding: 6px 12px; font-size:.82rem; cursor:pointer;
  margin-left: 12px;
}
.ai-settings-btn:hover { background: rgba(255,255,255,.12); }


/* ============ Aligned (Immersive-style) dual reader ============ */
.aligned-page-host { position: relative; width: 100%; }
.aligned-page-wrap {
  margin: 0 auto; position: relative; background: #fff; color: #1a1a1a;
  border-radius: 4px; box-shadow: 0 2px 14px rgba(0,0,0,.35);
  margin-bottom: 22px; font-size: 13px; line-height: 1.42; overflow: hidden;
}
.aligned-block { position: absolute; left: 0; right: 0; padding: 0 12px; box-sizing: border-box; overflow-wrap: break-word; }
.aligned-block .ab-trans { color: #b91c1c; font-weight: 500; line-height: 1.5; }
.empty-align-msg { color: #888; font-size: 14px; text-align: center; padding: 40px 20px; }
.block-click-hint { font-size: 11px; color: #556; margin-top: 3px; font-style: italic; }

/* per-page progressive-translate status note */
.pagestatus {
    position: sticky; top: 8px; margin: 8px;
    padding: 8px 12px; border-radius: 8px;
    background: rgba(59,130,246,.10); color: #3b82f6;
    font-size: 13px; text-align: center;
    border: 1px dashed rgba(59,130,246,.35);
}
