/* =========================================================
   CareerIQ — Global Design System
   Single source of visual truth for all pages.
   ========================================================= */

/* ---------- 1. Design Tokens (CSS Variables) ---------- */
:root {
  /* Brand palette */
  --color-navy: #6C4CFF;          /* Electric Indigo — primary buttons, focus */
  --color-navy-light: #8B70FF;    /* Brighter Electric Indigo — hover */
  --color-navy-dark: #4B2FE0;     /* Dark Indigo — pressed */
  --color-cyan: #C6FF3D;          /* Neon Lime — accent, used sparingly */
  --color-electric-blue: #3D8BFF; /* Links */
  --color-electric-cyan: #4DE8FF; /* Link hover */
  --color-gold: #FFC94D;          /* Amber — average score / warning */
  --color-coral: #FF4D5E;         /* Crimson Red — poor score / error */
  --color-orange: #FFC94D;

  /* Score / tier colors */
  --tier-green: #C6FF3D;          /* Excellent 85-100 = Neon Lime */
  --tier-yellow: #22C55E;         /* Good 70-84 = Emerald Green (kept distinct from lime) */
  --tier-orange: #FFC94D;         /* Average 50-69 = Amber */
  --tier-red: #FF4D5E;            /* Poor <50 = Crimson Red */

  /* Backgrounds & surfaces (dark theme) */
  --color-bg: #0F1024;            /* Deep Indigo page base */
  --color-bg-alt: #171A3A;        /* Midnight Navy — secondary surface */
  --color-surface: #1B1E3F;       /* Dark Slate — cards/panels */
  --color-surface-2: #232752;     /* Charcoal Indigo — inputs, nested surfaces */
  --color-white: #FFFFFF;         /* Headings */
  --color-border: #33366B;        /* Slate Gray */
  --color-text: #F4F4FA;          /* Body text (Soft Gray/White) */
  --color-text-muted: #9B9DC4;    /* Cool Gray — muted text */
  --color-glow-indigo: rgba(108, 76, 255, 0.35);
  --color-glow-lime: rgba(198, 255, 61, 0.3);

  /* Typography */
  --font-heading: Georgia, 'Cambria', serif;
  --font-body: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;

  /* Radii & shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(108, 76, 255, 0.08);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 24px var(--color-glow-indigo);

  /* Motion */
  --transition-fast: 220ms ease;

  /* Composed gradients (theme-aware) */
  --gradient-body: radial-gradient(ellipse 1200px 600px at 20% -10%, #23205A 0%, transparent 60%),
                   linear-gradient(180deg, #0F1024 0%, #14163A 100%);
  --gradient-header: linear-gradient(115deg, #1A1B44 0%, #171A3A 60%, #14163A 100%);
  --header-border: rgba(108, 76, 255, 0.25);

  /* Text colors used ON TOP OF tinted badge/alert backgrounds — must be
     readable against BOTH the tint color and swap per theme, since a
     bright pastel readable on a dark card becomes invisible on a pale
     tinted card in light mode (and vice versa). */
  --text-on-warning-tint: #FFD966;
  --text-on-orange-tint: #FFB366;
  --text-on-danger-tint: #FF8A8A;
  --text-on-info-tint: #D4FF7A;

  /* Heading color — separate from --color-white so headings can be
     theme-aware (white on dark, navy on light) while --color-white
     itself stays "true white" for other uses like button text. */
  --color-heading: #FFFFFF;

  /* Text for content sitting directly on a --tier-green background
     (e.g. the "Best Fit" badge). In dark mode tier-green is bright neon
     lime, so it needs dark text; in light mode it's a medium green, so
     white text works fine. */
  --text-on-tier-green: #0B0E2E;
}

/* =========================================================
   LIGHT THEME — restores the original Day 2 palette
   Activated via [data-theme="light"] on <html>
   ========================================================= */
[data-theme="light"] {
  /* Brand palette (original CareerIQ identity) */
  --color-navy: #1E2761;
  --color-navy-light: #2A3578;
  --color-navy-dark: #141A46;
  --color-cyan: #3FD0C9;
  --color-electric-blue: #1E2761;
  --color-electric-cyan: #2AAFA8;
  --color-gold: #F5C242;
  --color-coral: #E8544E;
  --color-orange: #F9A03F;

  /* Score / tier colors (same thresholds, original hues) */
  --tier-green: #2FBF71;
  --tier-yellow: #F5C242;
  --tier-orange: #F9A03F;
  --tier-red: #E8544E;

  /* Backgrounds & surfaces (light) */
  --color-bg: #F7F8FC;
  --color-bg-alt: #EFF1F8;
  --color-surface: #FFFFFF;
  --color-surface-2: #FFFFFF;
  --color-white: #FFFFFF;
  --color-border: #E1E4EE;
  --color-text: #1A1D2E;
  --color-text-muted: #524C6B;
  --color-glow-indigo: rgba(30, 39, 97, 0.12);
  --color-glow-lime: rgba(63, 208, 201, 0.25);

  --shadow-card: 0 2px 10px rgba(30, 39, 97, 0.08);
  --shadow-card-hover: 0 6px 20px rgba(30, 39, 97, 0.14);

  --gradient-body: var(--color-bg);
  --gradient-header: var(--color-navy);
  --header-border: transparent;

  /* Dark, saturated variants readable against pale tinted badge/alert
     backgrounds in light mode (the dark-theme bright pastels above would
     be nearly invisible here). */
  --text-on-warning-tint: #8A6D00;
  --text-on-orange-tint: #A65E00;
  --text-on-danger-tint: #A32E29;
  --text-on-info-tint: #1F7A4D;

  --color-heading: #1E2761;
  --text-on-tier-green: #FFFFFF;
}

/* ---------- 2. Reset & Base ---------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--gradient-body);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 300ms ease, color 300ms ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.2;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-3) 0; }

a {
  color: var(--color-electric-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-electric-cyan);
}

textarea, input {
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ---------- 3. Layout Helpers ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-6) 0;
}

/* ---------- 4. Navigation ---------- */
.site-header {
  background: var(--gradient-header);
  border-bottom: 1px solid var(--header-border);
  padding: var(--space-3) 0;
  transition: background 300ms ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: #C4C6E8;
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.site-nav a:hover {
  color: var(--color-white);
}

.site-nav a.active {
  color: var(--color-white);
  border-bottom: 2px solid var(--color-cyan);
}

/* Right-side header group: nav links + theme toggle + mobile hamburger */
.site-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Mobile nav toggle (hidden by default, shown under 640px) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }

  .site-header-right {
    gap: var(--space-2);
  }

  .site-nav {
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    position: absolute;
    top: 60px;
    right: var(--space-3);
    background: var(--color-navy-light);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    z-index: 150;
  }

  .site-nav.open { display: flex; }
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-navy);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-navy);
}

