/* ════════════════════════════════════════════════
   SPARQ by iDoTrick - Styles
   ════════════════════════════════════════════════ */

/* CSS VARIABLES */
:root {
  --orange-main: #f97316;
  --orange-warm: #fb923c;
  --orange-gold: #fbbf24;
  --orange-light: #fff7ed;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --success: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
  --subj-deep: #0d3280;
  --subj-main: #1a56db;
  --subj-mid: #2970ff;
  --subj-light: #e8f0fe;
  --subj-shadow: rgba(26, 86, 219, 0.12);
}

/* SUBJECT THEMES */
body[data-subject="ict"] {
  --subj-deep: #0d3280;
  --subj-main: #1a56db;
  --subj-mid: #2970ff;
  --subj-light: #e8f0fe;
  --subj-shadow: rgba(26, 86, 219, 0.12);
}

body[data-subject="maths"] {
  --subj-deep: #3b0764;
  --subj-main: #7c3aed;
  --subj-mid: #8b5cf6;
  --subj-light: #f5f3ff;
  --subj-shadow: rgba(124, 58, 237, 0.12);
}

body[data-subject="science"] {
  --subj-deep: #064e3b;
  --subj-main: #059669;
  --subj-mid: #10b981;
  --subj-light: #ecfdf5;
  --subj-shadow: rgba(5, 150, 105, 0.12);
}

/* RESET & BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  overflow-x: hidden;
}

/* HEADER */
header {
  background: linear-gradient(135deg, var(--subj-deep) 0%, var(--subj-main) 60%, var(--subj-mid) 100%);
  color: white;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  transition: background 0.4s;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 10px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.logo-bolt {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--orange-gold), var(--orange-main));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.4);
}

.logo-sparq {
  font-family: 'Baloo 2', cursive;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff 0%, var(--orange-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-by {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.subj-switcher {
  display: flex;
  gap: 5px;
}

.subj-btn {
  padding: 5px 11px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.subj-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.subj-btn.active {
  background: white;
  border-color: white;
  color: var(--subj-main);
}

@media(max-width:420px) {
  .subj-label {
    display: none;
  }

  .subj-btn {
    padding: 6px 9px;
  }
}

/* NAV */
.nav-tabs {
  background: white;
  border-bottom: 2px solid var(--gray-100);
  position: sticky;
  top: 62px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-400);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tab-btn:hover {
  color: var(--subj-main);
}

.tab-btn.active {
  color: var(--subj-main);
  border-bottom-color: var(--orange-main);
}

/* MAIN */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 22px 14px 100px;
}

.panel {
  display: none;
  animation: fadeUp 0.3s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* HEADINGS */
.sec-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}

.icon-wrap {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--subj-main), var(--subj-mid));
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 3px 10px var(--subj-shadow);
  flex-shrink: 0;
}

.sec-head h2 {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  color: var(--subj-deep);
}

.sec-head p {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 600;
}

/* BANNER */
.welcome-banner {
  background: linear-gradient(135deg, var(--subj-deep) 0%, var(--subj-main) 65%, var(--subj-mid) 100%);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  color: white;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 28px var(--subj-shadow);
  transition: background 0.4s;
}

.welcome-banner::after {
  content: attr(data-emoji);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 68px;
  opacity: 0.15;
  pointer-events: none;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  -webkit-text-fill-color: initial;
  color: initial;
  filter: grayscale(0);
}

.welcome-banner h2 {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 3px;
}

.welcome-banner p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  max-width: 380px;
}

.prog-label {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
}

.prog-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  max-width: 300px;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-gold), var(--orange-main));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* SUBJECT CARDS */
.subj-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}

.subj-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--gray-100);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.22s;
}

.subj-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.subj-card.ict-c {
  border-top: 4px solid #1a56db;
}

.subj-card.maths-c {
  border-top: 4px solid #7c3aed;
}

.subj-card.sci-c {
  border-top: 4px solid #059669;
}

.sc-emoji {
  font-size: 24px;
  margin-bottom: 5px;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  -webkit-text-fill-color: initial;
}

.sc-name {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 5px;
}

