/* Mentor TERU - Quiz Mode Styles */

/* ========== Mentor Screen ========== */
#mentor .header h1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mentor-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  gap: 30px;
}

.mentor-logo {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mentor-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.btn-large {
  padding: 16px 24px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  /* Mobile-friendly tap target */
  min-height: 52px;
  padding: 14px 24px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  /* Mobile-friendly tap target */
  min-height: 52px;
  padding: 14px 24px;
  font-size: 16px;
  border-radius: 12px;
  font-weight: 600;
}

.btn-secondary:active {
  transform: scale(0.97);
}

.summary-actions,
.dashboard-actions {
  gap: 12px;
}

/* ========== Stats Grid ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.stat-num.highlight {
  color: #667eea;
}

/* ========== Flashcards ========== */
.flashcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  margin: 16px 0;
  padding: 24px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.flashcard.flipped {
  border-color: #667eea;
}

.flashcard-hint {
  font-size: 12px;
  color: var(--text2);
}

.flashcard-term {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.flashcard-term.small {
  font-size: 17px;
  color: #667eea;
}

.flashcard-category {
  font-size: 12px;
  color: var(--text2);
}

.flashcard-meaning {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  text-align: left;
}

.flashcard-grade-label {
  text-align: center;
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 8px;
}

.summary-note {
  font-size: 12px;
  color: var(--text2);
  text-align: center;
  margin: 12px 0;
}

.mentor-buttons .flashcard-btn {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
}

/* ========== Quiz Mix Note ========== */
.mentor-mix-note {
  width: 100%;
  max-width: 360px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text);
}

.mentor-mix-note .mix-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #667eea;
}

.mentor-mix-note .mix-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
  opacity: 0.85;
}

.mentor-mix-note .mix-pct {
  font-weight: 700;
  min-width: 34px;
  color: #667eea;
}

.stat-desc {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
}

/* ========== Quiz Area ========== */
.quiz-progress {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
}

.quiz-term {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.08);
  border-radius: 8px;
}

.quiz-statement {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
}

.quiz-statement p {
  margin: 8px 0 0 0;
  font-size: 15px;
  line-height: 1.6;
}

.quiz-source {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.quiz-source.past {
  background: #e3f2fd;
  color: #1565c0;
}

.quiz-source.llm {
  background: #f3e5f5;
  color: #7b1fa2;
}

.quiz-ref {
  font-size: 11px;
  color: var(--text2);
  margin-top: 8px;
}

/* ========== CBM Buttons ========== */
.quiz-cbm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 4px;
}

.cbm-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbm-btn {
  padding: 14px 12px;
  border-radius: 10px;
  border: 2px solid;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-align: center;
}

.cbm-btn:active {
  transform: scale(0.95);
}