.btn-danger {
  background: var(--color-surface);
  color: var(--tier-red);
  border: 1px solid var(--tier-red);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-navy);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}

/* ---------- 6. Cards ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
}

.card-flat {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ---------- 7. Badges (score tiers & mode indicators) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8rem;
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--tier-green); }
.badge-warning { background: rgba(250, 204, 21, 0.18); color: var(--text-on-warning-tint); }
.badge-orange  { background: rgba(251, 146, 60, 0.18); color: var(--text-on-orange-tint); }
.badge-danger  { background: rgba(239, 68, 68, 0.15); color: var(--tier-red); }
.badge-neutral { background: var(--color-bg-alt); color: var(--color-text-muted); }

/* ---------- 8. Forms ---------- */
textarea, input[type="text"] {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea::placeholder, input[type="text"]::placeholder {
  color: #6B6E9C;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px var(--color-glow-lime);
}

/* ---------- 9. Footer ---------- */
.site-footer {
  padding: var(--space-4) 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---------- 10. Utility Classes ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.hidden { display: none !important; }

/* =========================================================
   Day 4 additions — Resume upload, review, and JD input
   ========================================================= */

/* ---------- 11. Step Layout ---------- */
.step {
  margin-bottom: var(--space-5);
}

.step-label {
  display: inline-block;
  background: var(--color-navy);
  color: var(--color-white);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

/* ---------- 12. PDF Upload Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--color-navy);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--color-cyan);
  background: rgba(198, 255, 61, 0.06);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.dropzone-text {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.dropzone input[type="file"] {
  display: none;
}

/* ---------- 13. Resume Review State ---------- */
.resume-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
  color: var(--tier-green);
  font-weight: 600;
}

.resume-status.error {
  color: var(--tier-red);
}

#resumeTextArea {
  min-height: 220px;
}

#jdTextArea {
  min-height: 180px;
}