.sc-bar {
  height: 5px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.sc-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

.ict-c .sc-fill {
  background: linear-gradient(90deg, #1a56db, #2970ff);
}

.maths-c .sc-fill {
  background: linear-gradient(90deg, #7c3aed, #8b5cf6);
}

.sci-c .sc-fill {
  background: linear-gradient(90deg, #059669, #10b981);
}

.sc-count {
  font-size: 10px;
  font-weight: 800;
  color: var(--gray-400);
}

/* STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 10px;
  border: 2px solid var(--gray-100);
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 5px;
}

.stat-value {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: var(--subj-deep);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 3px;
}

/* CURRENT LESSON */
.cur-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--orange-warm);
  padding: 16px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.22s;
}

.cur-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cur-badge-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.cur-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 18px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.cur-phase {
  font-size: 11px;
  font-weight: 800;
  color: var(--orange-main);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.cur-title {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: var(--subj-deep);
  margin-bottom: 7px;
}

.cur-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.skill-chip {
  background: var(--subj-light);
  color: var(--subj-main);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 18px;
}

/* FILTER */
.filter-row {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 18px;
  border: 2px solid var(--gray-200);
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--subj-main);
  color: var(--subj-main);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--subj-main), var(--subj-mid));
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 10px var(--subj-shadow);
}

/* WEEK CARDS */
.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.week-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--gray-100);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
}

.week-card:hover {
  border-color: var(--subj-mid);
  box-shadow: 0 6px 24px var(--subj-shadow);
  transform: translateY(-3px);
}

.week-card.done {
  border-color: var(--success);
}

