/* ─────────────────────────────────────────────
   NBMEScore AI Question Generator — questions.css
   ───────────────────────────────────────────── */

/* BASE */
.nbme-q-wrap {
  max-width: 820px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a2e;
}

/* ── QOTD HEADER ── */
.nbme-qotd-header {
  text-align: center;
  margin-bottom: 20px;
}
.nbme-qotd-date {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.nbme-qotd-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1a1a2e;
}
.nbme-qotd-header p {
  font-size: 14px;
  color: #666;
  margin-bottom: 14px;
}
.nbme-qotd-steps {
  justify-content: center;
}

/* ── QGEN HEADER ── */
.nbme-qgen-header {
  text-align: center;
  margin-bottom: 24px;
}
.nbme-qgen-header h2 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.nbme-qgen-header p  { font-size: 14px; color: #666; margin-bottom: 10px; }

.nbme-remaining-pill {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #eeeeff;
  color: #6c63ff;
  font-weight: 600;
}

/* ── STREAK BAR ── */
.nbme-streak-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8ee;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
}
.nbme-streak-icon { font-size: 20px; }
.nbme-streak-count { font-size: 22px; font-weight: 700; }
.nbme-streak-label { color: #b45309; }
.nbme-streak-dots {
  margin-left: auto;
  display: flex;
  gap: 5px;
}
.nbme-streak-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fde68a;
}
.nbme-streak-dot.filled { background: #f59e0b; }

/* ── LOADING ── */
.nbme-loading-card {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-size: 14px;
}
.nbme-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(108,99,255,0.25);
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: nbme-spin 0.7s linear infinite;
  vertical-align: middle;
}
.nbme-spinner-lg {
  width: 36px; height: 36px;
  border-width: 3px;
  display: block;
  margin: 0 auto 12px;
}
@keyframes nbme-spin { to { transform: rotate(360deg); } }

/* ── QUESTION CARD ── */
.nbme-question-card {
  background: #fff;
  border: 1.5px solid #e4e8f5;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
}

/* In question list (qgen) */
.nbme-question-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.nbme-question-list .nbme-question-card { margin-bottom: 0; }

