/* =========================================================
   Airbnb Design System — ATS Resume Analyser
   ========================================================= */

/* Airbnb Cereal VF closest available match */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Colors */
  --text-primary:    #222222;
  --text-secondary:  #6a6a6a;
  --brand:           #ff385c;
  --brand-hover:     #e00b41;
  --bg-primary:      #ffffff;
  --bg-secondary:    #f7f7f7;
  --border-light:    #dddddd;
  --border-medium:   #c1c1c1;
  --neutral-light:   #ebebeb;

  /* Shadows (Airbnb multi-layer system) */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 2px 4px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.10);
  --shadow-modal: 0 4px 8px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.02);

  /* Spacing (4px base grid) */
  --s1:  4px;
  --s2:  8px;
  --s3:  12px;
  --s4:  16px;
  --s6:  24px;
  --s8:  32px;
  --s10: 40px;
  --s12: 48px;

  /* Radius */
  --r-pill: 9999px;
  --r-card: 20px;
  --r-btn:  8px;
  --r-input:8px;
  --r-sm:   4px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.43;
  -webkit-font-smoothing: antialiased;
}

/* ── Container ──────────────────────────────────────────── */
#app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s6) var(--s12);
}

/* ── Header / Nav ────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--s8);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
}
.logo-icon {
  color: var(--brand);
  font-size: 2rem;
  line-height: 1;
}
.logo-text {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.3px;
}
.nav-badge {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  padding: var(--s1) var(--s3);
  background: var(--bg-primary);
  transition: box-shadow 0.2s;
}
.nav-badge:hover { box-shadow: var(--shadow-card); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: var(--s12) 0 var(--s8);
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--s4);
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.18px;
  line-height: 1.15;
  margin-bottom: var(--s4);
}
.hero h1 span { color: var(--brand); }
.hero p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Search-bar style upload ─────────────────────────────── */
.upload-section { margin-bottom: var(--s6); }

.upload-pill {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-card);
  background: var(--bg-primary);
  overflow: hidden;
  transition: box-shadow 0.2s;
  cursor: pointer;
  max-width: 680px;
  margin: 0 auto;
}
.upload-pill:hover { box-shadow: var(--shadow-hover); }
.upload-pill.drag-over {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), var(--shadow-hover);
}

.pill-section {
  flex: 1;
  padding: var(--s3) var(--s6);
  border-right: 1px solid var(--border-light);
}
.pill-section:last-of-type { border-right: none; }
.pill-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.pill-value {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.pill-value.active { color: var(--text-primary); font-weight: 500; }

.pill-btn {
  margin: var(--s1) var(--s2);
  background: var(--brand);
  border: none;
  border-radius: var(--r-pill);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  cursor: pointer;
  color: #fff;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.pill-btn:hover { background: var(--brand-hover); transform: scale(1.05); }

#fileInput { display: none; }

/* ── Drop zone fallback ──────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--r-card);
  background: var(--bg-secondary);
  padding: var(--s12) var(--s6);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: var(--s4);
  display: none;
}
.upload-zone.show { display: block; }
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand);
  background: #fff5f6;
}
.upload-zone h3 {
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: var(--s2);
}
.upload-zone p { font-size: 0.85rem; color: var(--text-secondary); }

/* ── File selected pill ──────────────────────────────────── */
.file-chip {
  display: none;
  align-items: center;
  gap: var(--s3);
  max-width: 680px;
  margin: var(--s4) auto 0;
  padding: var(--s3) var(--s4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
}
.file-chip.visible { display: flex; }
.file-chip-icon {
  width: 32px; height: 32px;
  background: #fff0f2;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 1rem; flex-shrink: 0;
}
.file-chip-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-chip-size { color: var(--text-secondary); font-size: 0.78rem; }
.btn-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 1rem;
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: var(--r-pill); transition: background 0.2s;
}
.btn-remove:hover { background: var(--neutral-light); color: var(--text-primary); }

/* ── CTA ─────────────────────────────────────────────────── */
.cta-row {
  display: flex; justify-content: center; margin-bottom: var(--s8);
}
#btnAnalyse {
  background: linear-gradient(to right, #ff385c, #e00b41);
  color: #fff; border: none;
  border-radius: var(--r-pill);
  padding: 14px 36px;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: box-shadow 0.2s, transform 0.15s, opacity 0.2s;
  display: flex; align-items: center; gap: var(--s2);
  box-shadow: 0 4px 12px rgba(255,56,92,0.35);
}
#btnAnalyse:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,56,92,0.45);
}
#btnAnalyse:active { transform: translateY(0); }
#btnAnalyse:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
#btnAnalyse.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress ────────────────────────────────────────────── */
.progress-wrap { display: none; margin-bottom: var(--s8); max-width: 680px; margin-left: auto; margin-right: auto; }
.progress-wrap.visible { display: block; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: var(--s2);
}
.progress-track {
  height: 4px; background: var(--neutral-light);
  border-radius: var(--r-pill); overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(to right, #ff385c, #e00b41);
  border-radius: var(--r-pill); transition: width 0.4s ease;
}

/* ── Results ─────────────────────────────────────────────── */
#results { display: none; }
#results.visible { display: block; }

/* ── Section heading ─────────────────────────────────────── */
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s6);
}
.section-heading h2 {
  font-size: 1.375rem; font-weight: 600;
  color: var(--text-primary); letter-spacing: -0.1px;
}
.section-heading span { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Score card (property-card style) ───────────────────── */
.score-card {
  border: 1px solid var(--border-light);
  border-radius: var(--r-card);
  padding: var(--s8);
  margin-bottom: var(--s8);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--s8);
  align-items: center;
  transition: box-shadow 0.2s;
}
.score-card:hover { box-shadow: var(--shadow-hover); }