.char-counter {
  text-align: right;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.char-counter.valid {
  color: var(--tier-green);
}

/* ---------- 14. Alerts (parse errors, validation messages) ---------- */
.alert {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--text-on-danger-tint);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
  background: rgba(198, 255, 61, 0.1);
  color: var(--text-on-info-tint);
  border: 1px solid rgba(198, 255, 61, 0.3);
}

/* ---------- 15. Analyze Action Bar ---------- */
.analyze-bar {
  text-align: center;
  margin-top: var(--space-5);
}

.analyze-bar .btn-primary {
  font-size: 1.1rem;
  padding: var(--space-3) var(--space-5);
}

.analyze-hint {
  margin-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* =========================================================
   Day 6 additions — Report UI, offline banner, footer note
   ========================================================= */

/* ---------- 16. Report Container ---------- */
.report {
  margin-top: var(--space-4);
}

.report-hero-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.report-hero-side {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---------- 17. Score Hero ---------- */
.score-hero {
  text-align: center;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  min-width: 180px;
}

.score-hero-number {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: bold;
  line-height: 1;
}

.score-hero-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.score-hero-success { background: rgba(34, 197, 94, 0.12); }
.score-hero-success .score-hero-number { color: var(--tier-green); }

.score-hero-warning { background: rgba(250, 204, 21, 0.15); }
.score-hero-warning .score-hero-number { color: var(--text-on-warning-tint); }

.score-hero-orange { background: rgba(251, 146, 60, 0.15); }
.score-hero-orange .score-hero-number { color: var(--text-on-orange-tint); }

.score-hero-danger { background: rgba(239, 68, 68, 0.12); }
.score-hero-danger .score-hero-number { color: var(--tier-red); }

/* ---------- 18. Apply Confidence Meter ---------- */
.confidence-meter {
  width: 100%;
}

.confidence-track {
  display: flex;
  gap: 4px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.confidence-segment {
  flex: 1;
  opacity: 0.25;
}

.confidence-segment.active {
  opacity: 1;
}

.confidence-danger { background: var(--tier-red); }
.confidence-orange { background: var(--tier-orange); }
.confidence-warning { background: var(--tier-yellow); }
.confidence-success { background: var(--tier-green); }

.confidence-readout {
  margin-top: var(--space-1);
}

/* ---------- 19. Next Action Card ---------- */
.next-action-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.next-action-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-top: var(--space-1);
}

/* ---------- 20. Category Breakdown Chart (CSS bars, no chart lib needed) ---------- */
.category-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.category-row {
  display: grid;
  grid-template-columns: 140px 1fr 36px;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9rem;
}

.category-label {
  color: var(--color-text-muted);
}

.category-bar-track {
  background: var(--color-bg-alt);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 400ms ease;
}

.category-bar-success { background: var(--tier-green); }
.category-bar-warning { background: var(--tier-yellow); }
.category-bar-orange  { background: var(--tier-orange); }
.category-bar-danger  { background: var(--tier-red); }

.category-value {
  font-weight: 700;
  text-align: right;
  color: var(--color-navy);
}

/* ---------- 21. Findings (Strengths / Gaps / Eligibility) ---------- */
.findings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .findings-grid { grid-template-columns: 1fr; }
  .category-row { grid-template-columns: 100px 1fr 32px; }
}

.finding-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  font-size: 0.92rem;
}

