/* =====================================================
   ATS Resume Match Analyzer - Main Stylesheet
   Electric Purple / Neon Violet Dark Theme
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Mono:wght@400;700&display=swap');

/* ── CSS Variables ────────────────────────────────── */
:root {
  /* ── Brand — Primary ── */
  --brand-electric:  #8B5CF6;
  --brand-neon:      #A855F7;
  --brand-royal:     #6D28D9;
  --brand-magenta:   #D946EF;
  --brand-indigo:    #312E81;

  /* ── Backgrounds ── */
  --bg-base:         #050816;
  --bg-surface:      #0B1023;
  --bg-card:         #111827;
  --bg-card-hover:   #1a2236;
  --bg-input:        #0B1023;
  --glass:           rgba(255, 255, 255, 0.05);

  /* ── Glow & accent lights ── */
  --glow-pink:       #EC4899;
  --glow-purple:     #C084FC;
  --accent-cyan:     #22D3EE;

  /* ── Semantic aliases (used across components) ── */
  --cyan:            var(--accent-cyan);
  --cyan-dim:        #0891b2;
  --cyan-glow:       rgba(34, 211, 238, 0.1);
  --purple:          var(--brand-electric);
  --purple-dim:      var(--brand-royal);
  --violet:          var(--brand-neon);
  --magenta:         var(--brand-magenta);
  --purple-glow:     rgba(139, 92, 246, 0.18);
  --pink-glow:       rgba(236, 72, 153, 0.14);
  --navy:            var(--brand-indigo);

  /* Status (unchanged for readability) */
  --green:           #10b981;
  --green-glow:      rgba(16, 185, 129, 0.15);
  --amber:           #f59e0b;
  --red:             #ef4444;
  --red-glow:        rgba(239, 68, 68, 0.15);

  --text-primary:    #f3f0ff;
  --text-secondary:  #a8a4c4;
  --text-muted:      #6b6f8a;

  --border:          rgba(139, 92, 246, 0.14);
  --border-hover:    rgba(168, 85, 247, 0.38);
  --border-purple:   rgba(139, 92, 246, 0.32);

  --font-body:  'DM Sans', sans-serif;
  --font-mono:  'Space Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 28px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 36px rgba(139, 92, 246, 0.22);
  --shadow-pink: 0 8px 32px rgba(236, 72, 153, 0.2);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(109, 40, 217, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(217, 70, 239, 0.08), transparent),
    var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Background Grid ────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ───────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

code, .mono { font-family: var(--font-mono); }

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--brand-royal); border-radius: 3px; }

/* ═══════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════ */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header / Navbar ─────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity var(--transition);
}

.logo:hover { opacity: 0.92; }

.logo--has-img {
  gap: 18px;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.logo-img {
  display: block;
  height: 58px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 18px rgba(139, 92, 246, 0.45));
}

.logo--has-img .logo-text {
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand-electric), var(--brand-magenta));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.logo-text span { color: var(--glow-purple); }

@media (max-width: 768px) {
  .logo-img {
    height: 46px;
    max-width: 160px;
  }

  .logo--has-img .logo-text {
    font-size: 1.25rem;
  }

  .logo-mark {
    padding: 6px 10px;
  }
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--purple-glow);
  border: 1px solid var(--border-purple);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--glow-purple);
  font-weight: 500;
}

/* ── Hero Section ─────────────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 0 60px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--purple-glow);
  border: 1px solid var(--border-purple);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--glow-purple);
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  background: linear-gradient(135deg, #fff 0%, var(--glow-purple) 45%, var(--brand-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 40px;
}

/* ═══════════════════════════════════════════════════
   MAIN UPLOAD FORM
═══════════════════════════════════════════════════ */
.upload-form-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .upload-form-wrapper { grid-template-columns: 1fr; }
}

