/* ─────────────────────────────────────────────────────────────
   ResumeAI – Additional styles for v2 (auth, depository, etc.)
   ───────────────────────────────────────────────────────────── */

/* ── LOGIN OVERLAY ── */
.login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f1117 0%, #1a1f2e 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 60px rgba(0,0,0,0.6);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}
.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.login-sub {
  color: var(--text-2);
  margin-bottom: 24px;
  font-size: 15px;
}
#gsi-button-container {
  display: flex; justify-content: center;
  margin-bottom: 12px;
  min-height: 44px;
}
.login-error {
  background: var(--red-light);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 13px;
  text-align: left;
}
.login-foot {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 20px;
}

/* ── Sign-in / Sign-up mode tabs ── */
.login-tabs {
  display: inline-flex;
  background: var(--bg-3, #2a2f3e);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin: 4px 0 22px;
}
.login-tab {
  background: transparent;
  border: 0;
  color: var(--text-2, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.login-tab:hover { color: var(--text-1, #e5e7eb); }
.login-tab.active {
  background: var(--bg-1, #1a1f2e);
  color: var(--text-1, #e5e7eb);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── "or" divider between Google button and email form ── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  color: var(--text-3, #64748b);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #3a3f4e);
}

/* ── Email / password form ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2, #94a3b8);
  letter-spacing: 0.02em;
}
.login-field > span small {
  font-weight: 400;
  color: var(--text-3, #64748b);
  margin-left: 4px;
}
.login-field input {
  background: var(--bg-3, #2a2f3e);
  border: 1px solid var(--border, #3a3f4e);
  color: var(--text-1, #e5e7eb);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease;
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent, #60a5fa);
  background: var(--bg-2, #1f2333);
}

.login-password-wrap { position: relative; }
.login-password-wrap input { padding-right: 40px; }
.login-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--text-3, #64748b);
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-eye:hover { color: var(--text-1, #e5e7eb); background: rgba(255,255,255,0.04); }
.login-eye i { font-size: 13px; }
.login-hint {
  font-size: 11px;
  color: var(--text-3, #64748b);
  margin-top: 2px;
}

.login-submit {
  margin-top: 4px;
  background: var(--accent, #2563eb);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, opacity .15s ease;
}
.login-submit:hover { background: var(--accent-hover, #1d4ed8); }
.login-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.login-submit i { font-size: 13px; }

/* ── USER CARD IN SIDEBAR ── */
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-top: 12px;
  background: var(--bg-3);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.user-card img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
}
.user-card img[src=""] { display: none; }
.user-info {
  flex: 1; min-width: 0;
}
.user-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── DEPOSITORY LAYOUT ── */
.depo-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  margin-top: 8px;
}
.depo-sidebar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.depo-sidebar h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease;
  border: 1px solid transparent;
}
.folder-item:hover {
  background: var(--bg-3);
}
.folder-item.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text);
}
.folder-item i.fa-folder,
.folder-item i.fa-folder-open {
  color: var(--accent);
}
.folder-item .folder-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-item .folder-count {
  font-size: 11px;
  background: var(--bg);
  color: var(--text-2);
  border-radius: 10px;
  padding: 2px 8px;
}
.folder-item .auto-badge {
  font-size: 9px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 4px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.depo-main {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  min-height: 400px;
}
.folder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.folder-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}
.folder-actions {
  display: flex; gap: 8px;
}

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-3);
  transition: all 0.2s ease;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-light);
}
.dropzone i {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}
.dropzone p {
  font-size: 15px;
  margin-bottom: 4px;
}
.dropzone small {
  color: var(--text-3);
}
.dz-browse {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.dz-browse:hover { color: var(--accent-hover); }

.upload-progress {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-3);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.upload-progress p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
}

.empty-state-small {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-3);
  font-size: 13px;
}

/* ── WEIGHTS PANEL IN IMPORT TAB ── */
.weights-panel {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}
.weights-panel h3 {
  font-size: 14px;
  margin-bottom: 4px;
}
.weights-panel .subtext {
  font-size: 12px;
  margin-bottom: 14px;
}

/* ── PROMPT MODAL INPUT ── */
.prompt-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  margin-top: 8px;
}
.prompt-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── INFO BANNER ── */
.info-banner {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}
.info-banner i {
  color: var(--accent);
  font-size: 16px;
}

/* ── FILE LIST ITEMS (from import) ── */
.processed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-light);
  color: var(--green);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.unprocessed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--yellow-light);
  color: var(--yellow);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── ADMIN USERS TABLE ── */
