/* ═══════════════════════════════════════════════════════════════
   Prelims Score Calculator — specific styles
═══════════════════════════════════════════════════════════════ */

/* Tab switcher */
.prelims-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.prelims-tab {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}

.prelims-tab:hover {
  color: var(--color-text);
}

.prelims-tab--active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Tab panels */
.prelims-pane {
  display: none;
}

.prelims-pane--active {
  display: block;
}

.prelims-pane__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: -8px;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--color-border-light);
}

/* Derived stats box */
.prelims-derived {
  background: var(--color-bg-alt);
  border-radius: 8px;
  padding: 10px 14px;
  margin: var(--space-3) 0;
}

.prelims-derived__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: 3px 0;
}

.prelims-derived__row strong {
  color: var(--color-brand);
  font-family: var(--font-mono);
}

/* Score breakdown */
.prelims-score-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #86efac;
  border-radius: 14px;
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.prelims-score-card--fail {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fca5a5;
}

.prelims-score-card__hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: var(--space-4);
}

.prelims-score-card__num {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-brand);
}

.prelims-score-card--fail .prelims-score-card__num {
  color: #dc2626;
}

.prelims-score-card__num-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.prelims-score-card__text h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.prelims-score-card__text p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Score breakdown rows */
.prelims-breakdown {
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: var(--space-3);
}

.prelims-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.prelims-breakdown__row:last-child {
  border-bottom: none;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid rgba(0,0,0,0.1);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
}

.prelims-breakdown__label {
  color: var(--color-text-secondary);
}

.prelims-breakdown__value {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.prelims-breakdown__value--positive { color: #16a34a; }
.prelims-breakdown__value--negative { color: #dc2626; }

/* Cutoff comparison */
.prelims-cutoff-cmp {
  margin-top: var(--space-4);
}

.prelims-cutoff-cmp__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: 10px;
}

.prelims-cutoff-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prelims-cutoff-bar {
  display: grid;
  grid-template-columns: 70px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: var(--text-xs);
}

.prelims-cutoff-bar__year {
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
}

.prelims-cutoff-bar__track {
  height: 18px;
  background: var(--color-bg-alt);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.prelims-cutoff-bar__user {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  border-radius: 4px;
  position: relative;
}

.prelims-cutoff-bar__user--fail {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.prelims-cutoff-bar__cutoff-marker {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: #1e293b;
  z-index: 1;
}

.prelims-cutoff-bar__cutoff-label {
  position: absolute;
  top: -16px;
  font-size: 9px;
  color: var(--color-text-muted);
  white-space: nowrap;
  transform: translateX(-50%);
}

.prelims-cutoff-bar__val {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  text-align: right;
  color: var(--color-text);
}

.prelims-cutoff-bar__val--pass { color: #16a34a; }
.prelims-cutoff-bar__val--fail { color: #dc2626; }

/* Probability gauge */
.prelims-probability {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  text-align: center;
}

.prelims-probability__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
  margin-bottom: 6px;
}

.prelims-probability__value {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin: 8px 0;
}

.prelims-probability__value--very-low { color: #dc2626; }
.prelims-probability__value--low { color: #ea580c; }
.prelims-probability__value--medium { color: #f59e0b; }
.prelims-probability__value--high { color: #65a30d; }
.prelims-probability__value--very-high { color: #16a34a; }

.prelims-probability__verdict {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
  margin-top: 6px;
}

.prelims-probability__progress {
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: 4px;
  margin-top: 14px;
  overflow: hidden;
}

.prelims-probability__progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, #dc2626 0%, #ea580c 25%, #f59e0b 50%, #65a30d 75%, #16a34a 100%);
}

/* Strategy tips */
.prelims-tips {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 10px;
  padding: 14px 18px;
}

.prelims-tips h4 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: #1e40af;
  margin-bottom: 8px;
}

.prelims-tips ul {
  margin: 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.prelims-tips li { margin-bottom: 4px; }

.prelims-tips strong { color: var(--color-text); }

/* Cut-off table — make first column sticky on small screens */
.prelims-cutoffs-table th,
.prelims-cutoffs-table td {
  white-space: nowrap;
}

.prelims-cutoffs-table tbody tr:hover {
  background: var(--color-bg-alt);
}