.wc-hdr {
  padding: 14px 15px 9px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.wc-num {
  font-size: 10px;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.wc-title {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 800;
  color: var(--subj-deep);
  line-height: 1.2;
}

.wc-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.week-card.done .wc-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.wc-body {
  padding: 0 15px 12px;
}

.wc-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.wc-mission {
  font-size: 11px;
  color: var(--gray-600);
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.wc-mission::before {
  content: "🎯";
  font-size: 11px;
  flex-shrink: 0;
}

.wc-foot {
  padding: 8px 15px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wc-phase {
  font-size: 10px;
  font-weight: 800;
  color: var(--orange-main);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.wc-open {
  font-size: 11px;
  font-weight: 800;
  color: var(--subj-main);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: white;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding-bottom: 32px;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-handle {
  width: 34px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 10px auto 0;
}

.modal-hdr {
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.modal-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 18px;
  margin-bottom: 3px;
  display: inline-block;
}

.modal-week-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--orange-main);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.modal-title-txt {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  color: var(--subj-deep);
}

.modal-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.modal-x:hover {
  background: var(--gray-100);
}

.modal-body-inner {
  padding: 16px 20px 0;
}

.m-sec {
  margin-bottom: 16px;
}

.m-sec-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 7px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-badge {
  background: var(--subj-light);
  color: var(--subj-deep);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.skill-badge::before {
  content: "✦";
  color: var(--subj-main);
  font-size: 8px;
}

.about-txt {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  line-height: 1.7;
}

.mission-box {
  background: var(--orange-light);
  border: 2px solid var(--orange-warm);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}

.tip-box {
  background: var(--subj-light);
  border-left: 4px solid var(--subj-main);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--subj-deep);
}

.complete-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.complete-btn:hover {
  transform: translateY(-1px);
}

.complete-btn.marked {
  background: linear-gradient(135deg, var(--gray-400), var(--gray-600));
  box-shadow: none;
}

/* NOTES */
.notes-ctrl {
  display: flex;
  gap: 9px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.sel-in {
  padding: 7px 11px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  background: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.sel-in:focus {
  border-color: var(--subj-main);
}

.notes-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media(max-width:540px) {
  .notes-cols {
    grid-template-columns: 1fr;
  }
}

.note-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--gray-100);
  overflow: hidden;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
}

.note-hdr {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.note-av.dad {
  background: var(--subj-light);
}

.note-av.daughter {
  background: var(--orange-light);
}

.note-author {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 800;
  color: var(--subj-deep);
}

.note-role {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.note-ta {
  width: 100%;
  min-height: 140px;
  padding: 11px 14px;
  border: none;
  border-top: 1px solid var(--gray-100);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  background: var(--gray-50);
  resize: vertical;
  outline: none;
  transition: background 0.2s;
  line-height: 1.6;
}

.note-ta:focus {
  background: white;
}

.note-ta::placeholder {
  color: var(--gray-400);
}

.note-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.save-btn {
  padding: 5px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--subj-main), var(--subj-mid));
  color: white;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.save-btn:hover {
  transform: translateY(-1px);
}

.save-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
}

.save-status.show {
  opacity: 1;
}

/* QUIZ */
.quiz-ctrl {
  display: flex;
  gap: 9px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.quiz-card {
  background: white;
  border-radius: var(--radius);
  border: 2px solid var(--gray-100);
  padding: 22px 20px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
  max-width: 660px;
}

.qprog-bar {
  height: 5px;
  background: var(--gray-100);
  border-radius: 3px;
  margin-bottom: 18px;
  overflow: hidden;
}

.qprog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--subj-main), var(--orange-main));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.q-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 7px;
}

.q-text {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  color: var(--subj-deep);
  margin-bottom: 16px;
  line-height: 1.3;
}

.q-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.q-opt {
  padding: 11px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 9px;
}

.q-opt:hover:not(:disabled) {
  border-color: var(--subj-main);
  color: var(--subj-main);
  background: var(--subj-light);
}

.q-opt.correct {
  border-color: var(--success);
  background: #ecfdf5;
  color: #065f46;
}

.q-opt.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #7f1d1d;
}

.opt-ltr {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-opt.correct .opt-ltr {
  background: var(--success);
  color: white;
}

.q-opt.wrong .opt-ltr {
  background: #ef4444;
  color: white;
}

.q-feedback {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  display: none;
}

.q-feedback.show {
  display: block;
}

.q-feedback.correct-fb {
  background: #ecfdf5;
  color: #065f46;
  border: 2px solid var(--success);
}

.q-feedback.wrong-fb {
  background: #fef2f2;
  color: #7f1d1d;
  border: 2px solid #ef4444;
}

.q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.q-btn {
  padding: 10px 22px;
  border-radius: 18px;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.q-btn.primary {
  background: linear-gradient(135deg, var(--subj-main), var(--subj-mid));
  color: white;
  box-shadow: 0 3px 10px var(--subj-shadow);
}

.q-btn.primary:hover {
  transform: translateY(-1px);
}

.q-btn.secondary {
  background: var(--gray-100);
  color: var(--gray-600);
}

.q-score {
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 800;
  color: var(--orange-main);
}

.q-result {
  text-align: center;
  padding: 14px 0;
}

.res-emoji {
  font-size: 50px;
  margin-bottom: 9px;
}

.score-circle {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--subj-main), var(--orange-main));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 5px 18px var(--subj-shadow);
}

.score-circle span {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: white;
}

.q-result h3 {
  font-family: 'Baloo 2', cursive;
  font-size: 21px;
  font-weight: 800;
  color: var(--subj-deep);
  margin-bottom: 5px;
}

.q-result p {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 16px;
}

.retry-btn {
  padding: 11px 26px;
  background: linear-gradient(135deg, var(--orange-main), var(--orange-warm));
  color: white;
  border: none;
  border-radius: 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
  transition: all 0.2s;
}

.retry-btn:hover {
  transform: translateY(-2px);
}

/* NOTE READONLY STATE */
.note-ta:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
  opacity: 0.7;
}

.note-readonly-msg {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* SYLLABUS EDITOR */
.editor-ctrl {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.editor-ctrl .sel-in {
  flex: 1;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ef-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ef-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--subj-deep);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.ef-hint {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: none;
  letter-spacing: 0;
}

.ef-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  background: white;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ef-input:focus {
  outline: none;
  border-color: var(--subj-main);
}

.ef-ta {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  background: white;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
  line-height: 1.5;
}

.ef-ta:focus {
  outline: none;
  border-color: var(--subj-main);
}

.ef-section-head {
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
  color: var(--subj-deep);
  padding: 4px 0;
  border-bottom: 2px solid var(--subj-light);
  margin-top: 4px;
}

/* QUIZ EDITOR ROW */
.quiz-editor-row {
  background: var(--gray-50);
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.quiz-editor-row-num {
  font-size: 10px;
  font-weight: 800;
  color: var(--subj-main);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.quiz-editor-q {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  background: white;
  box-sizing: border-box;
}

.quiz-editor-q:focus {
  outline: none;
  border-color: var(--subj-main);
}

.quiz-opts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.quiz-opt-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-opt-ltr {
  font-size: 10px;
  font-weight: 800;
  color: var(--gray-400);
  width: 14px;
  flex-shrink: 0;
}

.quiz-opt-input {
  flex: 1;
  padding: 6px 10px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  background: white;
  box-sizing: border-box;
}

.quiz-opt-input:focus {
  outline: none;
  border-color: var(--subj-main);
}

.quiz-opt-input.correct-opt {
  border-color: var(--success);
  background: #ecfdf5;
}

.quiz-ans-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quiz-ans-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-600);
}

.quiz-ans-select {
  padding: 5px 10px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-800);
  background: white;
}

.quiz-ans-select:focus {
  outline: none;
  border-color: var(--success);
}

.quiz-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.quiz-remove-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.ef-add-q-btn {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--subj-mid);
  border-radius: var(--radius-sm);
  background: var(--subj-light);
  color: var(--subj-main);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.ef-add-q-btn:hover {
  background: white;
  border-style: solid;
}

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.ef-save-btn {
  flex: 2;
  padding: 13px;
  background: linear-gradient(135deg, var(--subj-main), var(--subj-mid));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--subj-shadow);
  transition: all 0.2s;
}

.ef-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--subj-shadow);
}

