/* ============================================================
   TalentOS — Quantum Aura Theme
   Dark immersive glassmorphism with animated aurora background.
   All element IDs/classes preserved from the original theme.
   ============================================================ */

:root {
  --bg: #070a14;
  --bg-deep: #04060d;
  --ink: #eef1ff;
  --ink-soft: #c2c9e6;
  --ink-mute: #8b93b8;
  --primary: #7c5cff;        /* violet quantum core */
  --primary-dark: #6240e8;
  --primary-light: #8f74ff;
  --accent: #22d3ee;         /* cyan aura */
  --magenta: #e879f9;        /* magenta aura */
  --line: rgba(150, 160, 220, 0.16);
  --glass-bg: rgba(20, 26, 52, 0.42);
  --glass-border: rgba(150, 160, 220, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.14);
  --red: #fb7185;
  --red-bg: rgba(251, 113, 133, 0.14);
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 60px rgba(0, 0, 0, 0.55);
  --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

/* ---------- Aurora background ---------- */
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
/* Ambient aurora blobs (fixed, behind everything) */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 18% 22%, rgba(124, 92, 255, 0.22), transparent 62%),
    radial-gradient(38% 34% at 82% 12%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(46% 42% at 78% 82%, rgba(232, 121, 249, 0.13), transparent 62%),
    radial-gradient(34% 30% at 8% 80%, rgba(124, 92, 255, 0.12), transparent 58%);
  filter: blur(8px);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
/* Subtle grain / starfield overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 24%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 64% 38%, rgba(255,255,255,0.28), transparent),
    radial-gradient(1.4px 1.4px at 88% 66%, rgba(255,255,255,0.30), transparent),
    radial-gradient(1px 1px at 40% 82%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1.2px 1.2px at 26% 60%, rgba(255,255,255,0.22), transparent);
  opacity: 0.5;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3%, -3%, 0) scale(1.06); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.03); }
}

/* Ensure content stacks above the aurora layers */
.login-wrap, .app, .topbar { position: relative; z-index: 2; }

.hidden { display: none !important; }

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  position: relative;
  overflow: hidden;
}
/* top inner glow */
.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 45%);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; position: relative; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px rgba(124, 92, 255, 0.55);
}
.brand-logo.sm { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: -.5px; background: linear-gradient(90deg, var(--primary-light), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-tag { font-size: 12px; color: var(--ink-mute); }
.login-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; position: relative; }
.login-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 24px; position: relative; }
.login-card form { position: relative; }
.login-card form label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
.login-card form input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--glass-border); border-radius: 11px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: rgba(10, 14, 30, 0.55);
  backdrop-filter: blur(8px);
  transition: border .15s, box-shadow .15s;
}
.login-card form input::placeholder { color: var(--ink-mute); }
.login-card form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,255,.18), 0 0 16px rgba(124,92,255,.25); }
.form-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 14px;
  border-radius: 11px; padding: 11px 20px; transition: transform .1s, box-shadow .15s, background .15s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 4px 18px rgba(124, 92, 255, 0.4);
  animation: aura-pulse 3.5s ease-in-out infinite;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-secondary { background: rgba(124, 92, 255, 0.16); color: var(--primary-light); border: 1px solid rgba(124,92,255,0.3); }
.btn-secondary:hover { background: rgba(124, 92, 255, 0.26); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--ink-soft); border: 1px solid var(--glass-border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--ink); }
.btn-block { width: 100%; margin-top: 10px; }
.btn.sm { padding: 7px 14px; font-size: 13px; }

/* ============ APP SHELL ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 28, 0.62);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.brand-sep { color: var(--ink-mute); font-weight: 300; }
.topbar-sub { color: var(--ink-mute); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.usage-pill {
  background: var(--green-bg); color: var(--green); font-weight: 600; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(52,211,153,0.3);
}
.user-chip { font-weight: 600; font-size: 14px; color: var(--ink); }
.content { max-width: 1200px; margin: 0 auto; padding: 24px 24px 80px; position: relative; }

/* Tabs */
.tabbar { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--glass-border); }
.tab-btn {
  border: none; background: transparent; font-family: inherit; font-size: 15px; font-weight: 600;
  color: var(--ink-mute); padding: 12px 18px; cursor: pointer; border-bottom: 3px solid transparent; transition: color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary); text-shadow: 0 0 14px rgba(124,92,255,.5); }