/* Score circle */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.score-ring { position: relative; width: 150px; height: 150px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .ring-track { fill: none; stroke: var(--neutral-light); stroke-width: 8; }
.score-ring .ring-fill {
  fill: none; stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 408; stroke-dashoffset: 408;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4,0,0.2,1);
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-score {
  font-size: 2.5rem; font-weight: 700;
  color: var(--text-primary); line-height: 1;
}
.ring-label { font-size: 0.7rem; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }

.score-badge {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: var(--s1) var(--s3);
  border-radius: var(--r-pill);
}
.badge-great  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-good   { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }
.badge-fair   { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-poor   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Score info */
.score-info h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: var(--s2); }
.score-info p  { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: var(--s6); line-height: 1.6; }

.meta-pills { display: flex; flex-wrap: wrap; gap: var(--s2); }
.meta-pill {
  font-size: 0.78rem; font-weight: 500;
  padding: var(--s1) var(--s3);
  border-radius: var(--r-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

/* ── Results grid ────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--s6);
  margin-bottom: var(--s8);
}

/* ── Generic card ────────────────────────────────────────── */
.card {
  border: 1px solid var(--border-light);
  border-radius: var(--r-card);
  padding: var(--s6);
  background: var(--bg-primary);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-label {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-secondary); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: var(--s6);
}

/* Chart */
.chart-wrap { display: flex; align-items: center; justify-content: center; }

/* Bar scores */
.bar-item { margin-bottom: var(--s4); }
.bar-item:last-child { margin-bottom: 0; }
.bar-row  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bar-name { font-size: 0.82rem; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: var(--s2); }
.bar-val  { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.bar-track { height: 4px; background: var(--neutral-light); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill  { height: 100%; border-radius: var(--r-pill); width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }

/* ── Section detail cards (property-card style) ──────────── */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s6);
  margin-bottom: var(--s8);
}

.section-card {
  border: 1px solid var(--border-light);
  border-radius: var(--r-card);
  padding: var(--s6);
  background: var(--bg-primary);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
  opacity: 0; transform: translateY(12px);
}
.section-card.animate-in { animation: riseIn 0.35s ease forwards; }
@keyframes riseIn { to { opacity: 1; transform: translateY(0); } }
.section-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.sc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.sc-left   { display: flex; align-items: center; gap: var(--s3); }
.sc-icon   {
  width: 40px; height: 40px;
  background: var(--bg-secondary);
  border-radius: var(--r-btn);
  display: grid; place-items: center; font-size: 1.1rem;
  flex-shrink: 0;
}
.sc-name   { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.sc-weight { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.sc-score  { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }

.sc-bar    { height: 4px; background: var(--neutral-light); border-radius: var(--r-pill); overflow: hidden; margin-bottom: var(--s4); }
.sc-fill   { height: 100%; border-radius: var(--r-pill); width: 0%; transition: width 1.4s cubic-bezier(0.4,0,0.2,1); }

.tips-list { list-style: none; }
.tips-list li {
  display: flex; gap: var(--s2); align-items: flex-start;
  padding: var(--s2) 0; font-size: 0.8rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--neutral-light); line-height: 1.5;
}
.tips-list li:last-child { border-bottom: none; }
.tip-ico { flex-shrink: 0; font-size: 0.85rem; }

/* ── Guest favourite badge style score colours ───────────── */
.c-great { color: #16a34a; }
.c-good  { color: #ca8a04; }
.c-fair  { color: #ea580c; }
.c-poor  { color: #dc2626; }

/* ── Preview section ─────────────────────────────────────── */
.preview-section {
  border: 1px solid var(--border-light);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-primary);
  box-shadow: var(--shadow-card);
}
.preview-toggle {
  width: 100%; background: none; border: none;
  padding: var(--s4) var(--s6);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-family: inherit;
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-secondary); letter-spacing: 0.06em; text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: background 0.2s;
}
.preview-toggle:hover { background: var(--bg-secondary); }
.preview-toggle.open  { border-bottom-color: var(--border-light); }
.preview-arrow { transition: transform 0.2s; }
.preview-toggle.open .preview-arrow { transform: rotate(180deg); }
.preview-body { display: none; padding: var(--s6); }
.preview-body.open { display: block; }
.preview-text {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem; color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--r-btn);
  padding: var(--s4); max-height: 280px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}
.preview-text::-webkit-scrollbar { width: 4px; }
.preview-text::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--r-pill); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  display: none; position: fixed; bottom: var(--s8); left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text-primary); color: #fff;
  padding: var(--s3) var(--s6); border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow-modal); z-index: 1000;
  white-space: nowrap; max-width: 90vw; text-align: center;
}
.toast.visible { display: block; animation: toastIn 0.25s ease forwards; }
@keyframes toastIn { to { transform: translateX(-50%) translateY(0); } }

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-light); margin: var(--s8) 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 800px) {
  .score-card    { grid-template-columns: 1fr; text-align: center; }
  .meta-pills    { justify-content: center; }
  .results-grid  { grid-template-columns: 1fr; }
  .score-ring-wrap { margin: 0 auto; }
}
@media (max-width: 560px) {
  .upload-pill   { flex-direction: column; border-radius: var(--r-card); }
  .pill-section  { border-right: none; border-bottom: 1px solid var(--border-light); width: 100%; }
  .pill-btn      { width: 100%; height: 48px; border-radius: var(--r-btn); margin: var(--s2); }
  #btnAnalyse    { width: 100%; justify-content: center; }
}
