/* ═══════════════════════════════════════════════════════════════
   BEM Platform Pro — QCM / Quiz Styles v2
   ═══════════════════════════════════════════════════════════════ */

/* ─── QCM Button in Unit View ────────────────────────────────── */
.bem-qcm-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 28px; border-radius: 10px; border: none; cursor: pointer;
  font-family: var(--bem-font, 'Tajawal', sans-serif);
  font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
  transition: all .2s; box-shadow: 0 4px 14px rgba(245,158,11,.35);
  text-decoration: none; min-height: 50px;
}
.bem-qcm-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,158,11,.4); color: #fff; }

/* ─── Quiz List ──────────────────────────────────────────────── */
.bem-qcm-list { display: grid; gap: 14px; margin-top: 16px; }

.bem-qcm-card {
  background: #fff; border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07); border: 2px solid transparent;
  transition: all .22s; cursor: pointer;
}
.bem-qcm-card:hover {
  border-color: #f59e0b; transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245,158,11,.15);
}
.bem-qcm-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 12px; }
.bem-qcm-card-title  { font-size: 16px; font-weight: 700; color: #1e293b; line-height: 1.4; }
.bem-qcm-card-meta   { font-size: 12px; color: #64748b; display: flex; gap: 14px; flex-wrap: wrap; }
.bem-qcm-card-desc   { font-size: 14px; color: #64748b; margin-bottom: 14px; line-height: 1.6; }
.bem-qcm-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bem-qcm-card-readiness { flex: 1; min-width: 150px; }
.bem-qcm-last-result { font-size: 12px; color: #64748b; }
.bem-qcm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.bem-qcm-badge--new  { background: #fef3c7; color: #92400e; }
.bem-qcm-badge--done { background: #d1fae5; color: #065f46; }

/* ─── Quiz Taking UI ─────────────────────────────────────────── */
.bem-qcm-quiz { max-width: 820px; margin: 0 auto; }

.bem-qcm-header {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; padding: 20px 26px; border-radius: 14px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; box-shadow: 0 6px 20px rgba(245,158,11,.3);
}
.bem-qcm-header-title { font-size: 17px; font-weight: 800; }

.bem-qcm-timer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.2); padding: 8px 18px; border-radius: 10px;
  font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.bem-qcm-timer--warning { background: rgba(220,38,38,.85); animation: bemQcmPulse 1s infinite; }

/* Progress */
.bem-qcm-progress-bar {
  height: 7px; background: #e2e8f0; border-radius: 4px; margin-bottom: 18px; overflow: hidden;
}
.bem-qcm-progress-fill {
  height: 100%; background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: 4px; transition: width .4s ease;
}

/* Question Card */
.bem-qcm-question-card {
  background: #fff; border-radius: 16px; padding: 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07); margin-bottom: 16px;
  border: 1px solid #e2e8f0;
}
.bem-qcm-question-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; border-radius: 12px; font-weight: 800; font-size: 15px;
  margin-left: 12px; box-shadow: 0 3px 10px rgba(245,158,11,.3);
}
.bem-qcm-question-text {
  font-size: 17px; font-weight: 600; color: #1e293b; line-height: 1.75;
  margin-bottom: 22px; display: inline;
}

/* Options */
.bem-qcm-options { display: grid; gap: 11px; }
.bem-qcm-option {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px; border: 2px solid #e2e8f0; border-radius: 12px;
  cursor: pointer; transition: all .18s; background: #fff; min-height: 56px;
}
.bem-qcm-option:hover { border-color: #f59e0b; background: #fffbeb; }
.bem-qcm-option.selected { border-color: #f59e0b; background: #fef3c7; }
.bem-qcm-option input[type="radio"] { display: none; }
.bem-qcm-option-letter {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #64748b; flex-shrink: 0; transition: all .18s;
}
.bem-qcm-option.selected .bem-qcm-option-letter { background: #f59e0b; color: #fff; }
.bem-qcm-option-text { font-size: 15px; color: #334155; line-height: 1.5; }

/* Navigation */
.bem-qcm-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; gap: 12px; flex-wrap: wrap;
}
.bem-qcm-nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; border: none; cursor: pointer;
  font-family: var(--bem-font, 'Tajawal', sans-serif);
  font-size: 14px; font-weight: 700; transition: all .2s; min-height: 50px;
}
.bem-qcm-nav-btn--prev   { background: #f1f5f9; color: #374151; }
.bem-qcm-nav-btn--prev:hover { background: #e2e8f0; }
.bem-qcm-nav-btn--next   { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.3); }
.bem-qcm-nav-btn--next:hover   { box-shadow: 0 6px 20px rgba(124,58,237,.4); transform: translateY(-1px); }
.bem-qcm-nav-btn--submit { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.bem-qcm-nav-btn--submit:hover { box-shadow: 0 6px 20px rgba(16,185,129,.4); transform: translateY(-1px); }
.bem-qcm-nav-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.bem-qcm-counter { font-size: 14px; color: #64748b; font-weight: 600; }

/* Question Dots */
.bem-qcm-dots {
  display: flex; gap: 7px; flex-wrap: wrap; justify-content: center;
  padding: 14px; background: #fff; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 16px;
  border: 1px solid #e2e8f0;
}
.bem-qcm-dot {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #94a3b8; cursor: pointer;
  transition: all .18s; background: #fff;
}
.bem-qcm-dot.answered { border-color: #f59e0b; background: #fef3c7; color: #92400e; }
.bem-qcm-dot.current  { border-color: #7c3aed; background: #ede9fe; color: #5b21b6; }

/* ─── Results View ───────────────────────────────────────────── */
.bem-qcm-results { max-width: 820px; margin: 0 auto; }

.bem-qcm-score-card {
  text-align: center; padding: 36px; border-radius: 20px; margin-bottom: 22px;
  color: #fff; position: relative; overflow: hidden;
}
.bem-qcm-score-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.1); pointer-events: none;
}
.bem-qcm-score-card--green  { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 32px rgba(16,185,129,.3); }
.bem-qcm-score-card--blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 8px 32px rgba(59,130,246,.3); }
.bem-qcm-score-card--orange { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 32px rgba(245,158,11,.3); }
.bem-qcm-score-card--red    { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 8px 32px rgba(239,68,68,.3); }

.bem-qcm-score-icon  { font-size: 60px; margin-bottom: 12px; position: relative; }
.bem-qcm-score-num   { font-size: 52px; font-weight: 900; margin-bottom: 8px; position: relative; }
.bem-qcm-score-label { font-size: 18px; opacity: .92; position: relative; font-weight: 600; }
.bem-qcm-readiness-badge {
  display: inline-block; margin-top: 14px; padding: 7px 22px;
  background: rgba(255,255,255,.22); border-radius: 20px;
  font-size: 16px; font-weight: 800; position: relative;
}

/* Lesson Recommendations */
.bem-qcm-recommendations {
  background: #eff6ff; border-radius: 14px; padding: 22px 26px;
  margin-bottom: 22px; border-right: 5px solid #3b82f6;
}
.bem-qcm-recommendations-title {
  font-size: 16px; font-weight: 800; color: #1e40af; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.bem-qcm-recommendations-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
}
.bem-qcm-recommendation-item {
  font-size: 14px; color: #1e3a5f; padding: 10px 14px;
  background: rgba(255,255,255,.7); border-radius: 8px; line-height: 1.5;
  border: 1px solid rgba(59,130,246,.2);
}

/* Result question cards */
.bem-qcm-result-card {
  background: #fff; border-radius: 14px; padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 14px;
  border-right: 5px solid transparent; border: 1px solid #e2e8f0;
  border-right-width: 5px;
}
.bem-qcm-result-card--correct { border-right-color: #10b981; }
.bem-qcm-result-card--wrong   { border-right-color: #ef4444; }

.bem-qcm-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.bem-qcm-result-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 700;
}
.bem-qcm-result-status--correct { background: #d1fae5; color: #065f46; }
.bem-qcm-result-status--wrong   { background: #fee2e2; color: #991b1b; }
.bem-qcm-result-question { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 16px; line-height: 1.7; }
.bem-qcm-result-options  { display: grid; gap: 8px; margin-bottom: 16px; }
.bem-qcm-result-option {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 10px; font-size: 14px;
  border: 1px solid #e2e8f0;
}
.bem-qcm-result-option--correct { background: #d1fae5; border-color: #10b981; }
.bem-qcm-result-option--wrong   { background: #fee2e2; border-color: #ef4444; }
.bem-qcm-result-option--neutral { background: #f8fafc; }

.bem-qcm-explanation {
  background: #eff6ff; border-right: 4px solid #3b82f6;
  padding: 12px 16px; border-radius: 8px; font-size: 14px;
  color: #1e40af; line-height: 1.7; font-weight: 500;
}

/* Results actions */
.bem-qcm-results-actions {
  display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap;
}

/* ─── Readiness System ───────────────────────────────────────── */
.bem-readiness-bar-wrap {
  height: 9px; background: #e2e8f0; border-radius: 5px; overflow: hidden;
  flex: 1; min-width: 80px;
}
.bem-readiness-bar-wrap--lg { height: 13px; border-radius: 7px; }
.bem-readiness-bar-fill     { height: 100%; border-radius: 5px; transition: width .5s ease; }
.bem-readiness-bar--red     { background: linear-gradient(90deg, #ef4444, #dc2626); }
.bem-readiness-bar--orange  { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bem-readiness-bar--blue    { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.bem-readiness-bar--green   { background: linear-gradient(90deg, #10b981, #059669); }

.bem-readiness-pct { font-size: 12px; font-weight: 800; white-space: nowrap; }
.bem-readiness-pct--red    { color: #dc2626; }
.bem-readiness-pct--orange { color: #d97706; }
.bem-readiness-pct--blue   { color: #2563eb; }
.bem-readiness-pct--green  { color: #059669; }

.bem-readiness-level { font-size: 14px; font-weight: 800; white-space: nowrap; }
.bem-readiness-level--red    { color: #dc2626; }
.bem-readiness-level--orange { color: #d97706; }
.bem-readiness-level--blue   { color: #2563eb; }
.bem-readiness-level--green  { color: #059669; }

.bem-readiness-mini  { display: flex; align-items: center; gap: 8px; }
.bem-readiness-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.bem-readiness-badge--new { background: #fef3c7; color: #92400e; }

/* ─── Test Section (اختبر نفسك) ─────────────────────────────── */
.bem-test-header {
  text-align: center; padding: 36px 24px; margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(124,58,237,.07), rgba(91,33,182,.07));
  border-radius: 18px; border: 2px solid rgba(124,58,237,.12);
}
.bem-test-header-icon  { font-size: 52px; margin-bottom: 10px; }
.bem-test-header-title { font-size: 26px; font-weight: 900; color: #1e293b; margin: 0 0 10px; }
.bem-test-header-desc  { font-size: 15px; color: #64748b; margin: 0; line-height: 1.7; }

.bem-test-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.bem-test-subject-card {
  background: #fff; border-radius: 16px; padding: 26px; text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.07); border: 2px solid transparent;
  cursor: pointer; transition: all .22s;
}
.bem-test-subject-card:hover {
  border-color: #7c3aed; transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(124,58,237,.15);
}
.bem-test-subject-icon     { font-size: 40px; margin-bottom: 10px; }
.bem-test-subject-name     { font-size: 17px; font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.bem-test-subject-fr       { font-size: 13px; color: #64748b; margin-bottom: 14px; }
.bem-test-subject-readiness { margin-top: 14px; }
.bem-test-subject-stat     { font-size: 12px; color: #94a3b8; margin-top: 8px; }

/* Test units list */
.bem-test-units-list { display: grid; gap: 12px; }
.bem-test-unit-card {
  background: #fff; border-radius: 14px; padding: 20px 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px solid #e2e8f0; transition: box-shadow .2s;
}
.bem-test-unit-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.bem-test-unit-info       { flex: 1; min-width: 150px; }
.bem-test-unit-name       { font-size: 15px; font-weight: 700; color: #1e293b; }
.bem-test-unit-fr         { font-size: 13px; color: #64748b; margin-top: 2px; }
.bem-test-unit-readiness  { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px; }

.bem-test-start-btn {
  padding: 10px 22px; border-radius: 10px; border: none; cursor: pointer;
  font-family: var(--bem-font, 'Tajawal', sans-serif);
  font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff;
  transition: all .2s; white-space: nowrap; min-height: 44px;
  box-shadow: 0 3px 10px rgba(124,58,237,.25);
}
.bem-test-start-btn:hover { opacity: .9; transform: translateY(-1px); }

.bem-test-overall {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07); margin-bottom: 22px;
  border: 1px solid #e2e8f0;
}
.bem-test-overall-label { font-size: 15px; font-weight: 700; color: #374151; margin-bottom: 12px; }
.bem-test-overall-bar   { display: flex; align-items: center; gap: 14px; }
.bem-test-overall-stat  { font-size: 13px; color: #94a3b8; margin-top: 8px; }

/* ─── History View ───────────────────────────────────────────── */
.bem-qcm-history { margin-top: 16px; display: grid; gap: 8px; }
.bem-qcm-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: #fff; border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); font-size: 14px;
  border: 1px solid #e2e8f0;
}
.bem-qcm-history-score { font-weight: 800; }
.bem-qcm-history-date  { color: #64748b; font-size: 13px; }

/* ─── Empty State ────────────────────────────────────────────── */
.bem-qcm-empty {
  text-align: center; padding: 52px 24px; background: #fff;
  border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.07);
  border: 1px solid #e2e8f0;
}
.bem-qcm-empty-icon { font-size: 60px; margin-bottom: 16px; opacity: .35; }
.bem-qcm-empty-text { font-size: 16px; color: #64748b; font-weight: 500; }

/* ─── Confirm Modal ──────────────────────────────────────────── */
.bem-qcm-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px; backdrop-filter: blur(4px);
}
.bem-qcm-modal {
  background: #fff; border-radius: 20px; padding: 36px;
  max-width: 440px; width: 100%; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.25); animation: bemFadeIn .25s ease;
}
.bem-qcm-modal-icon    { font-size: 52px; margin-bottom: 16px; }
.bem-qcm-modal-title   { font-size: 20px; font-weight: 800; color: #1e293b; margin-bottom: 12px; }
.bem-qcm-modal-text    { font-size: 15px; color: #64748b; margin-bottom: 26px; line-height: 1.7; }
.bem-qcm-modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes bemQcmPulse { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
@keyframes bemFadeIn   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .bem-qcm-header       { padding: 16px 18px; }
  .bem-qcm-question-card { padding: 22px 18px; }
  .bem-qcm-score-card   { padding: 28px 20px; }
  .bem-qcm-score-num    { font-size: 40px; }
  .bem-qcm-nav          { flex-direction: column; }
  .bem-qcm-nav-btn      { width: 100%; justify-content: center; }
  .bem-test-grid        { grid-template-columns: 1fr 1fr; }
  .bem-test-unit-card   { flex-direction: column; align-items: stretch; text-align: center; }
  .bem-test-unit-readiness { justify-content: center; }
  .bem-qcm-results-actions { flex-direction: column; }
  .bem-qcm-results-actions .bem-btn,
  .bem-qcm-results-actions .bem-qcm-nav-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .bem-test-grid { grid-template-columns: 1fr; }
  .bem-qcm-modal { padding: 28px 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — QCM (html.bem-dark)
   ═══════════════════════════════════════════════════════════════ */
.bem-dark .bem-qcm-card {
  background: #1a1230; border-color: #2d2250;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.bem-dark .bem-qcm-card:hover { border-color: #f59e0b; box-shadow: 0 6px 24px rgba(245,158,11,.2); }
.bem-dark .bem-qcm-card-title  { color: #e2e8f0; }
.bem-dark .bem-qcm-card-meta,
.bem-dark .bem-qcm-card-desc,
.bem-dark .bem-qcm-last-result { color: #94a3b8; }
.bem-dark .bem-qcm-badge--new  { background: #451a03; color: #fbbf24; }
.bem-dark .bem-qcm-badge--done { background: #052e26; color: #34d399; }

.bem-dark .bem-qcm-progress-bar { background: #2d2250; }

.bem-dark .bem-qcm-question-card {
  background: #1a1230; border-color: #2d2250;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.bem-dark .bem-qcm-question-text { color: #e2e8f0; }

.bem-dark .bem-qcm-option {
  background: #16102a; border-color: #2d2250; color: #e2e8f0;
}
.bem-dark .bem-qcm-option:hover  { border-color: #f59e0b; background: #2a1a05; }
.bem-dark .bem-qcm-option.selected { border-color: #f59e0b; background: #2a1a05; }
.bem-dark .bem-qcm-option-letter { background: #2d2250; color: #94a3b8; }
.bem-dark .bem-qcm-option.selected .bem-qcm-option-letter { background: #f59e0b; color: #fff; }
.bem-dark .bem-qcm-option-text   { color: #cbd5e1; }

/* Results */
.bem-dark .bem-qcm-score-card { background: #1a1230; border-color: #2d2250; }
.bem-dark .bem-qcm-score-label { color: #94a3b8; }
.bem-dark .bem-qcm-results-list { background: #16102a; }
.bem-dark .bem-qcm-result-item  { border-bottom-color: #2d2250; }
.bem-dark .bem-qcm-result-q     { color: #e2e8f0; }

/* Modal */
.bem-dark .bem-qcm-modal-overlay { background: rgba(0,0,0,.7); }
.bem-dark .bem-qcm-modal { background: #1a1230; border-color: #2d2250; }
.bem-dark .bem-qcm-modal h3 { color: #e2e8f0; }
.bem-dark .bem-qcm-modal p  { color: #94a3b8; }

/* Test grid */
.bem-dark .bem-test-unit-card { background: #1a1230; border-color: #2d2250; }
.bem-dark .bem-test-unit-card:hover { border-color: #7c3aed; }
.bem-dark .bem-test-unit-title { color: #e2e8f0; }
.bem-dark .bem-test-unit-meta  { color: #94a3b8; }