/* True (O) buttons */
.cbm-true .cbm-btn.certain {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

.cbm-true .cbm-btn.maybe {
  background: #f1f8e9;
  border-color: #8bc34a;
  color: #558b2f;
}

.cbm-true .cbm-btn.guess {
  background: #f9fbe7;
  border-color: #cddc39;
  color: #827717;
}

/* False (X) buttons */
.cbm-false .cbm-btn.certain {
  background: #ffebee;
  border-color: #f44336;
  color: #c62828;
}

.cbm-false .cbm-btn.maybe {
  background: #fce4ec;
  border-color: #e91e63;
  color: #ad1457;
}

.cbm-false .cbm-btn.guess {
  background: #fff3e0;
  border-color: #ff9800;
  color: #e65100;
}

/* ========== Feedback ========== */
.quiz-feedback {
  text-align: center;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.quiz-feedback.feedback-correct {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.quiz-feedback.feedback-wrong {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.feedback-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.feedback-correct .feedback-icon { color: #4caf50; }
.feedback-wrong .feedback-icon { color: #f44336; }

.feedback-text {
  font-size: 18px;
  font-weight: 700;
}

.feedback-score {
  font-size: 24px;
  font-weight: 700;
  margin-top: 8px;
}

.score-positive { color: #4caf50; }
.score-negative { color: #f44336; }

.quiz-answer-detail {
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.answer-correct {
  font-weight: 700;
  margin-bottom: 8px;
}

.answer-term {
  font-size: 13px;
  color: #667eea;
  margin-bottom: 4px;
}

.answer-statement {
  font-size: 14px;
  line-height: 1.5;
}

.answer-explanation {
  margin-top: 12px;
  padding: 12px;
  background: #667eea18;
  border-left: 3px solid #667eea;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}

.tts-replay-btn {
  display: block;
  margin: 12px auto 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 18px;
  cursor: pointer;
}

.btn-next {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== Session Summary ========== */
.session-summary {
  text-align: center;
  padding: 20px;
}

.session-summary h2 {
  margin-bottom: 20px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.summary-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
}

.stat-label {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ========== Dashboard ========== */
.dashboard {
  padding: 16px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.overall-score {
  font-size: 32px;
  font-weight: 700;
}

.overall-score.good { color: #4caf50; }
.overall-score.mid { color: #ff9800; }
.overall-score.weak { color: #f44336; }

.exam-scores {
  margin-bottom: 20px;
}

.exam-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.exam-label {
  width: 36px;
  font-size: 12px;
  font-weight: 600;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.score-fill.good { background: #4caf50; }
.score-fill.mid { background: #ff9800; }
.score-fill.weak { background: #f44336; }

.score-pct {
  width: 36px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.weak-list {
  margin-bottom: 20px;
}

.weak-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin-bottom: 6px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.weak-cat {
  font-size: 13px;
  font-weight: 600;
}

.weak-exam {
  font-size: 11px;
  color: var(--text2);
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.weak-score {
  margin-left: auto;
  font-weight: 700;
  color: #f44336;
}

.prereq-hint {
  width: 100%;
  font-size: 11px;
  color: #667eea;
  padding-top: 4px;
}

.dashboard-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ========== Messages ========== */
.mentor-message {
  text-align: center;
  padding: 40px 20px;
}

.mentor-message .message-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.mentor-message h3 {
  margin-bottom: 12px;
}

.mentor-message p {
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 20px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text2);
}

/* ========== Mentor Button on Home ========== */
.mentor-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: transform 0.2s;
}

.mentor-fab:active {
  transform: scale(0.9);
}

.mentor-fab .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #f44336;
  color: white;
  font-size: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Explain Mode ========== */
.mentor-buttons .explain-btn {
  background: linear-gradient(135deg, #fb8c00 0%, #ef6c00 100%);
}

.mentor-buttons .drill-btn {
  background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
}

.explain-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 16px;
  text-align: center;
}

.explain-input {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
  box-sizing: border-box;
}

.explain-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}

.explain-score {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
}

.explain-score.good { color: #4caf50; }
.explain-score.mid { color: #ff9800; }
.explain-score.weak { color: #f44336; }

.explain-score-unit {
  font-size: 20px;
  margin-left: 2px;
}

.explain-feedback {
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0;
  text-align: left;
}

.explain-model {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
  text-align: left;
}

.explain-model-label {
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 6px;
}

.explain-model-text {
  font-size: 14px;
  line-height: 1.7;
}

/* ========== Calculation Drill ========== */
.drill-topic {
  font-size: 13px;
  font-weight: 600;
  color: #00897b;
  margin-bottom: 8px;
}

.drill-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.drill-choice {
  min-height: 52px;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s;
}

.drill-choice:active {
  transform: scale(0.97);
}

/* ========== Memorization Stage (dashboard) ========== */
.stage-section {
  margin-bottom: 20px;
}

.stage-section h3 {
  margin-bottom: 10px;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stage-lv {
  width: 34px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
  color: white;
}

.stage-lv1 { background: #90a4ae; }
.stage-lv2 { background: #42a5f5; }
.stage-lv3 { background: #66bb6a; }
.stage-lv4 { background: #ab47bc; }

.stage-label {
  width: 132px;
  font-size: 11px;
  color: var(--text2);
}

.stage-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.stage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.stage-fill1 { background: #90a4ae; }
.stage-fill2 { background: #42a5f5; }
.stage-fill3 { background: #66bb6a; }
.stage-fill4 { background: #ab47bc; }

.stage-count {
  width: 32px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.stage-hint {
  font-size: 11px;
  color: var(--text2);
  margin-top: 6px;
  line-height: 1.6;
}