.ef-reset-btn {
  flex: 1;
  padding: 13px;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.ef-reset-btn:hover {
  background: var(--gray-200);
}

.ef-save-status {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
  min-height: 20px;
  transition: opacity 0.3s;
}

/* INSTALL BAR */
.install-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--subj-deep);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 150;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.install-bar.show {
  transform: translateY(0);
}

.install-bar p {
  font-size: 13px;
  font-weight: 700;
}

.install-bar span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  display: block;
}

.ib-btn {
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--orange-main), var(--orange-warm));
  color: white;
  border: none;
  border-radius: 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.ib-x {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 17px;
  cursor: pointer;
  padding: 0 0 0 9px;
}

/* LOADING SCREEN */
#loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: sans-serif;
  background: linear-gradient(135deg, var(--subj-deep) 0%, var(--subj-main) 60%, var(--subj-mid) 100%);
}

#loading>div {
  text-align: center;
}

#loading .loading-logo {
  width: 280px;
  max-width: 80vw;
  height: auto;
  margin-bottom: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

#loading .loading-text {
  color: white;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.9;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

/* SIGN-IN / MODE SELECTION SCREEN */
#modeSelection,
#signInScreen {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--subj-deep) 0%, var(--subj-main) 60%, var(--subj-mid) 100%);
  padding: 20px;
  z-index: 500;
}

#modeSelection.active,
#signInScreen.active {
  display: flex;
}

/* SIGN-IN SPECIFIC */
.signin-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.signin-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  margin-top: 4px;
}

.continue-session-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 12px 28px;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.continue-session-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.continue-session-btn:active {
  transform: translateY(0);
}


.mode-container {
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.mode-logo {
  width: 300px;
  max-width: 90%;
  height: auto;
  margin-bottom: 24px;
  animation: fadeIn 0.6s ease;
}

.mode-title {
  font-family: 'Baloo 2', cursive;
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
}

.mode-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  margin-bottom: 32px;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
}

@media(max-width:500px) {
  .mode-buttons {
    grid-template-columns: 1fr;
  }
}

.mode-btn {
  background: white;
  border: 3px solid transparent;
  border-radius: 20px;
  padding: 28px 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.mode-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.mode-btn:active {
  transform: translateY(-2px);
}

.teacher-btn:hover {
  border-color: #1a56db;
}

.student-btn:hover {
  border-color: #f97316;
}

.mode-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.mode-name {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.mode-desc {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 600;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* HEADER UPDATES FOR LOGO */
.header-logo {
  height: 42px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 4px 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

/* SIGN-OUT POPOVER */
.signout-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 12px;
  min-width: 180px;
  z-index: 300;
  display: none;
  flex-direction: column;
  gap: 6px;
  animation: fadeUp 0.2s ease;
}

.signout-popover.open {
  display: flex;
}

.signout-popover-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 4px 4px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 2px;
}

.signout-popover-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-800);
  padding: 2px 4px 6px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signout-btn-confirm {
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.signout-btn-confirm:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.signout-btn-cancel {
  width: 100%;
  padding: 9px 12px;
  background: var(--gray-100);
  color: var(--gray-600);
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.signout-btn-cancel:hover {
  background: var(--gray-200);
}

.mode-badge {
  font-size: 11px;
  font-weight: 800;
  color: white;
  white-space: nowrap;
}

.mode-switch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-switch-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.mode-switch-btn:active {
  transform: scale(0.95);
}

.mode-switch-btn span {
  font-size: 14px;
}

@media(max-width:600px) {
  .header-logo {
    max-width: 110px;
    height: 36px;
  }

  .mode-indicator {
    padding: 3px 3px 3px 8px;
  }

  .mode-badge {
    font-size: 10px;
  }

  .mode-switch-btn {
    width: 24px;
    height: 24px;
  }

  .mode-switch-btn span {
    font-size: 12px;
  }
}

/* iOS BOTTOM TAB BAR */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  transition: all 0.2s;
  min-height: 44px;
  position: relative;
}

.bottom-tab:active {
  transform: scale(0.95);
}

.tab-icon {
  font-size: 22px;
  transition: transform 0.2s;
}

.bottom-tab.active .tab-icon {
  transform: scale(1.1);
}

.tab-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-600);
  transition: color 0.2s;
}

