/* ============================================================
   MIKA Academy v71 — Subject Renderer Styles
   Rich lesson cards, unit blocks, quiz UI
   ============================================================ */

/* ── Subject Header ─────────────────────────────────────────── */
.k12sr-subject-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 18px;
  border-radius: 18px;
  margin-bottom: 20px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}

.k12sr-subject-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.k12sr-header-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.k12sr-header-info { flex: 1; min-width: 0; }

.k12sr-header-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.k12sr-header-sub {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.88;
}

.k12sr-header-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.k12sr-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 44px;
}

.k12sr-stat-num {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}

.k12sr-stat-lbl {
  font-size: 0.65rem;
  opacity: 0.9;
  margin-top: 2px;
}

/* ── Units List ─────────────────────────────────────────────── */
.k12sr-units-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Unit Block ─────────────────────────────────────────────── */
.k12sr-unit-block {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
  border: 1px solid #f0f0f5;
}

.k12sr-unit-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #f8f9ff 0%, #eef0ff 100%);
  border-bottom: 2px solid #e8eaf6;
}

.k12sr-unit-num-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 2px 6px rgba(102,126,234,0.4);
}

.k12sr-unit-meta { flex: 1; min-width: 0; }

.k12sr-unit-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.4;
}

.k12sr-unit-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.k12sr-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.k12sr-pill-blue { background: #e3f2fd; color: #1565c0; }
.k12sr-pill-green { background: #e8f5e9; color: #2e7d32; }

/* ── Lessons Grid ───────────────────────────────────────────── */
.k12sr-lessons-grid {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Lesson Card ────────────────────────────────────────────── */
.k12sr-lesson-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fafbff;
  border: 1px solid #eef0f8;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.k12sr-lesson-card:hover {
  background: #f0f4ff;
  border-color: #c5cae9;
  transform: translateX(-2px);
  box-shadow: 0 3px 10px rgba(102,126,234,0.12);
}

[dir="ltr"] .k12sr-lesson-card:hover {
  transform: translateX(2px);
}

.k12sr-lesson-icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.k12sr-lesson-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #e8eaf6, #c5cae9);
  border-radius: 12px;
  font-size: 1.3rem;
}

.k12sr-lesson-num {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #667eea;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}

[dir="ltr"] .k12sr-lesson-num { right: auto; left: -4px; }

.k12sr-lesson-body { flex: 1; min-width: 0; }

.k12sr-lesson-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.4;
  margin-bottom: 3px;
  display: block;
}

.k12sr-lesson-obj {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.k12sr-lesson-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.k12sr-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.k12sr-badge-quiz    { background: #fff3e0; color: #e65100; }
.k12sr-badge-screen  { background: #e8f5e9; color: #2e7d32; }
.k12sr-badge-example { background: #fff9c4; color: #f57f17; }
.k12sr-badge-read    { background: #e3f2fd; color: #1565c0; }

.k12sr-lesson-arrow {
  color: #9e9e9e;
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.k12sr-lesson-card:hover .k12sr-lesson-arrow {
  color: #667eea;
  transform: translateX(-3px);
}

[dir="ltr"] .k12sr-lesson-card:hover .k12sr-lesson-arrow {
  transform: translateX(3px);
}

/* ── Lesson Page Header ─────────────────────────────────────── */
.k12sr-lesson-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.k12sr-lh-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.k12sr-lh-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.3;
}

.k12sr-lh-unit {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

/* ── Objectives ─────────────────────────────────────────────── */
.k12sr-objectives {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1px solid #c8e6c9;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.k12sr-obj-title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #2e7d32;
}

.k12sr-obj-list {
  margin: 0;
  padding-right: 18px;
  padding-left: 0;
}

[dir="ltr"] .k12sr-obj-list { padding-left: 18px; padding-right: 0; }

.k12sr-obj-list li {
  font-size: 0.82rem;
  color: #1b5e20;
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ── Section Titles ─────────────────────────────────────────── */
.k12sr-section-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Content Body ───────────────────────────────────────────── */
.k12sr-content-body {
  background: #fff;
  border: 1px solid #e8eaf6;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.k12sr-content-text {
  font-size: 0.88rem;
  color: #2c2c3e;
  line-height: 1.8;
}

.k12sr-content-text p {
  margin: 0 0 12px;
}

.k12sr-content-text p:last-child { margin-bottom: 0; }

/* ── Screens ────────────────────────────────────────────────── */
.k12sr-screens {
  background: #fff;
  border: 1px solid #e8eaf6;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.k12sr-screen-card {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: #f8f9ff;
  border-radius: 10px;
  margin-bottom: 8px;
  border-right: 3px solid #667eea;
}

[dir="ltr"] .k12sr-screen-card { border-right: none; border-left: 3px solid #667eea; }

.k12sr-screen-num {
  width: 24px;
  height: 24px;
  background: #667eea;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.k12sr-screen-content {
  font-size: 0.82rem;
  color: #2c2c3e;
  line-height: 1.6;
}

.k12sr-screen-content strong {
  display: block;
  margin-bottom: 4px;
  color: #1a1a2e;
}

/* ── Examples ───────────────────────────────────────────────── */
.k12sr-examples {
  background: #fff;
  border: 1px solid #e8eaf6;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.k12sr-example-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #fffde7;
  border-radius: 10px;
  margin-bottom: 8px;
  border-right: 3px solid #ffd600;
  font-size: 0.84rem;
  color: #2c2c3e;
  line-height: 1.6;
}

[dir="ltr"] .k12sr-example-card { border-right: none; border-left: 3px solid #ffd600; }

.k12sr-example-num {
  width: 22px;
  height: 22px;
  background: #ffd600;
  color: #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.k12sr-example-answer {
  margin-top: 6px;
  padding: 4px 8px;
  background: #e8f5e9;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #2e7d32;
}

/* ── Quiz Section ───────────────────────────────────────────── */
.k12sr-quiz-section {
  background: #fff;
  border: 1px solid #e8eaf6;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.k12sr-q-card {
  background: #f8f9ff;
  border: 1px solid #e8eaf6;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.k12sr-q-text {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: #1a1a2e;
  line-height: 1.6;
  font-weight: 600;
}

.k12sr-q-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.k12sr-q-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  text-align: right;
  font-size: 0.84rem;
  color: #2c2c3e;
  transition: all 0.18s ease;
  width: 100%;
  font-family: inherit;
}

[dir="ltr"] .k12sr-q-opt { text-align: left; }

.k12sr-q-opt:hover:not(:disabled) {
  background: #f0f4ff;
  border-color: #667eea;
  color: #1a1a2e;
}

.k12sr-opt-letter {
  width: 24px;
  height: 24px;
  background: #e8eaf6;
  color: #667eea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.k12sr-opt-text { flex: 1; line-height: 1.4; }

.k12sr-q-opt.k12sr-opt-correct {
  background: #e8f5e9 !important;
  border-color: #4caf50 !important;
  color: #1b5e20 !important;
}

.k12sr-q-opt.k12sr-opt-correct .k12sr-opt-letter {
  background: #4caf50;
  color: #fff;
}

.k12sr-q-opt.k12sr-opt-wrong {
  background: #ffebee !important;
  border-color: #f44336 !important;
  color: #b71c1c !important;
}

.k12sr-q-opt.k12sr-opt-wrong .k12sr-opt-letter {
  background: #f44336;
  color: #fff;
}

.k12sr-q-feedback {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.k12sr-fb-correct {
  background: #e8f5e9;
  color: #2e7d32;
  border-right: 3px solid #4caf50;
  padding: 6px 10px;
  border-radius: 6px;
}

[dir="ltr"] .k12sr-fb-correct { border-right: none; border-left: 3px solid #4caf50; }

.k12sr-fb-wrong {
  background: #ffebee;
  color: #c62828;
  border-right: 3px solid #f44336;
  padding: 6px 10px;
  border-radius: 6px;
}

[dir="ltr"] .k12sr-fb-wrong { border-right: none; border-left: 3px solid #f44336; }

/* ── Ask AI Button ──────────────────────────────────────────── */
.k12sr-ask-ai {
  text-align: center;
  margin: 16px 0 8px;
}

.k12sr-ask-ai-btn {
  background: linear-gradient(135deg, #FF8C42, #e67e22);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,140,66,0.4);
  transition: all 0.2s ease;
  font-family: inherit;
}

.k12sr-ask-ai-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255,140,66,0.5);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .k12sr-header-stats { display: none; }
  .k12sr-subject-header { gap: 12px; padding: 16px; }
  .k12sr-header-icon { font-size: 2.2rem; }
  .k12sr-header-title { font-size: 1rem; }
  .k12sr-lesson-card { padding: 10px 12px; }
  .k12sr-lesson-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .k12sr-lesson-icon-wrap { width: 38px; height: 38px; }
}
