/* ===========================
   AI Resume Analyzer — Styles
   =========================== */

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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #a855f7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.1);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
}
.header .container { padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { flex-shrink: 0; }
.brand-name { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.brand-sub { font-size: .72rem; color: var(--text-3); font-weight: 500; margin-top: 1px; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  padding: 52px 0 44px;
  text-align: center;
}
.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: white;
  margin-bottom: 14px;
  line-height: 1.25;
}
.hero-desc {
  font-size: 1rem;
  color: rgba(255,255,255,.85);
  max-width: 580px;
  margin: 0 auto 24px;
}
.hero-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.feature-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18);
  color: white;
  font-size: .8rem; font-weight: 500;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(4px);
}

/* ── Main ── */
.main { padding: 40px 0 60px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .95rem; font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.card-title svg { color: var(--primary); flex-shrink: 0; }
.card-desc { font-size: .84rem; color: var(--text-2); margin-bottom: 12px; }

.badge-optional {
  font-size: .7rem; font-weight: 500;
  color: var(--text-3);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
  margin-left: 4px;
}

/* ── Input Grid ── */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 720px) { .input-grid { grid-template-columns: 1fr; } }

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  background: #f5f3ff;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  min-height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: #eef2ff;
}
#dzEmpty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dz-icon { color: #a5b4fc; }
.dz-title { font-size: .95rem; font-weight: 600; color: var(--text-2); }
.dz-sub { font-size: .78rem; color: var(--text-3); }