.bottom-tab.active .tab-label {
  color: var(--subj-main);
}

.bottom-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--subj-main);
  transition: width 0.3s;
}

.bottom-tab.active::before {
  width: 24px;
}

/* iOS SAFE AREA SUPPORT */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  padding-top: max(0px, env(safe-area-inset-top));
}

main {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* iOS TOUCH OPTIMIZATIONS */
button,
a,
.week-card,
.subj-card,
.cur-card,
.mode-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input,
textarea,
select {
  font-size: 16px !important;
}

/* Prevents iOS zoom on focus */

/* iOS SCROLL BEHAVIOR */
main,
.modal {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* HIDE OLD NAV ON MOBILE (ALREADY REMOVED FROM HTML) */
.nav-tabs {
  display: none;
}

/* RESPONSIVE UPDATES FOR iOS */
@media(max-width:600px) {

  .subj-cards,
  .stats-row {
    gap: 8px;
  }

  .subj-card,
  .stat-card {
    padding: 11px 8px;
  }

  .stat-value {
    font-size: 20px;
  }

  .welcome-banner {
    padding: 18px 16px 14px;
  }

  .welcome-banner h2 {
    font-size: 19px;
  }

  .header-inner {
    height: 56px;
    gap: 8px;
  }

  .subj-switcher {
    gap: 4px;
  }

  .subj-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
}

/* LANDSCAPE MODE ADJUSTMENTS */
@media(max-height:500px) and (orientation:landscape) {
  .mode-logo {
    width: 180px;
  }

  .mode-title {
    font-size: 24px;
  }

  .mode-buttons {
    gap: 12px;
  }

  .mode-btn {
    padding: 20px 16px;
  }

  .mode-icon {
    font-size: 36px;
  }
}

/* TABLET OPTIMIZATIONS */
@media(min-width:768px) {
  .bottom-tab-bar {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}

/* ════════════════════════════════════════════════
   QUIZ EDITOR STYLES
   ════════════════════════════════════════════════ */

.quiz-question-editor {
  background: var(--gray-50);
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.qe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.qe-number {
  font-size: 12px;
  font-weight: 800;
  color: var(--subj-main);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.qe-remove-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qe-remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.qe-group {
  margin-bottom: 10px;
}

.qe-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--subj-deep);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.qe-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
  transition: all 0.2s;
}

.qe-input:focus {
  outline: none;
  border-color: var(--subj-main);
  box-shadow: 0 0 0 3px var(--subj-light);
}

.qe-options {
  margin-top: 10px;
}

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

.qe-option-row input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--subj-main);
}

.qe-option {
  flex: 1;
}

/* Teacher-only tab visibility */
.teacher-only {
  display: none !important;
}

body[data-mode="teacher"] .teacher-only {
  display: flex !important;
}

/* ════════════════════════════════════════════════
   STUDENT PROGRESS STYLES
   ════════════════════════════════════════════════ */

.editor-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--gray-200);
}

.progress-summary {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.progress-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.progress-stat {
  text-align: center;
  padding: 12px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.progress-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.progress-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--subj-main);
  font-family: 'Baloo 2', cursive;
}

.progress-by-subject {
  margin-top: 20px;
}

.subject-progress-item {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.subject-progress-item:hover {
  border-color: var(--subj-light);
  box-shadow: 0 2px 8px var(--subj-shadow);
}

.subject-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.subject-progress-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--subj-deep);
}

.subject-progress-percentage {
  font-size: 16px;
  font-weight: 900;
  color: var(--subj-main);
  font-family: 'Baloo 2', cursive;
}

.subject-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.subject-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--subj-main), var(--subj-mid));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.subject-progress-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.subject-stat {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 4px 8px;
  border-radius: 6px;
}

/* ════════════════════════════════════════════════
   PHASE 4 — STUDENT FEATURE STYLES
   ════════════════════════════════════════════════ */

