/* =========================
   Design Tokens
========================= */
:root {
  --bg-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --primary: #6366f1;
  --primary-dark: #4f46e5;

  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #64748b;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* =========================
   Reset
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  padding: 32px 20px;
  color: var(--text-main);
}

/* =========================
   Layout
========================= */
.container {
  max-width: 920px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
}

h1 {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 750;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 1.05rem;
}

/* =========================
   Upload Section
========================= */
.upload-section {
  background: var(--surface-soft);
  border: 2px dashed #e2e8f0;
  border-radius: var(--radius-md);
  padding: 32px;
  transition: border-color 0.3s, background 0.3s;
}

.upload-section:hover {
  border-color: var(--primary);
  background: #eef2ff;
}

/* =========================
   File Inputs
========================= */
.file-input-wrapper {
  margin-bottom: 22px;
}

.file-input-wrapper label {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
  color: var(--text-main);
}

input[type="file"] {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #e5e7eb;
  background: white;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
}

input[type="file"]:hover,
input[type="file"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* =========================
   Buttons
========================= */
.btn {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 650;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.25s, box-shadow 0.25s, opacity 0.25s;
}

.btn-primary {
  background: var(--bg-gradient);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-success {
  display: none;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.btn-warning {
  display: none;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.btn-success:hover,
.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =========================
   Loading
========================= */
.loading {
  display: none;
  text-align: center;
  padding: 48px 0;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid #e5e7eb;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   Results wrapper
========================= */
.results {
  display: none;
  margin-top: 40px;
  animation: fadeIn 0.45s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   Score Card (auto themed via JS)
========================= */
.score-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 34px 26px;
  text-align: center;
  color: #fff;
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.28);
}

/* subtle decorative blobs */
.score-card::before,
.score-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0.55;
  pointer-events: none;
}

.score-card::before {
  width: 260px; height: 260px;
  top: -140px; left: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.42), rgba(255,255,255,0) 60%);
}

.score-card::after {
  width: 320px; height: 320px;
  bottom: -170px; right: -170px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.22), rgba(255,255,255,0) 65%);
}

.score-top{
  position: relative;
  z-index: 1;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.score-label {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: 0.2px;
  opacity: 0.96;
}

.score-badge{
  display: inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255,255,255,0.18);
}

/* =========================
   Animated Ring
========================= */
@property --p {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.score-ring-wrap {
  display: grid;
  place-items: center;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.score-ring {
  --p: 0;
  --size: 190px;
  --thickness: 18px;
  --ringFill: rgba(255,255,255,0.95);
  --ringTrack: rgba(255,255,255,0.28);

  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;

  background:
    conic-gradient(
      var(--ringFill) calc(var(--p) * 1%),
      var(--ringTrack) 0
    );

  box-shadow:
    0 18px 45px rgba(0,0,0,0.22),
    inset 0 1px 2px rgba(255,255,255,0.25);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: var(--thickness);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%,
      rgba(255,255,255,0.22),
      rgba(255,255,255,0.06) 50%,
      rgba(0,0,0,0.10) 100%);
  box-shadow:
    inset 0 10px 24px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), rgba(255,255,255,0) 60%);
  filter: blur(8px);
  opacity: 0.7;
}

.ring-center{
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
}

/* High-contrast percentage text */
.ring-text {
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.9px;
  color: #0f172a; /* dark slate */

  text-shadow:
    0 1px 0 rgba(255,255,255,0.6),
    0 6px 14px rgba(15,23,42,0.25);
}

.ring-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155; /* muted dark */
  opacity: 0.9;
}

/* =========================
   Sections
========================= */
.section {
  background: var(--surface-soft);
  padding: 28px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border-left: 4px solid var(--primary);
}

.section h2 {
  font-size: 1.45rem;
  margin-bottom: 18px;
}

.section ul {
  list-style: none;
}

.section li {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  color: #334155;
}

.section li:last-child {
  border-bottom: none;
}

/* =========================
   Priority Cards
========================= */
.priority-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.priority-card {
  background: white;
  padding: 18px;
  border-radius: var(--radius-sm);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid #e5e7eb;
}

.category-label{
  max-width: 100%;
  color: #64748b;
  font-size: 0.95em;
  line-height: 1.25;

  overflow-wrap: anywhere;
  word-break: break-word;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-value{
  color: #0f172a;
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 6px;
}

/* Priority Variants */
.priority-card.must-have {
  border-color: #ef4444;
  background: #fef2f2;
}

.priority-card.good-to-have {
  border-color: #f59e0b;
  background: #fffbeb;
}

.priority-card.not-required {
  border-color: #cbd5e1;
  background: #f8fafc;
}

/* =========================
   Category Breakdown Bars
========================= */
.bar-list{
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.bar-row{
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 3fr minmax(64px, 0.6fr);
  gap: 12px;
  align-items: center;
}

.bar-name{
  font-weight: 700;
  color: #0f172a;

  overflow-wrap: anywhere;
  word-break: break-word;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bar-track{
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill{
  width: 0%;
  height: 100%;
  border-radius: 999px;
  transition: width 900ms cubic-bezier(.2,.9,.2,1);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.bar-value{
  text-align: right;
  font-weight: 800;
  color: #334155;
}

/* =========================
   Verdict + Error
========================= */
.verdict{
  background: white;
  padding: 22px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  line-height: 1.7;
  border: 1px solid #e5e7eb;
}

.error{
  display: none;
  background: #fef2f2;
  color: #b91c1c;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 20px;
  border-left: 4px solid #ef4444;
}

@media (max-width: 600px) {
  .container { padding: 30px 20px; }
  .bar-row { grid-template-columns: 1fr; }
  .bar-value { text-align: left; }
}

@media (prefers-reduced-motion: reduce){
  .bar-fill { transition: none !important; }
}
/* =========================
   Category Breakdown: prioritize text, slimmer bars
========================= */

.bar-row{
  grid-template-columns: minmax(260px, 2.2fr) 2.4fr minmax(56px, 0.6fr);
  gap: 14px;
  align-items: center;
}

.bar-track{
  height: 8px;
  background: #e9eef6;
  border-radius: 999px;
  opacity: 0.9;
}

.bar-fill{
  height: 100%;
  border-radius: 999px;
  box-shadow: none;
  transition: width 700ms cubic-bezier(.2,.9,.2,1);
}

.bar-name{
  font-size: 0.98rem;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.25;

  overflow-wrap: anywhere;
  word-break: break-word;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bar-value{
  font-weight: 700;
  color: #475569;
}

.bar-list{
  gap: 12px;
}

.bar-row{
  grid-template-columns: minmax(320px, 2.8fr) 1.8fr 44px;  /* % column tighter */
  gap: 12px;
}

.bar-value{
  font-size: 0.9rem;
  font-weight: 650;
  color: #64748b;
  letter-spacing: 0.1px;
}

.bar-track{
  height: 7px;
  opacity: 0.85;
}

.results {
  padding-top: 6px;
}

.score-card {
  margin-bottom: 26px;
}

.section:first-of-type {
  margin-top: 6px;
}