/* ═══════════════════════════════════════════════════════
   main.css — UX Job Radar · Dark + Flat Design System
   Dark · Inter + DM Mono
   ═══════════════════════════════════════════════════════ */

/* ── Design tokens ───────────────────────────────────── */
:root {
  --bg:           #0e0e11;
  --surface:      #16161a;
  --surface2:     #1e1e24;
  --border:       #2a2a32;
  --border2:      #3a3a46;
  --text:         #e8e8f0;
  --text-2:       #b8b8cc;
  --muted:        #7a7a8c;
  --muted-2:      #4a4a58;

  --blue:         #4f8ef7;
  --blue-bg:      #0d1f3c;
  --blue-border:  #1e3a6e;

  --green:        #4ade80;
  --green-bg:     #0a2e1a;
  --green-border: #14532d;

  --amber:        #f59e0b;
  --amber-bg:     #1c1000;
  --amber-border: #78490d;

  --red:          #f87171;
  --red-bg:       #2a0a0a;
  --red-border:   #7f1d1d;

  --font-sans:    'Inter', 'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Fira Mono', monospace;

  --radius-sm:    4px;
  --radius:       6px;
  --radius-lg:    8px;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Top bar ─────────────────────────────────────────── */
#top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.top-bar-brand span { color: var(--amber); }

#status-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}
#status-pill.scanning {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-bg);
}
#notif-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--green);
  color: #0a2e1a;
  border-radius: 20px;
  padding: 2px 9px;
  display: none;
}
.top-bar-right { display: flex; align-items: center; gap: 8px; }
#scan-btn {
  background: var(--amber);
  color: #1a0a00;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
#scan-btn:hover    { opacity: 0.85; }
#scan-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Layout ──────────────────────────────────────────── */
.wrapper { max-width: 1200px; margin: 0 auto; padding: 24px 24px 48px; }

/* ── Page header ─────────────────────────────────────── */
.page-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.page-header-left p { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 520px; }
.resume-chip {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 8px 16px;
  text-align: center;
  flex-shrink: 0;
}
.resume-chip .stars { color: var(--amber); font-size: 16px; display: block; margin-bottom: 2px; }
.resume-chip .rlbl  { font-size: 10px; color: var(--amber); font-family: var(--font-mono); font-weight: 500; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 16px;
  display: inline-flex;
  gap: 2px;
}
.tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  transition: all 0.12s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface2); }
.tab.on    { background: var(--amber); color: #1a0a00; }
.tab-count { font-size: 11px; opacity: 0.8; margin-left: 4px; }

/* ── Panel ───────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── Table ───────────────────────────────────────────── */
.tbl-wrap  { overflow-x: auto; }
table      { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th   {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tbody td        { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: var(--surface2); }
tbody tr:last-child td { border-bottom: none; }

.role-cell  { font-weight: 500; color: var(--text); font-size: 14px; line-height: 1.4; }
.co-cell    { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.loc        { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mono       { font-family: var(--font-mono); }

/* ── Pills ───────────────────────────────────────────── */
.pill     { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.pill-ft  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.pill-ct  { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-border); }

/* ── Relevancy ───────────────────────────────────────── */
.rel-num   { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.bar-track { width: 56px; height: 3px; border-radius: 2px; background: var(--border); margin-top: 5px; }
.bar-fill  { height: 3px; border-radius: 2px; background: var(--amber); }

/* ── HOT badge ───────────────────────────────────────── */
.hot-badge {
  display: inline-block;
  background: var(--amber);
  color: #1a0a00;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  margin-left: 5px;
  vertical-align: middle;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ── Apply link ──────────────────────────────────────── */
.apply-link {
  color: var(--amber);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  background: var(--amber-bg);
  white-space: nowrap;
  transition: background 0.12s;
}
.apply-link:hover { background: var(--amber); color: #1a0a00; }
.apply-link-disabled {
  color: var(--muted);
  border: 1px solid var(--border);
  background: none;
  cursor: not-allowed;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

/* ── Mini actions ────────────────────────────────────── */
.mini-action {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  min-width: 40px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.mini-action:hover          { border-color: var(--amber); color: var(--amber); }
.mini-action:disabled       { color: var(--muted-2); cursor: wait; opacity: 0.5; }
.applied-btn:hover          { border-color: var(--green); color: var(--green); }
.rejected-btn:hover         { border-color: var(--red);   color: var(--red);   }

/* ── Match score ─────────────────────────────────────── */
.match-cell, .resume-cell { white-space: nowrap; }
.match-score {
  display: inline-block;
  min-width: 36px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}
.match-high  { color: var(--green); }
.match-mid   { color: var(--amber); }
.match-low   { color: var(--red);   }
.match-error { color: var(--red);   }

/* ── Tooltip ─────────────────────────────────────────── */
.tooltip-wrap  { position: relative; display: inline-block; }
.tooltip-panel {
  visibility: hidden;
  position: absolute;
  top: -8px; right: 110%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  width: max-content;
  max-width: 360px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: auto;
}
.tooltip-inner { font-family: var(--font-mono); font-size: 11px; line-height: 1.6; white-space: normal; color: var(--text-2); }
.tooltip-wrap:hover .tooltip-panel { visibility: visible; opacity: 1; }

/* ── Row states ──────────────────────────────────────── */
.row-applied td  { opacity: 0.45; }
.row-rejected td { opacity: 0.3; text-decoration: line-through; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state       { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state .icon { font-size: 32px; margin-bottom: 12px; }
.empty-state p     { font-size: 14px; }
.empty-state small { font-size: 12px; color: var(--muted-2); }

/* ── Scan log ────────────────────────────────────────── */
#scan-log {
  margin: 0 0 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--blue);
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
  display: none;
}

/* ── James section ───────────────────────────────────── */
.section-hed {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.james-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
}
@media (max-width: 720px) { .james-grid { grid-template-columns: 1fr; } }

.jcard {
  border-right: 1px solid var(--border);
  padding: 20px;
}
.jcard:last-child { border-right: none; }
.jcard-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 14px;
  font-weight: 600;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  margin-right: 12px; flex-shrink: 0;
}
.james-intro  { display: flex; align-items: flex-start; }
.james-name   { font-weight: 600; font-size: 13px; color: var(--text); }
.james-title  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.james-quote  {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
  border-left: 3px solid var(--amber);
  padding-left: 12px;
  font-style: italic;
}
.skill-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.skill-item  { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.skill-lbl   { font-size: 10px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.skill-stars { color: var(--amber); font-size: 12px; }
.overall-box {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}
.picks-list { display: flex; flex-direction: column; }
.pick-row {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.pick-row:last-child { border-bottom: none; }
.pick-n     { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); min-width: 16px; margin-top: 2px; }
.pick-role  { font-weight: 600; font-size: 13px; color: var(--text); }
.pick-co    { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pick-stars { color: var(--amber); font-size: 12px; margin-top: 4px; }
.pick-why   { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.6; }

/* ── Utilities ───────────────────────────────────────── */
.spin { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#no-new-msg {
  text-align: center;
  padding: 40px 24px;
  font-size: 13px;
  color: var(--muted);
}

footer {
  margin-top: 32px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .wrapper { padding: 12px; }
  .page-header { padding: 14px; }
  .tabs-bar { width: 100%; overflow-x: auto; }
  thead th:nth-child(n+6), tbody td:nth-child(n+6) { display: none; }
}