/* ── Dad's Message Card ── */
.dad-message-card {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  border: 2px solid var(--orange-warm);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.15);
  animation: fadeUp 0.4s ease;
}

.dad-message-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.dad-message-avatar {
  width: 38px;
  height: 38px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.dad-message-label {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
}

.dad-message-date {
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dad-message-text {
  font-size: 14px;
  font-weight: 700;
  color: #78350f;
  line-height: 1.6;
  font-style: italic;
}

/* ── Streak Card ── */
.streak-card {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 2px solid var(--orange-warm) !important;
  position: relative;
  overflow: hidden;
}

.streak-card::after {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent);
  border-radius: 50%;
}

.streak-card .stat-value {
  color: var(--orange-main);
}

/* ── Badges Mini Row (Home page) ── */
.badges-mini-section {
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.badges-mini-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.badges-mini-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: default;
  transition: transform 0.2s;
}

.badge-mini:hover {
  transform: scale(1.1);
}

.badge-mini span {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.badge-mini-name {
  font-size: 9px;
  font-weight: 800;
  color: var(--gray-600);
  text-align: center;
  max-width: 52px;
  line-height: 1.2;
}

/* ── Badge Toast Notification ── */
.badge-toast {
  position: fixed;
  top: 75px;
  right: 16px;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  opacity: 0;
  transform: translateX(calc(100% + 20px));
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 260px;
}

.badge-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.badge-toast-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.badge-toast strong {
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 800;
  display: block;
}

.badge-toast div div {
  font-size: 11px;
  color: var(--orange-gold);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Badge Cards (Progress panel) ── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.badge-card {
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  cursor: default;
  transition: all 0.22s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.badge-card.earned {
  border-color: var(--orange-warm);
  background: linear-gradient(135deg, #fff7ed, white);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.15);
}

.badge-card.earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.25);
}

.badge-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.badge-card-icon {
  font-size: 30px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.badge-card-icon-locked {
  font-size: 20px;
  font-weight: 900;
  color: var(--gray-400);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}

.badge-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.2;
  margin-bottom: 3px;
}

.badge-card-desc {
  font-size: 9px;
  font-weight: 600;
  color: var(--gray-400);
  line-height: 1.3;
}

/* ── Star Rating Widget ── */
.lesson-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.star-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gray-200);
  cursor: pointer;
  padding: 2px;
  transition: all 0.15s;
  line-height: 1;
  -webkit-text-fill-color: var(--gray-200);
}

.star-btn:hover,
.star-btn.lit {
  color: var(--orange-gold);
  -webkit-text-fill-color: var(--orange-gold);
  transform: scale(1.2);
}

.rating-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange-main);
  margin-left: 4px;
}

/* Rating row in teacher view */
.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
}

.rating-stars {
  font-size: 14px;
  color: var(--orange-gold);
  letter-spacing: 2px;
}

/* ── Student Progress Panel ── */
.progress-hero {
  background: linear-gradient(135deg, var(--subj-deep) 0%, var(--subj-main) 60%, var(--subj-mid) 100%);
  border-radius: var(--radius);
  padding: 22px 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 28px var(--subj-shadow);
  flex-wrap: wrap;
}

.progress-hero-ring {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: var(--orange-gold);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.26, 0.64, 1);
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-pct {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 900;
  color: white;
  line-height: 1;
}

.ring-sub {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  flex: 1;
  min-width: 160px;
}

.phs-item {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.phs-icon {
  font-size: 18px;
  margin-bottom: 3px;
}

.phs-val {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 900;
  color: white;
  line-height: 1;
}

.phs-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

/* ── Quiz Score Rows ── */
.quiz-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
}

.quiz-score-row:hover {
  border-color: var(--subj-light);
  box-shadow: 0 4px 14px var(--subj-shadow);
}

.quiz-score-medal {
  font-size: 22px;
  flex-shrink: 0;
}

.quiz-score-info {
  flex: 1;
}

.quiz-score-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--gray-800);
  margin-bottom: 1px;
}

.quiz-score-week {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quiz-score-pct {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}

.empty-scores {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-400);
}

/* Best score badge */
.best-score {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
  font-weight: 700 !important;
}

/* ── Teacher editor section hint ── */
.editor-section-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Student-only CSS visibility ── */
.student-only {
  display: none !important;
}

body[data-mode="student"] .student-only {
  display: flex !important;
}