.btn-browse {
  display: inline-flex; align-items: center;
  background: var(--primary);
  color: white;
  font-size: .82rem; font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: 4px;
}
.btn-browse:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* File selected state */
#dzSelected { width: 100%; }
.selected-file {
  display: flex; align-items: center; gap: 12px;
  background: white;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.selected-icon { color: var(--primary); flex-shrink: 0; }
.selected-info { flex: 1; min-width: 0; }
.selected-name { font-size: .88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-size { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.btn-remove {
  background: #fef2f2; color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-remove:hover { background: #fee2e2; }

.selected-ready {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .8rem; font-weight: 500; color: var(--success);
}

/* ── Textarea ── */
.textarea {
  width: 100%; min-height: 195px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: .87rem;
  color: var(--text);
  background: #fafafa;
  resize: vertical;
  transition: border-color .2s;
  line-height: 1.6;
}
.textarea:focus { outline: none; border-color: var(--primary); background: white; }
.textarea::placeholder { color: var(--text-3); }

/* ── Analyze Row ── */
.analyze-row { display: flex; align-items: center; gap: 16px; margin-bottom: 36px; }
.analyze-note { font-size: .82rem; color: var(--text-3); }

.btn-analyze {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-family: inherit;
  font-size: .95rem; font-weight: 700;
  padding: 13px 30px;
  border: none; border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 15px rgba(99,102,241,.4);
  flex-shrink: 0;
}
.btn-analyze:hover:not(:disabled) { opacity: .92; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,.5); }
.btn-analyze:active:not(:disabled) { transform: translateY(0); }
.btn-analyze:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.loading-card {
  background: white;
  border-radius: 20px;
  padding: 44px 48px;
  text-align: center;
  max-width: 400px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.spinner-wrap { margin-bottom: 20px; }
.spinner-svg { display: block; margin: 0 auto; }
.loading-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.loading-sub { font-size: .85rem; color: var(--text-2); margin-bottom: 24px; }
.load-steps { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.load-step {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; color: var(--text-3);
  transition: color .3s;
}
.load-step.active { color: var(--primary); font-weight: 600; }
.load-step.done { color: var(--success); }
.lstep-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background .3s;
}
.load-step.active .lstep-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.load-step.done .lstep-dot { background: var(--success); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: #1e293b; color: white;
  font-size: .85rem; font-weight: 500;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  max-width: 360px;
  opacity: 0; transform: translateY(16px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.error { background: #dc2626; }

/* ═══════════════════════
   RESULTS SECTION
═══════════════════════ */
#results { animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* Results Header */
.results-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.results-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.results-sub { font-size: .82rem; color: var(--text-2); margin-top: 2px; }
.btn-reanalyze {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: .82rem; font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 8px 16px; cursor: pointer;
  transition: background .15s;
}
.btn-reanalyze:hover { background: #e0e7ff; }

/* Scores Row */
.scores-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.score-card {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px;
  text-align: center; box-shadow: var(--shadow);
}
.score-circle-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 14px; }
.score-circle-svg { transform: rotate(-90deg); }
.score-circle-bg { fill: none; stroke: #f1f5f9; stroke-width: 10; }
.score-circle-fill {
  fill: none; stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(.34,1.56,.64,1);
}
.score-number {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.score-pct { font-size: .7rem; color: var(--text-3); font-weight: 500; }
.score-label { font-size: .88rem; font-weight: 600; color: var(--text); }
.score-desc { font-size: .75rem; color: var(--text-3); margin-top: 4px; }

/* Score colors */
.score-high .score-circle-fill, .score-high .score-value { stroke: #10b981; color: #10b981; }
.score-mid .score-circle-fill, .score-mid .score-value { stroke: #f59e0b; color: #f59e0b; }
.score-low .score-circle-fill, .score-low .score-value { stroke: #ef4444; color: #ef4444; }

/* Summary Card */
.summary-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--radius); padding: 22px 24px;
  margin-bottom: 20px;
  display: flex; gap: 14px; align-items: flex-start;
}
.summary-icon { color: #0284c7; flex-shrink: 0; margin-top: 2px; }
.summary-text { font-size: .9rem; line-height: 1.7; color: #0c4a6e; }

/* Two Column Grid */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* List Card */
.list-card {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.list-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
}
.list-items { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .84rem; color: var(--text-2); line-height: 1.5;
}
.item-dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.item-dot.success { background: #d1fae5; color: #059669; }
.item-dot.danger  { background: #fee2e2; color: #dc2626; }
.item-dot.warning { background: #fef3c7; color: #d97706; }

/* Skills Section */
.skills-section {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }
.skills-group-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px;
}
.skills-group-title.match { color: #059669; }
.skills-group-title.gap   { color: #dc2626; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-size: .78rem; font-weight: 500; padding: 4px 12px;
  border-radius: 100px; border: 1px solid;
}
.pill.match { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.pill.gap   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.pill.keyword { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; cursor: pointer; transition: background .15s; }
.pill.keyword:hover { background: #ddd6fe; }

/* Suggestions */
.suggestions-section {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .95rem; font-weight: 700; color: var(--text);
  margin-bottom: 16px;
}
.section-title svg { color: var(--primary); }
.suggestion-list { display: flex; flex-direction: column; gap: 10px; }
.suggestion-item {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.suggestion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; cursor: pointer;
  background: #fafafa; transition: background .15s;
}
.suggestion-header:hover { background: #f1f5f9; }
.suggestion-section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--primary);
}
.suggestion-arrow {
  color: var(--text-3); transition: transform .2s; flex-shrink: 0;
}
.suggestion-item.open .suggestion-arrow { transform: rotate(180deg); }
.suggestion-body { display: none; padding: 0 16px 16px; }
.suggestion-item.open .suggestion-body { display: block; }
.suggestion-issue {
  font-size: .83rem; color: var(--danger); margin-bottom: 8px;
  display: flex; gap: 8px; align-items: flex-start;
}
.suggestion-fix {
  font-size: .83rem; color: #065f46; background: #f0fdf4;
  border-left: 3px solid var(--success);
  padding: 10px 12px; border-radius: 0 8px 8px 0;
  display: flex; gap: 8px; align-items: flex-start;
}
.fix-label { font-weight: 700; flex-shrink: 0; }

/* Keywords Section */
.keywords-section {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.keywords-hint { font-size: .78rem; color: var(--text-3); margin-bottom: 12px; }

/* Formatting Issues */
.formatting-section {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius); padding: 22px;
  margin-bottom: 20px;
}

/* Empty state for lists */
.empty-state {
  font-size: .82rem; color: var(--text-3); font-style: italic; padding: 8px 0;
}

/* ── Footer ── */
.footer {
  background: white; border-top: 1px solid var(--border);
  padding: 20px 0; text-align: center;
}
.footer p { font-size: .82rem; color: var(--text-3); }
.footer strong { color: var(--primary); }
