:root {
  --orange: #f47920;
  --orange2: #e05c0a;
  --orange-light: #fff4eb;
  --orange-mid: #fde8d4;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f8f9fd;
  --border: #e4e9f2;
  --border2: #ced5e8;
  --text: #1a2340;
  --text2: #5a6785;
  --text3: #9aa3bc;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --yellow: #d97706;
  --yellow-bg: #fffbeb;
  --yellow-border: #fde68a;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --shadow-sm: 0 1px 3px rgba(26,35,64,0.06), 0 1px 2px rgba(26,35,64,0.04);
  --shadow: 0 4px 16px rgba(26,35,64,0.08), 0 1px 4px rgba(26,35,64,0.04);
  --shadow-lg: 0 8px 32px rgba(26,35,64,0.1), 0 2px 8px rgba(26,35,64,0.06);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* UPLOAD SECTION */
.upload-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 36px 0;
}

.upload-hero {
  background: linear-gradient(135deg, #fff9f4 0%, #fff 60%, #f4f6fb 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.upload-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(244,121,32,0.07) 0%, transparent 70%);
  border-radius: 50%;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.drop-card {
  border: 2px dashed var(--border2);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.drop-card:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}

.drop-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--orange-light);
  border: 1px solid var(--orange-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
}

.drop-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.drop-card p {
  font-size: 12px;
  color: var(--text3);
  margin: 4px 0;
}

.drop-card .browse {
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
  margin-top: 10px;
  display: block;
}

.jd-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.jd-panel label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.jd-panel label span {
  color: var(--orange);
}

.jd-textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  resize: vertical;
  min-height: 96px;
  outline: none;
  transition: border-color 0.2s;
}

.jd-textarea:focus {
  border-color: var(--orange);
  background: #fff;
}

.jd-textarea::placeholder {
  color: var(--text3);
}

.model-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.model-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

.model-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  outline: none;
}

.model-select:focus {
  border-color: var(--orange);
}

.analyze-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--orange), var(--orange2));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(244,121,32,0.4);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.analyze-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244,121,32,0.45);
}

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

.analyze-btn svg {
  width: 18px;
  height: 18px;
}

.analyze-note {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  margin-top: 8px;
}

/* PROGRESS BAR */
.progress-bar-wrap {
  display: none;
  margin-bottom: 20px;
}

.progress-bar-bg {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange2));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.progress-step {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
}

.progress-step.active {
  color: var(--orange);
  font-weight: 700;
}

/* RESULTS */
.results {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 36px 60px;
}

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

.anim {
  animation: fadeUp 0.5s ease both;
}

.anim-d1 {
  animation-delay: 0.05s;
}

.anim-d2 {
  animation-delay: 0.12s;
}

/* SCORE ROW */
.score-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* SPEEDOMETER CARD */
.speedo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speedo-label {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 16px;
}

.speedo-svg-wrap {
  position: relative;
  display: inline-block;
}

.speedo-center {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.speedo-num {
  font-family: 'Outfit', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.speedo-denom {
  font-size: 13px;
  color: var(--text3);
  margin-top: 2px;
}

.speedo-verdict {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-top: 10px;
}

.speedo-hint {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
  text-align: center;
  line-height: 1.5;
}

/* ANALYSIS TEXT CARD */
.analysis-text-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.analysis-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.toggle-raw-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-raw-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.analysis-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.analysis-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.analysis-card:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(244,121,32,0.08), rgba(16,163,127,0.05));
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.card-header:hover {
  background: linear-gradient(135deg, rgba(244,121,32,0.12), rgba(16,163,127,0.08));
}

.card-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--orange);
  flex: 1;
}

.toggle-icon {
  font-size: 12px;
  color: var(--text3);
  transition: transform 0.3s ease;
  margin-left: 12px;
}

.card-content {
  padding: 16px 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.card-content p {
  margin: 0 0 10px 0;
  color: var(--text2);
}

.card-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.card-content li {
  margin: 6px 0;
  color: var(--text);
  line-height: 1.5;
}

.card-content strong {
  color: var(--orange);
  font-weight: 600;
}

.raw-output {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}

.raw-output::-webkit-scrollbar {
  width: 8px;
}

.raw-output::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.raw-output::-webkit-scrollbar-thumb {
  background: rgba(244, 121, 32, 0.5);
  border-radius: 4px;
}

.raw-output::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 121, 32, 0.7);
}

.analysis-container::-webkit-scrollbar {
  width: 8px;
}

.analysis-container::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.analysis-container::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

.analysis-container::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

/* SUB SPEEDOMETERS */
.sub-params-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.sub-params-header {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin-bottom: 20px;
}

.sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.sub-speedo-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

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

.sub-speedo-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}

.sub-speedo-card.green::after {
  background: var(--green);
}

.sub-speedo-card.yellow::after {
  background: var(--yellow);
}

.sub-speedo-card.blue::after {
  background: var(--blue);
}

.sub-param-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  margin-bottom: 12px;
}

