/* MMM Study — Quiz & Practice Screen Stylesheet */
@import "../design_system.css";

/* Back / Exit Practice Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  transition: all 0.18s ease;
}

.back-link:hover {
  color: var(--brand-navy-900);
  border-color: var(--brand-gold);
  background: var(--surface-subtle);
}

/* Panel intro variants for question types */
.panel-intro.mcq-panel {
  border-left: 4px solid var(--brand-gold);
}

.panel-intro.tf-panel {
  border-left: 4px solid var(--accent-green);
}

.panel-intro.blank-panel {
  border-left: 4px solid var(--accent-amber);
}

/* Exam navigation buttons when in Exam Mode */
.exam-progress {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.exam-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.exam-btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Poppins', 'Inter', sans-serif;
  border: 1.5px solid var(--border-color);
  background: var(--surface-card);
  color: var(--brand-navy-900);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.exam-btn:hover:not(:disabled) {
  border-color: var(--brand-gold);
  background: var(--surface-subtle);
  transform: translateY(-1px);
}

.exam-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.exam-btn-primary, .submit-exam-btn {
  background: var(--brand-navy-gradient);
  color: #FFFFFF;
  border-color: var(--brand-gold-border);
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(11, 30, 54, 0.2);
}

.exam-btn-primary:hover:not(:disabled), .submit-exam-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(197, 155, 39, 0.35);
  color: #FFFFFF;
}

/* Question Marks Badge */
.q-marks-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--brand-gold-soft);
  color: #78350F;
  border: 1px solid var(--brand-gold-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
}

/* Question Diagram / Image */
.quiz-question-img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 12px 0;
  display: block;
  background: #FFF;
}

/* Scratchpad / Working Notes */
.quiz-scratchpad-wrap {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-scratchpad-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.quiz-scratchpad-input {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  background: var(--surface-card);
  color: var(--text-primary);
  resize: vertical;
  box-sizing: border-box;
}

.quiz-scratchpad-input:focus {
  border-color: var(--brand-gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

/* Solution Reveal Toggle and Container */
.solution-reveal-wrap {
  margin-top: 14px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.btn-reveal-solution {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #334155;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.btn-reveal-solution:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

.solution-box {
  margin-top: 12px;
  padding: 14px 16px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
  color: #14532D;
}

.solution-title {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.solution-text {
  font-size: 14px;
  line-height: 1.6;
  color: #14532D;
  white-space: pre-wrap;
}

.solution-diagram-img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid #86EFAC;
  margin-top: 10px;
  display: block;
  background: #FFF;
}

.guidance-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #92400E;
}



/* ========================================================================= */
/* Academic Design Refinements & KaTeX Formula Overflow Protection (Phase 3.3) */
/* ========================================================================= */

.katex-display {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 6px 0 !important;
  margin: 8px 0 !important;
  max-width: 100% !important;
  -webkit-overflow-scrolling: touch;
}

.quiz-card {
  background: var(--surface-card, #FFFFFF);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.quiz-card:focus-within {
  border-color: var(--brand-navy-900, #0B1E36);
}

.submit-btn {
  background: var(--brand-navy-900, #0B1E36);
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.submit-btn:hover:not(:disabled) {
  background: #1E3A8A;
  box-shadow: 0 4px 12px rgba(11, 30, 54, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