.finding-strength {
  background: rgba(34, 197, 94, 0.08);
}

.finding-gap {
  background: rgba(250, 204, 21, 0.1);
}

.finding-blocker {
  background: rgba(239, 68, 68, 0.1);
}

.finding-point {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.finding-list {
  margin: 0;
  padding-left: var(--space-4);
}

.finding-list li {
  margin-bottom: var(--space-1);
}

/* ---------- 22. Evidence Panel ---------- */
.evidence-toggle {
  background: none;
  border: none;
  color: var(--color-navy);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: var(--space-1) 0 0 0;
}

.evidence-panel {
  margin-top: var(--space-1);
  padding: var(--space-2);
  background: var(--color-surface);
  border-left: 3px solid var(--color-cyan);
  border-radius: 4px;
  font-size: 0.85rem;
}

.evidence-quote {
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.evidence-source {
  font-style: normal;
  font-weight: 600;
  color: var(--color-text);
  margin-right: 4px;
}

/* ---------- 23. Why Good Fit Card ---------- */
.why-good-fit-card {
  background: linear-gradient(135deg, rgba(198, 255, 61, 0.1), rgba(255, 201, 77, 0.1));
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ---------- 24. AI Reasoning Panel ---------- */
.reasoning-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.reasoning-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-navy);
}

.reasoning-content {
  margin-top: var(--space-3);
}

.reasoning-item {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.reasoning-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.reasoning-conclusion {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
}

.reasoning-explanation {
  font-size: 0.9rem;
}

/* ---------- 25. Offline / Reconnect Banner ---------- */
.reconnect-banner {
  background: rgba(198, 255, 61, 0.1);
  border: 1px solid rgba(198, 255, 61, 0.3);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ---------- 26. Challenge Footer Note ---------- */
.challenge-footer-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* =========================================================
   Day 7 additions — Two-col inputs, dashboard cards, status pills
   ========================================================= */

/* ---------- 27. Two-Column Inputs (Company / Job Title) ---------- */
.two-col-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .two-col-inputs { grid-template-columns: 1fr; }
}

/* ---------- 28. Dashboard Page Header ---------- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.dashboard-actions {
  display: flex;
  gap: var(--space-2);
}

/* ---------- 29. Dashboard Card Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}

.job-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  transition: box-shadow var(--transition-fast);
}

.job-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.job-card-company {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--color-navy);
}

.job-card-title {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.job-card-score {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.6rem;
  text-align: center;
  min-width: 50px;
}

.job-card-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.job-card-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  gap: var(--space-2);
  flex-wrap: wrap;
}

.status-select {
  font-size: 0.85rem;
  padding: 4px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  width: auto;
}

.status-select option {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.job-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.job-card-actions .btn {
  font-size: 0.85rem;
  padding: 6px var(--space-3);
}

/* ---------- 30. Checkbox Selection for Comparison (used starting Day 9) ---------- */
.job-card-select {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- 31. Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-2);
}

/* ---------- 32. Confirmation Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 51, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  max-width: 380px;
  width: 90%;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-3);
}

/* =========================================================
   Day 7 — Senior UI/UX Polish Pass
   ========================================================= */

/* ---------- 33. Accessibility: Focus States & Skip Link ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-surface);
  color: var(--color-navy);
  padding: var(--space-2) var(--space-3);
  z-index: 2000;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* ---------- 34. Sticky Header with Scroll Depth ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ---------- 35. Motion Refinements ---------- */
.btn {
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease, background-color 150ms ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.job-card,
.card {
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.job-card:hover {
  transform: translateY(-2px);
}

.report {
  animation: fadeInUp 420ms ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 36. Loading Spinner ---------- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(75, 47, 224, 0.15);
  border-top-color: var(--color-navy);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  vertical-align: middle;
  margin-right: var(--space-2);
}

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

.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

/* ---------- 37. Refined Dropzone Micro-interaction ---------- */
.dropzone {
  transition: border-color 200ms ease, background 200ms ease, transform 150ms ease;
}

.dropzone:active {
  transform: scale(0.995);
}

/* ---------- 38. Card Section Spacing Rhythm ---------- */
.report h3 {
  margin-bottom: var(--space-2);
}

.report > .badge {
  margin-bottom: var(--space-1);
}

/* ---------- 39. Modal Accessibility Polish ---------- */
.modal-box {
  animation: modalIn 200ms ease both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 40. Improved Empty State ---------- */
.empty-state {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border);
}

/* ---------- 41. Table-like Alignment Fix for Small Screens ---------- */
@media (max-width: 480px) {
  .score-hero { min-width: 140px; padding: var(--space-3) var(--space-4); }
  .score-hero-number { font-size: 2.4rem; }
  h1 { font-size: 1.9rem; }
  .container { padding: 0 var(--space-3); }
}

/* ---------- 42. Disabled Button Cursor Consistency ---------- */
.btn:disabled {
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- 43. Visually-Hidden Utility (for screen-reader-only text) ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   Day 8 additions — Comparison view + selection UI
   ========================================================= */

/* ---------- 44. Selection Checkbox on Job Cards ---------- */
.compare-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--color-navy);
  flex-shrink: 0;
}

.job-card-selected {
  outline: 2px solid var(--color-cyan);
  outline-offset: -1px;
}

/* ---------- 45. Sticky Compare-Selected Bar ---------- */
.compare-bar {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  background: var(--color-navy);
  padding: var(--space-3);
  z-index: 200;
  transition: bottom 250ms ease;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.compare-bar-visible {
  bottom: 0;
}

body.has-compare-bar {
  padding-bottom: 70px;
}

.compare-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-white);
  flex-wrap: wrap;
}

.compare-bar-inner .btn-link {
  color: #DCC9FF;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.compare-bar-shake {
  animation: shake 300ms ease;
}

/* ---------- 46. Comparison Table Layout ---------- */
.compare-scroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-top: 20px;
  padding-right: var(--space-4);
  padding-bottom: var(--space-4);
  padding-left: 2px;
  scroll-snap-type: x proximity;
  justify-content: flex-start;
}