.admin-flag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.admin-flag.no { background: var(--bg-3); color: var(--text-3); }

/* Hide elements with .hidden */
.hidden { display: none !important; }

/* Mobile responsiveness for depo */
@media (max-width: 900px) {
  .depo-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Candidates table: Score Reasoning column ──
   The <td> stays a table cell; the inner <div> does the 2-line clamp.
   Full text is available on hover via the title="" tooltip (set in app.js). */
.reasoning-cell {
  max-width: 280px;
  min-width: 180px;
  vertical-align: top;
  cursor: help;
}
.reasoning-cell .reasoning-clamp {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
  /* 2-line clamp with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  max-height: calc(1.4em * 2);  /* fallback for non-webkit browsers */
}

/* ═════════════════════════════════════════════════════════════
   BILLING & QUOTA  STYLES
   ═════════════════════════════════════════════════════════════ */

/* ── Sidebar quota meter ── */
.quota-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-2, #1f2330);
  border: 1px solid var(--border, #2a2f3e);
}
.quota-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.quota-plan-pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.quota-upgrade-link {
  background: none; border: none;
  color: var(--accent, #60a5fa);
  font-size: 11px; font-weight: 600;
  cursor: pointer; padding: 0;
}
.quota-upgrade-link:hover { text-decoration: underline; }
.quota-bar {
  width: 100%; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.quota-bar-lg { height: 10px; margin-top: 10px; }
.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.quota-bar-fill.quota-warn    { background: linear-gradient(90deg, #eab308, #ca8a04); }
.quota-bar-fill.quota-danger  { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.quota-text {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3, #9ca3af);
  text-align: center;
}

/* ── Billing tab — current-plan summary ── */
.billing-summary {
  background: var(--bg-2, #1f2330);
  border: 1px solid var(--border, #2a2f3e);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 32px;
}
.billing-summary-loading { color: var(--text-3); font-size: 14px; }
.billing-current {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
.billing-current-left .billing-current-label {
  font-size: 12px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.billing-current-plan { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.plan-pill {
  display: inline-block;
  font-size: 14px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.plan-pill-free { background: rgba(156,163,175,0.18); color: #d1d5db; }
.plan-pill-plus { background: rgba(59,130,246,0.18);  color: #60a5fa; }
.plan-pill-pro  { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.billing-current-meta { font-size: 13px; color: var(--text-2); }

.billing-current-right { text-align: right; }
.billing-quota-num {
  font-size: 32px; font-weight: 800; line-height: 1;
  color: var(--text-1, #f3f4f6);
}
.billing-quota-num span { font-size: 18px; font-weight: 500; color: var(--text-3); }
.billing-quota-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.billing-actions { margin-top: 20px; display: flex; gap: 8px; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.pill-warn   { background: rgba(234,179,8,0.18);   color: #facc15; }
.pill-danger { background: rgba(239,68,68,0.18);   color: #f87171; }
.pill-info   { background: rgba(59,130,246,0.18);  color: #60a5fa; }

.billing-banner-warn {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(234,179,8,0.10);
  border: 1px solid rgba(234,179,8,0.25);
  color: #facc15;
  border-radius: 8px;
  font-size: 13px;
}

/* ── Plan picker (3 cards) ── */
.billing-section-title {
  font-size: 18px; font-weight: 700; margin: 0 0 16px;
  color: var(--text-1);
}
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.plan-card {
  position: relative;
  background: var(--bg-2, #1f2330);
  border: 1px solid var(--border, #2a2f3e);
  border-radius: 14px;
  padding: 24px;
  display: flex; flex-direction: column;
}
.plan-card-highlight {
  border-color: var(--accent, #60a5fa);
  box-shadow: 0 0 0 2px rgba(96,165,250,0.18);
}
.plan-badge {
  position: absolute; top: -10px; right: 16px;
  background: var(--accent, #60a5fa); color: #0b0f19;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.plan-head { margin-bottom: 16px; }
.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.price-amount { font-size: 32px; font-weight: 800; color: var(--text-1); }
.price-unit { font-size: 13px; color: var(--text-3); }
.plan-features {
  list-style: none; padding: 0; margin: 0 0 20px;
  flex: 1;
}
.plan-features li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0;
  font-size: 14px; color: var(--text-2);
}
.plan-features li i {
  color: #22c55e; margin-top: 3px; flex-shrink: 0;
}
.plan-cta { width: 100%; justify-content: center; }
.plan-cta:disabled { opacity: 0.55; cursor: not-allowed; }

.billing-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.billing-foot a { color: var(--accent, #60a5fa); }

@media (max-width: 980px) {
  .plans-grid { grid-template-columns: 1fr; }
  .billing-current { grid-template-columns: 1fr; }
  .billing-current-right { text-align: left; }
}

/* ── Virtual scrolling for large candidate tables ──
   When the wrapper has `.is-virtualized`, every data row is forced to a
   fixed height so the spacer math (top-pad + N×rowH + bottom-pad) stays
   accurate. Without this, the Skills / Reasoning columns could otherwise
   stretch some rows taller and the scroll position would drift. */
.table-wrapper.is-virtualized {
  /* Smooth out browser-level reflows; helps perf during fast scroll */
  contain: strict;
  will-change: scroll-position;
  overflow-anchor: none;
}
.table-wrapper.is-virtualized table {
  /* Fixed-layout means column widths are computed once from <colgroup>/<th>
     instead of being remeasured per row — required for stable virtualization
     of thousands of rows. We inject a <colgroup> with measured widths on
     first virtualization so the visual layout doesn't shift. */
  table-layout: fixed;
}
.table-wrapper.is-virtualized tbody tr:not(.virt-spacer) {
  height: 40px;
  max-height: 40px;
}
.table-wrapper.is-virtualized tbody tr:not(.virt-spacer) > td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
/* Score Reasoning cell still gets its 2-line clamp via the inner div;
   keep that wrapping behavior but contain it within the row height. */
.table-wrapper.is-virtualized .reasoning-cell {
  white-space: normal;        /* override the nowrap above for THIS cell */
}
.table-wrapper.is-virtualized .reasoning-cell .reasoning-clamp {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-height: calc(1.4em * 2);
}
/* Spacer rows must NOT inherit hover/zebra styles or padding */
.table-wrapper.is-virtualized tr.virt-spacer {
  background: transparent !important;
  border: 0 !important;
}
.table-wrapper.is-virtualized tr.virt-spacer:hover { background: transparent !important; }
.table-wrapper.is-virtualized tr.virt-spacer > td {
  padding: 0 !important;
  border: 0 !important;
}

/* ── Multi-select dropdown (used for the Score filter on Candidates) ── */
.multiselect {
  position: relative;
  display: inline-block;
}
.multiselect-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3, #2a2f3e);
  color: var(--text-1);
  border: 1px solid var(--border, #3a3f4e);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  min-width: 140px;
  text-align: left;
  justify-content: space-between;
  transition: border-color .15s ease;
}
.multiselect-toggle:hover { border-color: var(--accent, #60a5fa); }
.multiselect-toggle:focus { outline: none; border-color: var(--accent, #60a5fa); }
.multiselect-toggle i { font-size: 11px; opacity: 0.7; transition: transform .15s ease; }
.multiselect.open .multiselect-toggle i { transform: rotate(180deg); }
.multiselect-toggle.has-selection {
  border-color: var(--accent, #60a5fa);
  color: var(--accent, #60a5fa);
}

.multiselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-2, #1f2330);
  border: 1px solid var(--border, #3a3f4e);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  padding: 8px 0;
  z-index: 50;
  display: none;
  max-height: 320px;
  overflow-y: auto;
}
.multiselect.open .multiselect-menu { display: block; }
.multiselect-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
  transition: background .12s ease;
}
.multiselect-menu label:hover { background: var(--bg-3, #2a2f3e); }
.multiselect-menu input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent, #60a5fa);
  cursor: pointer;
  margin: 0;
}
.multiselect-foot {
  border-top: 1px solid var(--border, #3a3f4e);
  margin-top: 6px;
  padding: 6px 14px 2px;
  display: flex;
  justify-content: flex-end;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent, #60a5fa);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.link-btn:hover { text-decoration: underline; }

/* ─── Utility classes (replaces inline style= attrs in index.html) ───
   Inline style= attributes on a static template don't earn us anything,
   and they make CSP audits noisier. These three classes replace the
   non-display:none inline styles that were in the HTML shell.
   (display:none inline styles are still used because the JS toggles
   visibility via .style.display directly — converting that to
   classList.toggle would be a bigger refactor with no CSP win, since
   we already need style-src 'unsafe-inline' for the dynamic widths/
   heights in the virtual-scroller and the progress bar.) */
.u-mt-24       { margin-top: 24px; }
.u-mt-4        { margin-top:  4px; }
.u-text-muted  { color: var(--text-3); }