.tab-panel { display: none; animation: fadeIn .25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Cards — liquid glass */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px; margin-bottom: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.045), transparent 50%);
  pointer-events: none;
}
.card:hover { border-color: rgba(150,160,220,0.32); box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight); }
.card h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; position: relative; }
.card-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 20px; position: relative; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; }
.card-header h2 { margin: 0; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; position: relative; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--glass-border); border-radius: 11px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: rgba(10, 14, 30, 0.5);
  transition: border .15s, box-shadow .15s;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%), linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field input::placeholder { color: var(--ink-mute); }
.field select option { background: #0e1330; color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,255,.18), 0 0 16px rgba(124,92,255,.22); }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; position: relative; }

/* JD output */
.jd-output { font-size: 14px; line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-wrap: break-word; max-height: 560px; overflow-y: auto; padding: 4px; position: relative; }
.jd-output h1 { font-size: 22px; margin-bottom: 12px; }
.jd-output h2 { font-size: 16px; margin: 20px 0 8px; color: var(--primary-light); }
.jd-output table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.jd-output th, .jd-output td { border: 1px solid var(--glass-border); padding: 8px 12px; text-align: left; }
.jd-output th { background: rgba(124, 92, 255, 0.12); }
.jd-output strong { color: var(--ink); }

/* Status */
.status-line { margin-top: 16px; font-size: 14px; color: var(--ink-soft); position: relative; }
.status-line.loading { color: var(--primary-light); font-weight: 600; }
.status-line.error { color: var(--red); font-weight: 600; }
.status-line.ok { color: var(--green); font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; position: relative; }
table#results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
#results-table th {
  text-align: left; padding: 12px 14px; background: rgba(124, 92, 255, 0.08);
  color: var(--ink-soft); font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--glass-border); position: sticky; top: 0;
}
#results-table td { padding: 12px 14px; border-bottom: 1px solid var(--glass-border); }
#results-table tbody tr { cursor: pointer; transition: background .12s; }
#results-table tbody tr:hover { background: rgba(124, 92, 255, 0.1); }
.score-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.score-high { background: var(--green-bg); color: var(--green); }
.score-mid { background: var(--amber-bg); color: var(--amber); }
.score-low { background: var(--red-bg); color: var(--red); }
a.github-link { color: var(--primary-light); text-decoration: none; font-weight: 500; }
a.github-link:hover { text-decoration: underline; }
.otw-yes { color: var(--green); font-weight: 800; }

/* LinkedIn mode toggle */
.linkedin-toggle-row { display: flex; align-items: flex-start; gap: 14px; margin: 16px 0 8px; padding: 14px 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(124,92,255,0.18); border-radius: 14px; backdrop-filter: blur(10px); }
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; margin-top: 2px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #2a2d40; border-radius: 34px; transition: 0.3s; }
.toggle-slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #8a8fa3; border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: linear-gradient(90deg, #4b2bd6, #0ea5e9); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }
.toggle-label { display: flex; flex-direction: column; gap: 2px; }
.toggle-label strong { font-size: 14px; color: #e8e9f0; }
.toggle-hint { font-size: 12px; color: var(--ink-mute); line-height: 1.45; }
.skill-cell { font-weight: 700; text-align: center; }
.sk-high { color: var(--green); background: var(--green-bg); border-radius: 6px; }
.sk-mid { color: var(--amber); background: var(--amber-bg); border-radius: 6px; }
.sk-low { color: var(--red); background: var(--red-bg); border-radius: 6px; }
.score-legend { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; position: relative; }
.legend-title { font-weight: 700; color: var(--ink-soft); }

/* Skill bars in resume */
.skill-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.skill-name { min-width: 130px; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.skill-bar-track { flex: 1; height: 8px; background: rgba(10,14,30,0.6); border-radius: 999px; overflow: hidden; }
.skill-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); box-shadow: 0 0 10px rgba(124,92,255,.4); transition: width .5s ease; }
.skill-val { min-width: 42px; text-align: right; font-weight: 700; font-size: 13px; color: var(--primary-light); }

/* Animations */
@keyframes aura-pulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(124, 92, 255, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(124, 92, 255, 0.65), 0 0 22px rgba(34, 211, 238, 0.3); }
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(150,160,220,0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(150,160,220,0.4); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .btn-primary { animation: none; }
  .tab-panel { animation: none; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar-sub { display: none; }
}
