/* =======================
 * Main MCQ card shell
 * ======================= */

.er-mcq-main {
  border-radius: 0 !important;
  border: 1px solid #e9ecef;
  border-left: 3px solid #6366f1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
  background-color: #ffffff;
  transition: box-shadow 0.2s ease, border-left-color 0.2s ease;
}

.er-mcq-main:focus-within {
  border-left-color: #4f46e5;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12), 0 2px 6px rgba(15, 23, 42, 0.1);
}

/* Override Bootstrap card border-radius - multiple selectors for specificity */
.er-mcq-main.card,
.card.er-mcq-main,
.mcq-question.er-mcq-main,
.mcq-question.er-mcq-main.card,
article.er-mcq-main.card {
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
  -moz-border-radius: 0 !important;
}

.er-mcq-main-body {
  /* just a wrapper for padding/layout */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header chips */

.er-mcq-main-header {
  font-size: 0.78rem;
  color: #868e96;
}

.er-mcq-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  background-color: #f1f3f5;
  color: #495057;
  min-height: 1.75rem;
  /* Ensure consistent height */
}

.er-mcq-chip-muted {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
  border: none;
  padding: 0.1rem 0.65rem;
  /* Explicit padding to match */
  min-height: 1.75rem;
}

.er-mcq-chip-subject {
  background-color: #e7f5ff;
  color: #1c7ed6;
  font-weight: 600;
  border: none;
  padding: 0.1rem 0.65rem;
  /* Match the muted chip padding */
  min-height: 1.75rem;
  /* Same height as muted chip */
}

/* Verification badges */
.er-mcq-chip-official {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
  font-weight: 600;
  border: 1px solid #6ee7b7;
  padding: 0.15rem 0.65rem;
  min-height: 1.75rem;
  gap: 0.35rem;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.er-mcq-chip-verified {
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  color: #0d9488;
  font-weight: 600;
  border: 1px solid #5eead4;
  padding: 0.15rem 0.65rem;
  min-height: 1.75rem;
  gap: 0.35rem;
  box-shadow: 0 1px 3px rgba(20, 184, 166, 0.15);
}

.er-mcq-badge-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Question text */

.er-mcq-question-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #1a1d29;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  white-space: pre-line;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* =======================
 * Options – vertical cards
 * ======================= */

.er-mcq-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.er-mcq-option {
  position: relative;
}

.er-mcq-option-label {
  border-radius: 0.75rem;
  border: 1.5px solid #e9ecef;
  background-color: #ffffff;
  padding: 0.65rem 0.85rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s ease,
    transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.er-mcq-option-label::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}

.er-mcq-option-label:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  background-color: #fafbff;
}

.er-mcq-option-label:hover::before {
  left: 100%;
}

.er-mcq-option-label:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.er-mcq-option-letter {
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1.5px solid #ced4da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #495057;
  background-color: #f8f9fa;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.er-mcq-option-text {
  font-size: 0.92rem;
  color: #212529;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

/* Selected (before check) */

.er-mcq-option-selected .er-mcq-option-label {
  border-color: #6366f1;
  background-color: #eef2ff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2), inset 0 0 0 1px rgba(99, 102, 241, 0.1);
  transform: scale(1.01);
}

.er-mcq-option-selected .er-mcq-option-letter {
  border-color: #4dabf7;
  background-color: #d0ebff;
  color: #1c7ed6;
}

/* ======================================
 * After "Check answer" – grading colours
 * ======================================
 * Match sidebar colours but keep the text
 * sitting "on top" of the coloured shade.
 */

/* CORRECT state */
.er-mcq-option-label.text-success,
.er-mcq-option.text-success .er-mcq-option-label,
.er-mcq-option-label.bg-success-subtle,
.er-mcq-option.bg-success-subtle .er-mcq-option-label {
  border-color: var(--er-mcq-correct-border) !important;
  background-color: var(--er-mcq-correct-bg) !important;
  /* keep option text dark so it feels above the shade */
  color: #212529 !important;
}

/* INCORRECT state */
.er-mcq-option-label.text-danger,
.er-mcq-option.text-danger .er-mcq-option-label,
.er-mcq-option-label.bg-danger-subtle,
.er-mcq-option.bg-danger-subtle .er-mcq-option-label {
  border-color: var(--er-mcq-incorrect-border) !important;
  background-color: var(--er-mcq-incorrect-bg) !important;
  color: #212529 !important;
}

/* Make sure inner text visually sits above the coloured card */
.er-mcq-option-label .er-mcq-option-text {
  position: relative;
  z-index: 1;
}

/* A/B/C/D bubble – ring uses status colour, inside stays light */
.er-mcq-option-label.text-success .er-mcq-option-letter,
.er-mcq-option.text-success .er-mcq-option-letter,
.er-mcq-option-label.bg-success-subtle .er-mcq-option-letter,
.er-mcq-option.bg-success-subtle .er-mcq-option-letter {
  border-color: var(--er-mcq-correct-border) !important;
  background-color: #ffffff !important;
  color: var(--er-mcq-correct-text) !important;
}

.er-mcq-option-label.text-danger .er-mcq-option-letter,
.er-mcq-option.text-danger .er-mcq-option-letter,
.er-mcq-option-label.bg-danger-subtle .er-mcq-option-letter,
.er-mcq-option.bg-danger-subtle .er-mcq-option-letter {
  border-color: var(--er-mcq-incorrect-border) !important;
  background-color: #ffffff !important;
  color: var(--er-mcq-incorrect-text) !important;
}

/* Check answer button & feedback */

.er-mcq-main .er-mcq-check-btn {
  margin-top: 0.75rem;
  margin-left: 0;
  margin-right: 0;
  font-size: 0.9rem;
  font-weight: 600;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  display: block;
}

.er-mcq-main .er-mcq-check-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.er-mcq-main .er-mcq-check-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.er-mcq-main [data-answer-box] {
  border: 0;
  padding: 0.5rem 0.9rem;
  margin-top: 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.er-mcq-main [data-answer-box].alert-success {
  background-color: #d8f5e3;
  color: #2f9e44;
}

.er-mcq-main [data-answer-box].alert-danger {
  background-color: #ffe3e3;
  color: #c92a2a;
}

.er-mcq-main [data-answer-box].alert-secondary {
  background-color: #f1f3f5;
  color: #495057;
}

/* Mobile tweaks */

@media (max-width: 576px) {
  .er-mcq-main-body {
    padding: 0.9rem 0.9rem 1.1rem;
  }
}

/* Prevent Bootstrap from fading out main MCQ options when disabled */
.er-mcq-main .form-check-input[disabled]~.form-check-label,
.er-mcq-main .form-check-input:disabled~.form-check-label {
  opacity: 1 !important;
  cursor: default;
  /* keep pointer behaviour sane */
}