.sub-speedo-center {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.sub-num {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.sub-num.green {
  color: var(--green);
}

.sub-num.yellow {
  color: var(--yellow);
}

.sub-num.blue {
  color: var(--blue);
}

.sub-denom {
  font-size: 10px;
  color: var(--text3);
}

.sub-desc {
  font-size: 11px;
  color: var(--text2);
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}

/* CARD STYLES */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text3);
}

/* KEYWORD TABS */
.kw-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.kw-tab {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  color: var(--text2);
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kw-tab:hover {
  border-color: var(--border2);
}

.kw-tab.active.t-green {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.kw-tab.active.t-red {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

.kw-count-badge {
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-size: 10px;
}

.kw-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kw-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  cursor: default;
  transition: transform 0.15s;
}

.kw-tag:hover {
  transform: translateY(-1px);
}

.kw-tag.t-green.found {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.kw-tag.t-red.missing {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

/* PROS CONS */
.pc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pc-box {
  border-radius: 14px;
  padding: 20px;
}

.pc-box.pros {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.pc-box.cons {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}

.pc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.pc-head-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.pc-head-title.green {
  color: var(--green);
}

.pc-head-title.red {
  color: var(--red);
}

.pc-count {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.pc-count.green {
  background: rgba(22, 163, 74, 0.12);
  color: var(--green);
}

.pc-count.red {
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
}

.pc-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.pc-item:last-child {
  border-bottom: none;
}

.pc-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 1px;
}

.pros .pc-icon {
  background: rgba(22, 163, 74, 0.15);
}

.cons .pc-icon {
  background: rgba(220, 38, 38, 0.1);
}

.pc-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

.pc-text strong {
  font-weight: 600;
}

/* DETAILED ANALYSIS */
.detailed-content {
  margin-bottom: 16px;
}

.detail-section {
  margin-bottom: 20px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.detail-section:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow-sm);
}

.detail-section h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  font-size: 16px;
}

.detail-section p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* Assessment Section */
.assessment-section {
  background: var(--surface);
}

.assessment-content {
  padding: 14px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--orange);
  color: var(--text);
  line-height: 1.9;
  font-size: 13px;
}

.assessment-content br {
  display: block;
  content: "";
  margin: 6px 0;
}

/* JD Comparison Section */
.jd-comparison-section {
  background: linear-gradient(135deg, var(--blue-bg) 0%, var(--surface) 100%);
  border-color: var(--blue);
  border-left: 4px solid var(--blue);
}

.jd-comparison-section h4 {
  color: var(--blue);
}

.comparison-content {
  padding: 14px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid var(--orange);
  color: var(--text);
  line-height: 1.9;
  font-size: 13px;
}

.comparison-content br {
  display: block;
  content: "";
  margin: 6px 0;
}

/* Recommendations List */
.recommendations-list {
  padding: 14px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid var(--green);
  color: var(--text);
  line-height: 1.9;
  font-size: 13px;
}

.recommendations-list br {
  display: block;
  content: "";
  margin: 8px 0;
}

/* Action Sections */
.add-section {
  background: linear-gradient(135deg, var(--green-bg) 0%, var(--surface) 100%);
  border-color: var(--green);
  border-left: 4px solid var(--green);
}

.add-section h4 {
  color: var(--green);
}

.modify-section {
  background: linear-gradient(135deg, var(--yellow-bg) 0%, var(--surface) 100%);
  border-color: var(--yellow);
  border-left: 4px solid var(--yellow);
}

.modify-section h4 {
  color: var(--yellow);
}

.remove-section {
  background: linear-gradient(135deg, var(--red-bg) 0%, var(--surface) 100%);
  border-color: var(--red);
  border-left: 4px solid var(--red);
}

.remove-section h4 {
  color: var(--red);
}

.action-plan-section {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, var(--surface) 100%);
  border-color: #8b5cf6;
  border-left: 4px solid #8b5cf6;
}

.action-plan-section h4 {
  color: #8b5cf6;
}

.action-content {
  padding: 12px;
  background: var(--surface);
  border-radius: 8px;
}

.action-list {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.action-list li {
  position: relative;
  padding: 8px 0;
  padding-left: 24px;
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.action-list li:last-child {
  border-bottom: none;
}

.action-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
}

.add-section .action-list li::before {
  content: '✓';
  color: var(--green);
}

.modify-section .action-list li::before {
  content: '✎';
  color: var(--yellow);
}

.remove-section .action-list li::before {
  content: '✗';
  color: var(--red);
}

.action-plan-content {
  padding: 14px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 3px solid #8b5cf6;
  color: var(--text);
  line-height: 1.9;
  font-size: 13px;
}

.action-plan-content strong {
  color: #8b5cf6;
  font-weight: 700;
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
}

.action-plan-content strong:first-child {
  margin-top: 0;
}

.raw-toggle-section {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
  
  .score-row {
    grid-template-columns: 1fr;
  }
  
  .sub-grid {
    grid-template-columns: 1fr;
  }
  
  .pc-grid {
    grid-template-columns: 1fr;
  }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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