.form-panel {
  background: linear-gradient(145deg, var(--bg-card), rgba(17, 24, 39, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-panel:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.panel-icon.cyan { background: var(--cyan-glow); border: 1px solid var(--border-hover); }
.panel-icon.purple { background: var(--purple-glow); border: 1px solid var(--border-purple); }

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Input Mode Toggle ────────────────────────────── */
.input-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--glow-purple);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Drop Zone ────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--brand-neon);
  background: var(--purple-glow);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.drop-zone-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.drop-zone-text strong { color: var(--glow-purple); }

.drop-zone-formats {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.file-selected {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--green-glow);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.file-selected.visible { display: flex; }
.file-selected-icon { font-size: 1.2rem; }
.file-selected-name { font-size: 0.85rem; color: var(--green); font-weight: 500; }

/* ── Textarea ─────────────────────────────────────── */
.form-textarea {
  width: 100%;
  height: 240px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color var(--transition);
  outline: none;
}

.form-textarea:focus {
  border-color: var(--brand-neon);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.form-textarea::placeholder { color: var(--text-muted); }

.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Demo Banner ──────────────────────────────────── */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--purple-glow), var(--pink-glow));
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.demo-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.demo-banner-text strong { color: var(--glow-purple); }

/* ── Analyze Button ───────────────────────────────── */
.btn-analyze {
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--brand-electric) 0%, var(--brand-magenta) 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.btn-analyze::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-analyze:hover::before { opacity: 1; }
.btn-analyze:hover { transform: translateY(-1px); box-shadow: var(--shadow-pink); }
.btn-analyze:active { transform: translateY(0); }

.btn-analyze:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-analyze .btn-icon { margin-right: 10px; }

/* ── Secondary Button ─────────────────────────────── */
.btn-secondary {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--glow-purple);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--purple-glow);
  border-color: var(--brand-neon);
}

/* ═══════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════ */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 22, 0.96);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.loading-overlay.visible { display: flex; }

.loading-logo {
  height: 88px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: drop-shadow(0 6px 24px rgba(139, 92, 246, 0.5));
}

.loading-spinner {
  width: 80px;
  height: 80px;
  position: relative;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
  border-top-color: var(--brand-electric);
  animation-duration: 1.2s;
}

.spinner-ring:nth-child(2) {
  inset: 10px;
  border-right-color: var(--brand-magenta);
  animation-duration: 1.8s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  inset: 20px;
  border-bottom-color: var(--glow-pink);
  animation-duration: 0.9s;
}

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

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 300px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  opacity: 0.4;
}

.loading-step.active { 
  opacity: 1;
  background: var(--cyan-glow);
  border: 1px solid var(--border);
}

.loading-step.done { opacity: 0.8; }
.loading-step.done .step-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-neon);
  box-shadow: 0 0 8px var(--brand-electric);
  flex-shrink: 0;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.loading-step:not(.active) .step-dot { animation: none; box-shadow: none; background: var(--text-muted); }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

.step-text { font-size: 0.9rem; color: var(--text-primary); }
.loading-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   REPORT SECTION
═══════════════════════════════════════════════════ */
.report-container {
  display: none;
  animation: fadeInUp 0.6s ease forwards;
}

.report-container.visible { display: block; }

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

/* ── Report Header ────────────────────────────────── */
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 32px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin-bottom: 0;
  gap: 20px;
  flex-wrap: wrap;
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.report-logo-wrap {
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.report-logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.report-title-area h2 {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--glow-purple);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.report-job-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.report-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.report-meta-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.report-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-shrink: 0;
}

/* ── Score Dashboard ──────────────────────────────── */
.score-dashboard {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 0;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .score-dashboard { grid-template-columns: 1fr; }
}

/* ── Score Gauge ──────────────────────────────────── */
.gauge-panel {
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  background: linear-gradient(135deg, var(--purple-glow), var(--pink-glow));
  min-width: 280px;
}

.gauge-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 20px;
}

.gauge-svg { width: 200px; height: 200px; }