.compare-column {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  min-width: 340px;
  max-width: 440px;
  flex: 1 1 400px;
  scroll-snap-align: start;
  position: relative;
}

.compare-column-best {
  outline: 2px solid var(--tier-green);
}

.best-fit-badge {
  position: absolute;
  top: -14px;
  right: var(--space-3);
  background: var(--tier-green);
  color: var(--text-on-tier-green);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px var(--space-2);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
  white-space: nowrap;
}

.compare-column-header {
  text-align: center;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.compare-score {
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  width: fit-content;
}

.compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) 0;
  font-size: 0.95rem;
}

.compare-row-label {
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  .compare-column { min-width: 260px; }
}

/* =========================================================
   Theme Toggle Switch
   ========================================================= */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: var(--space-2);
}

.theme-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  transition: background 200ms ease;
}

[data-theme="light"] .theme-toggle-track {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-cyan);
  border-radius: 50%;
  transition: transform 220ms ease, background 220ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(20px);
  background: #FFD866;
}

.theme-toggle-label {
  color: #C7CCE8;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="light"] .theme-toggle-label {
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 640px) {
  .theme-toggle-label { display: none; }
}

/* =========================================================
   Resume Rewrite Assistant
   ========================================================= */
.rewrite-section {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

.rewrite-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.rewrite-item {
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-cyan);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.rewrite-item-honest {
  border-left-color: var(--tier-orange);
}

.rewrite-skill {
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: var(--space-1);
  font-size: 0.92rem;
}

.rewrite-bullet {
  font-style: italic;
  margin-bottom: var(--space-1);
  line-height: 1.5;
}