/* Meta row */
.nbme-q-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.nbme-category-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #eeeeff;
  color: #6c63ff;
  font-weight: 600;
}
.nbme-difficulty-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.nbme-difficulty-badge.easy   { background: #ecfdf5; color: #065f46; }
.nbme-difficulty-badge.medium { background: #fffbeb; color: #92400e; }
.nbme-difficulty-badge.hard   { background: #fef2f2; color: #991b1b; }

/* Q number (qgen) */
.nbme-q-number {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin-bottom: 10px;
}

/* Stem */
.nbme-q-stem {
  font-size: 15px;
  line-height: 1.7;
  color: #1a1a2e;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9ff;
  border-radius: 8px;
  border-left: 3px solid #6c63ff;
}

/* Options */
.nbme-q-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.nbme-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid #e0e4f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  text-align: left;
  width: 100%;
  font-size: 14px;
  color: #1a1a2e;
  line-height: 1.5;
}
.nbme-option:hover:not(:disabled) {
  border-color: #6c63ff;
  background: #f8f8ff;
  color: #1a1a2e !important;
}
.nbme-option.selected {
  border-color: #6c63ff;
  background: #f0efff;
  color: #1a1a2e !important;
}
.nbme-option.correct {
  border-color: #059669;
  background: #ecfdf5;
  color: #065f46 !important;
}
.nbme-option.incorrect {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b !important;
}
.nbme-option.reveal-correct {
  border-color: #059669;
  background: #ecfdf5;
  color: #065f46 !important;
}
.nbme-option:disabled { cursor: default; }

.nbme-option-letter {
  font-size: 13px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8eaf0;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.nbme-option.selected .nbme-option-letter   { background: #6c63ff; color: #fff; }
.nbme-option.correct .nbme-option-letter    { background: #059669; color: #fff; }
.nbme-option.incorrect .nbme-option-letter  { background: #dc2626; color: #fff; }
.nbme-option.reveal-correct .nbme-option-letter { background: #059669; color: #fff; }

/* Submit */
.nbme-btn-submit {
  width: 100%;
  padding: 13px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-bottom: 0;
}
.nbme-btn-submit:disabled { background: #c5c3e8; cursor: not-allowed; }
.nbme-btn-submit:hover:not(:disabled) { opacity: 0.9; }

/* Explanation */
.nbme-explanation-card {
  margin-top: 16px;
  background: #f8f9ff;
  border: 1px solid #e0e4f0;
  border-radius: 10px;
  padding: 18px;
}
.nbme-explanation-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.nbme-teaching-point {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
  margin-bottom: 12px;
}
.nbme-teaching-point::before { content: "💡 Key Point: "; }
.nbme-explanation-body {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
}

/* Community stats */
.nbme-community-stats {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8eaf0;
}

/* Post-answer actions */
.nbme-post-answer-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.nbme-btn-share {
  padding: 9px 16px;
  border: 1.5px solid #e0e4f0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}
.nbme-btn-share:hover { border-color: #6c63ff; color: #6c63ff; }
.nbme-btn-qbank {
  padding: 9px 16px;
  background: linear-gradient(135deg, #6c63ff, #5a54d4);
  color: #fff !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
}
.nbme-btn-qbank:hover { opacity: 0.9; color: #fff !important; }

/* ── SCORE TRACKER ── */
.nbme-score-tracker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9ff;
  border: 1px solid #e0e4f0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #555;
}
.nbme-score-bar-wrap {
  flex: 1;
  height: 6px;
  background: #e0e4f0;
  border-radius: 10px;
  overflow: hidden;
}
.nbme-score-bar {
  height: 100%;
  background: #059669;
  border-radius: 10px;
  transition: width 0.4s ease;
}
#nbme-score-pct { font-weight: 700; color: #059669; min-width: 36px; text-align: right; }

/* ── SUMMARY ── */
.nbme-summary-card {
  background: #fff;
  border: 1.5px solid #e0e4f0;
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
  margin-top: 8px;
}
.nbme-summary-score {
  margin-bottom: 10px;
}
.nbme-summary-num {
  font-size: 48px;
  font-weight: 800;
  color: #6c63ff;
  line-height: 1;
}
.nbme-summary-label { font-size: 14px; color: #666; margin-top: 4px; }
.nbme-summary-msg { font-size: 15px; color: #333; margin-bottom: 20px; font-weight: 500; }
.nbme-summary-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── UPGRADE WALL ── */
.nbme-upgrade-card {
  background: #fff;
  border: 1.5px solid #e0e4f0;
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  margin-top: 16px;
  box-shadow: 0 4px 24px rgba(108,99,255,0.08);
}
.nbme-upgrade-icon { font-size: 42px; margin-bottom: 12px; }
.nbme-upgrade-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: #1a1a2e; }
.nbme-upgrade-card p  { font-size: 14px; color: #555; margin-bottom: 16px; }
.nbme-upgrade-features {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; max-width: 300px; margin: 0 auto 20px;
}
.nbme-upgrade-features span { font-size: 13px; color: #333; }
.nbme-btn-buy {
  display: inline-block;
  padding: 14px 28px;
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.nbme-btn-buy:hover { opacity: 0.9; color: #fff !important; }
.nbme-paywall-note { font-size: 11px; color: #aaa; margin-top: 10px; }

/* ── SUBSCRIBE CARD ── */
.nbme-subscribe-card {
  margin-top: 20px;
  background: linear-gradient(135deg, #667eea22, #764ba222);
  border: 1px solid #c5c3e8;
  border-radius: 14px;
  padding: 24px;
}
.nbme-subscribe-inner { text-align: center; }
.nbme-subscribe-icon { font-size: 32px; margin-bottom: 10px; }
.nbme-subscribe-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.nbme-subscribe-card p  { font-size: 13px; color: #555; margin-bottom: 14px; }
.nbme-subscribe-form {
  display: flex; gap: 8px; max-width: 420px; margin: 0 auto;
}
.nbme-subscribe-form input {
  flex: 1; padding: 10px 14px;
  border: 1.5px solid #c5c3e8; border-radius: 8px;
  font-size: 14px; color: #1a1a2e;
}
.nbme-subscribe-form input:focus { outline: none; border-color: #6c63ff; }
.nbme-btn-subscribe {
  padding: 10px 18px; background: #6c63ff; color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: opacity 0.15s;
}
.nbme-btn-subscribe:hover { opacity: 0.9; }
.nbme-sub-success { font-size: 14px; color: #059669; font-weight: 600; }

/* ── SHARED FORM STYLES (reuse from notes) ── */
.nbme-notes-form {
  background: #f8f9ff; border: 1px solid #e0e4f0;
  border-radius: 14px; padding: 24px; margin-bottom: 28px;
}
.nbme-form-grid { display: flex; flex-direction: column; gap: 16px; }
.nbme-form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nbme-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: #333; margin-bottom: 6px;
}
.nbme-optional { color: #999; font-weight: 400; }
.nbme-field input[type="text"],
.nbme-field select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #dde1f0; border-radius: 8px;
  font-size: 14px; color: #1a1a2e; background: #fff;
  transition: border-color 0.15s; box-sizing: border-box;
}
.nbme-field input:focus, .nbme-field select:focus {
  outline: none; border-color: #6c63ff;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}
.nbme-step-toggle { display: flex; gap: 6px; }
.nbme-step-btn {
  flex: 1; padding: 8px 10px; border-radius: 8px;
  border: 1.5px solid #dde1f0; background: #fff;
  font-size: 13px; font-weight: 500; color: #555;
  cursor: pointer; transition: all 0.15s;
}
.nbme-step-btn.active { background: #6c63ff; color: #fff; border-color: #6c63ff; }
.nbme-step-btn:hover:not(.active) { border-color: #6c63ff; color: #6c63ff; }
.nbme-topic-suggestions { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nbme-suggestion-label { font-size: 11px; color: #888; font-weight: 500; }
.nbme-suggest-btn {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  border: 1px solid #c8cce8; background: #fff; color: #555; cursor: pointer;
}
.nbme-suggest-btn:hover { background: #6c63ff; color: #fff; border-color: #6c63ff; }
.nbme-btn-primary {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #6c63ff, #5a54d4);
  color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s;
}
.nbme-btn-primary:hover { opacity: 0.92; }
.nbme-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.nbme-results-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1.5px solid #eee;
}
.nbme-results-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nbme-result-topic { font-size: 18px; font-weight: 700; color: #1a1a2e; }
.nbme-result-step-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: #eeeeff; color: #6c63ff; font-weight: 600;
}
.nbme-btn-ghost {
  background: transparent; border: 1px solid #dde1f0;
  border-radius: 8px; padding: 6px 12px; font-size: 13px;
  color: #555; cursor: pointer; transition: all 0.15s;
}
.nbme-btn-ghost:hover { background: #f8f9ff; border-color: #6c63ff; color: #6c63ff; }
.nbme-alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-top: 12px; }
.nbme-alert-warning { background: #fef9e7; border: 1px solid #f9ca24; color: #7d5e00; }
.nbme-btn-link { background: none; border: none; color: #6c63ff; cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }
.nbme-error-card { text-align: center; padding: 20px; color: #888; font-size: 14px; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .nbme-form-row { grid-template-columns: 1fr; }
  .nbme-qotd-header h2, .nbme-qgen-header h2 { font-size: 21px; }
  .nbme-post-answer-actions { flex-direction: column; }
  .nbme-btn-qbank, .nbme-btn-share { width: 100%; text-align: center; justify-content: center; }
  .nbme-subscribe-form { flex-direction: column; }
  .nbme-results-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nbme-score-tracker { flex-wrap: wrap; }
}

/* ─────────────────────────────────────────────
   UPGRADE MODAL
   ───────────────────────────────────────────── */
.nbme-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.nbme-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.nbme-modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px;
  max-width: 480px;
  width: 100%;
  z-index: 9999;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.nbme-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  font-size: 13px;
  cursor: pointer;
  color: #555;
  display: flex; align-items: center; justify-content: center;
}
.nbme-modal-close:hover { background: #e0e0e0; }

/* Pricing header */
.nbme-pricing-header { text-align: center; margin-bottom: 22px; }
.nbme-pricing-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 20px;
  background: linear-gradient(135deg, #6c63ff, #5a54d4);
  color: #fff; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.nbme-pricing-header h2 { font-size: 22px; font-weight: 800; margin-bottom: 10px; color: #1a1a2e; }
.nbme-pricing-price { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.nbme-price-amount { font-size: 48px; font-weight: 800; color: #6c63ff; line-height: 1; }
.nbme-price-period { font-size: 18px; color: #888; font-weight: 500; }
.nbme-price-note { font-size: 13px; color: #888; margin-top: 6px; }

/* Features */
.nbme-pricing-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.nbme-pricing-feature {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px;
  background: #f8f9ff; border-radius: 8px;
}
.nbme-feat-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.nbme-pricing-feature strong { display: block; font-size: 14px; font-weight: 600; color: #1a1a2e; margin-bottom: 2px; }
.nbme-pricing-feature span { font-size: 12px; color: #666; line-height: 1.4; }

/* Checkout */
.nbme-checkout-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.nbme-checkout-email-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #dde1f0; border-radius: 8px;
  font-size: 14px; color: #1a1a2e;
  box-sizing: border-box;
}
.nbme-checkout-email-input:focus { outline: none; border-color: #6c63ff; }
.nbme-btn-checkout {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, #27ae60, #219a52);
  color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.nbme-btn-checkout:hover { opacity: 0.91; }
.nbme-btn-checkout:disabled { opacity: 0.65; cursor: not-allowed; }
.nbme-checkout-note { font-size: 11px; color: #aaa; text-align: center; margin: 0; }

/* Or divider */
.nbme-or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0; color: #ccc; font-size: 12px;
}
.nbme-or-divider::before, .nbme-or-divider::after {
  content: ''; flex: 1; height: 1px; background: #eee;
}

/* License */
.nbme-license-form { display: flex; gap: 8px; }
.nbme-license-input {
  flex: 1; padding: 10px 12px;
  border: 1.5px solid #dde1f0; border-radius: 8px;
  font-size: 13px; font-family: monospace; color: #1a1a2e;
}
.nbme-license-input:focus { outline: none; border-color: #6c63ff; }
.nbme-btn-activate {
  padding: 10px 16px;
  background: #6c63ff; color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: opacity 0.15s;
}
.nbme-btn-activate:hover { opacity: 0.9; }
.nbme-btn-activate:disabled { opacity: 0.6; cursor: not-allowed; }
.nbme-license-error {
  margin-top: 8px; font-size: 12px; color: #dc2626;
  background: #fef2f2; border-radius: 6px; padding: 7px 10px;
}
.nbme-license-success {
  margin-top: 8px; font-size: 12px; color: #059669;
  background: #ecfdf5; border-radius: 6px; padding: 7px 10px; font-weight: 600;
}

/* Pro badge shown when unlocked */
.nbme-pro-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #6c63ff, #5a54d4);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}

@media (max-width: 480px) {
  .nbme-modal-box { padding: 24px 18px; }
  .nbme-price-amount { font-size: 40px; }
  .nbme-license-form { flex-direction: column; }
}

/* ── WAIT MESSAGE ── */
.nbme-wait-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  background: #f0efff;
  border: 1px dashed #a09af0;
  border-radius: 10px;
  font-size: 14px;
  color: #4a42b0;
  font-weight: 500;
  animation: nbme-fade-pulse 2s ease-in-out infinite;
}
.nbme-wait-icon { font-size: 20px; }
@keyframes nbme-fade-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