.gauge-score {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-number {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  background: linear-gradient(135deg, var(--glow-purple), var(--brand-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gauge-label-small {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.gauge-status {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.gauge-status.critical   { color: #f87171; }
.gauge-status.acceptable { color: #fb923c; }
.gauge-status.below-good { color: #c084fc; text-shadow: 0 0 14px rgba(139, 92, 246, 0.45), 0 0 18px rgba(34, 211, 238, 0.35); }
.gauge-status.good       { color: var(--glow-purple); }
.gauge-status.very-good  { color: var(--accent-cyan); }
.gauge-status.excellent  { color: var(--green); }

.gauge-tip {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 180px;
}

/* ── Score Cards Grid ─────────────────────────────── */
.score-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 24px;
  gap: 16px;
  align-content: center;
}

@media (max-width: 768px) {
  .score-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

.score-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition);
  cursor: default;
}

.score-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.score-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.score-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-card-icon { font-size: 1.1rem; }

.score-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 6px;
}

.score-card-value.critical   { color: #f87171; }
.score-card-value.acceptable { color: #fb923c; }
.score-card-value.below-good { color: #c084fc; text-shadow: 0 0 16px rgba(139, 92, 246, 0.4), 0 0 20px rgba(34, 211, 238, 0.3); }
.score-card-value.good       { color: var(--glow-purple); }
.score-card-value.very-good  { color: var(--accent-cyan); }
.score-card-value.excellent  { color: var(--green); }

.score-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.score-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.score-bar-fill.critical   { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.score-bar-fill.acceptable { background: linear-gradient(90deg, #f97316, #ea580c); }
.score-bar-fill.below-good { background: linear-gradient(90deg, var(--brand-electric), var(--accent-cyan)); }
.score-bar-fill.good       { background: linear-gradient(90deg, var(--brand-electric), var(--brand-neon)); }
.score-bar-fill.very-good  { background: linear-gradient(90deg, var(--brand-neon), var(--accent-cyan)); }
.score-bar-fill.excellent  { background: linear-gradient(90deg, var(--accent-cyan), var(--green)); }

/* ═══════════════════════════════════════════════════
   REPORT PAGES / SECTIONS
═══════════════════════════════════════════════════ */
.report-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.report-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.section-header:hover { background: var(--glass); }

.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.section-icon.cyan   { background: var(--cyan-glow);   border: 1px solid var(--border-hover); }
.section-icon.purple { background: var(--purple-glow); border: 1px solid var(--border-purple); }
.section-icon.green  { background: var(--green-glow);  border: 1px solid rgba(16,185,129,0.3); }
.section-icon.amber  { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); }
.section-icon.red    { background: var(--red-glow);    border: 1px solid rgba(239,68,68,0.3); }

.section-title-area h3 { font-size: 1rem; margin-bottom: 3px; }
.section-subtitle { font-size: 0.8rem; color: var(--text-secondary); }

.section-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 4px 10px;
  border-radius: 12px;
}

.section-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.section-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.section-toggle.collapsed { transform: rotate(-90deg); }

.section-body {
  padding: 24px 28px;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.section-body.collapsed { max-height: 0 !important; padding-top: 0; padding-bottom: 0; }

/* ═══════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════ */
.ats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.875rem;
}

.ats-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}

.ats-table tbody tr {
  background: var(--bg-surface);
  transition: all var(--transition);
}

.ats-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.ats-table tbody td {
  padding: 12px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.ats-table tbody td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.ats-table tbody td:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.skill-name {
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: capitalize;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.count-chip.resume { background: var(--purple-glow); color: var(--glow-purple); }
.count-chip.jd     { background: var(--pink-glow); color: var(--brand-magenta); }
.count-chip.zero   { background: var(--red-glow); color: var(--red); }

.tip-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
}

/* ═══════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-matched  { background: rgba(16,185,129,0.15); color: var(--green);  border: 1px solid rgba(16,185,129,0.3); }
.badge-missing  { background: rgba(239,68,68,0.1);   color: var(--red);    border: 1px solid rgba(239,68,68,0.25); }
.badge-critical { background: rgba(239,68,68,0.15);  color: #ff6b6b;       border: 1px solid rgba(239,68,68,0.4); }
.badge-high     { background: rgba(245,158,11,0.1);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.3); }
.badge-medium   { background: var(--purple-glow);   color: var(--glow-purple); border: 1px solid var(--border-hover); }
.badge-low      { background: rgba(139,148,158,0.1); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-good     { background: rgba(16,185,129,0.15); color: var(--green);  border: 1px solid rgba(16,185,129,0.3); }
.badge-warning  { background: rgba(245,158,11,0.1);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.3); }

/* ═══════════════════════════════════════════════════
   SEARCHABILITY GRID
═══════════════════════════════════════════════════ */
.searchability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.check-card.passed { border-color: rgba(16,185,129,0.2); }
.check-card.failed { border-color: rgba(239,68,68,0.2); }

.check-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.check-icon.passed { background: var(--green-glow); }
.check-icon.failed { background: var(--red-glow); }

.check-label { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.check-value { font-size: 0.75rem; color: var(--text-secondary); word-break: break-all; }

/* ═══════════════════════════════════════════════════
   RECRUITER TIPS
═══════════════════════════════════════════════════ */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.tip-card {
  padding: 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.tip-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.tip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tip-card-title { font-size: 0.9rem; font-weight: 600; }
.tip-card-count {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
}

.tip-card-body { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

.found-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.found-tag {
  padding: 2px 8px;
  background: var(--purple-glow);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--glow-purple);
}

/* ═══════════════════════════════════════════════════
   OPTIMIZATION PLAN
═══════════════════════════════════════════════════ */
.optimization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .optimization-grid { grid-template-columns: 1fr; }
}

.opt-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: default;
}

.keyword-tag.critical { 
  background: var(--red-glow); 
  border-color: rgba(239,68,68,0.3); 
  color: var(--red);
  font-weight: 600;
}

.keyword-tag.high {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.3);
  color: var(--amber);
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.priority-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.priority-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--purple-glow);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--glow-purple);
  flex-shrink: 0;
}

.priority-item.critical .priority-num {
  background: var(--red-glow);
  border-color: rgba(239,68,68,0.3);
  color: var(--red);
}

.priority-text { font-size: 0.85rem; color: var(--text-primary); }

.suggested-phrase {
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-electric);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-style: italic;
}

/* ── Score Projection ─────────────────────────────── */
.score-projection {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, var(--purple-glow), var(--pink-glow));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 20px;
  flex-wrap: wrap;
}

.proj-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.proj-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.proj-value { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); }
.proj-value.current { color: var(--text-secondary); }
.proj-value.expected { 
  background: linear-gradient(135deg, var(--glow-purple), var(--brand-magenta)); 
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.proj-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.proj-gain {
  padding: 6px 14px;
  background: var(--green-glow);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   FORMATTING CHECKS
═══════════════════════════════════════════════════ */
.formatting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.format-check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.format-check-card.passed { border-color: rgba(16,185,129,0.15); }
.format-check-card.failed { border-color: rgba(239,68,68,0.15); background: rgba(239,68,68,0.03); }

.format-check-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.format-check-indicator.passed { background: var(--green-glow); }
.format-check-indicator.failed { background: var(--red-glow); }

.format-check-label { font-size: 0.875rem; font-weight: 600; margin-bottom: 3px; }
.format-check-value { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; }
.format-check-tip   { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.app-footer {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.app-footer a { color: var(--glow-purple); text-decoration: none; }

/* ═══════════════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════════════ */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--glow-purple); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* Print styles → assets/css/print.css */

/* ═══════════════════════════════════════════════════
   RTL SUPPORT
═══════════════════════════════════════════════════ */
[dir="rtl"] .score-dashboard { direction: rtl; }
[dir="rtl"] .suggested-phrase { border-left: none; border-right: 3px solid var(--brand-electric); }
[dir="rtl"] .section-toggle.collapsed { transform: rotate(90deg); }

/* ── Animations ───────────────────────────────────── */
.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ── Gradient divider ─────────────────────────────── */
.gradient-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-royal), var(--brand-magenta), transparent);
  margin: 24px 0;
  opacity: 0.4;
}

/* ── No data state ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-state-icon { font-size: 2rem; margin-bottom: 8px; display: block; }
