/* Single Page Kids & UbD Educational CSS - Multi-Color Component Hanzi Animation & APP_MNEMONIC System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Noto+Sans+SC:wght@500;700;900&display=swap');

:root {
  --bg-page: #f8fafc;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  
  --cyan: #0284c7;
  --cyan-bg: #ecfeff;
  --cyan-border: #a5f3fc;
  
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  
  --purple: #7e22ce;
  --purple-bg: #f3e8ff;
  --purple-border: #e9d5ff;
  
  --emerald: #047857;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  
  --blue: #4338ca;
  --blue-bg: #eef2ff;
  --blue-border: #c7d2fe;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.6;
  padding-bottom: 4rem;
}

/* Header */
.top-header {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.25);
}

.logo-title h1 {
  font-size: 1.25rem;
  color: #0f172a;
}

.logo-title h1 span {
  color: #6366f1;
}

/* Student Account Bar */
.student-profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 50px;
  padding: 4px 6px 4px 14px;
}

.student-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.avatar-icon {
  font-size: 1.6rem;
  color: #6366f1;
}

.student-info strong {
  font-size: 0.92rem;
  color: #0f172a;
  display: block;
  line-height: 1.2;
}

.student-rank {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 700;
}

.btn-switch-account {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-switch-account:hover {
  background: #eef2ff;
  color: #6366f1;
  border-color: #a5b4fc;
}

/* Page Layout */
.page-container {
  max-width: 1200px;
  margin: 1.5rem auto 0 auto;
  padding: 0 1.5rem;
}

/* Daily Notification Banner */
.daily-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 20px;
  padding: 1.2rem 1.8rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
  animation: fadeIn 0.4s ease;
}

.daily-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.daily-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.daily-banner h3 {
  font-size: 1.15rem;
  color: #92400e;
  margin-bottom: 2px;
}

.daily-banner p {
  color: #78350f;
  font-size: 0.92rem;
  font-weight: 600;
}

.btn-daily-action {
  background: #d97706;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-daily-action:hover {
  background: #b45309;
  transform: translateY(-2px);
}

.page-title-banner {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.page-title-banner h2 {
  font-size: 1.6rem;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.page-title-banner p {
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
}

/* Tab Bar System */
.tab-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 2rem;
  background: #ffffff;
  padding: 8px;
  border-radius: 50px;
  border: 2px solid #e2e8f0;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.98rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: #1e293b;
  background: #f8fafc;
}

.tab-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.28);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-block {
  margin-bottom: 2rem;
}

/* Base Card Styling */
.card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 22px;
  padding: 1.8rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.05);
}

/* Section Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 1.5rem;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge-cyan { background: #e0f2fe; color: #0284c7; }
.badge-amber { background: #fef3c7; color: #d97706; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-emerald { background: #d1fae5; color: #047857; }

.icon-top { font-size: 1.5rem; }
.icon-cyan { color: #0284c7; }
.icon-amber { color: #d97706; }
.icon-purple { color: #7e22ce; }

.card-h3 {
  font-size: 1.35rem;
  color: #0f172a;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.card-sub {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  color: #1e293b;
}

.check-cyan { color: #0284c7; margin-top: 4px; }
.check-amber { color: #d97706; margin-top: 4px; }
.check-purple { color: #7e22ce; margin-top: 4px; }

.item-row strong {
  display: inline-block;
  min-width: 80px;
  color: #0f172a;
}

/* Scope Box */
.scope-box {
  background: #ffffff;
  border: 2px solid #e2e8f0;
}

.scope-header {
  color: #d97706;
  font-size: 1.25rem;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scope-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scope-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  color: #1e293b;
}

.scope-icon {
  font-size: 1.25rem;
  width: 24px;
}

.icon-emerald { color: #10b981; }
.icon-teal { color: #0d9488; }
.icon-pink { color: #ec4899; }

.hz {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
  color: #0f172a;
  margin-left: 6px;
}

.py {
  color: #64748b;
  margin-left: 6px;
  font-size: 0.98rem;
}

/* AI Rubric Cards */
.rubric-card {
  padding: 1.6rem;
  border-radius: 20px;
}

.card-cyan-bg { background: var(--cyan-bg); border: 2px solid var(--cyan-border); }
.card-purple-bg { background: var(--purple-bg); border: 2px solid var(--purple-border); }
.card-emerald-bg { background: var(--emerald-bg); border: 2px solid var(--emerald-border); }
.card-blue-bg { background: var(--blue-bg); border: 2px solid var(--blue-border); }
.card-yellow-bg { background: var(--amber-bg); border: 2px solid var(--amber-border); }

.rubric-title {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.title-cyan { color: #0284c7; }
.title-purple { color: #7e22ce; }
.title-emerald { color: #047857; }
.title-blue { color: #4338ca; }
.title-amber { color: #b45309; }

.rubric-desc {
  color: #334155;
  font-size: 0.98rem;
}

/* Pattern Stack Separated Sentence Rows */
.pattern-stack {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.pattern-card {
  padding: 1.6rem;
  border-radius: 20px;
}

.pattern-header {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sentence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sentence-item-row {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}

.sentence-item-row:hover {
  border-color: #6366f1;
  transform: translateX(4px);
}

.sentence-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sentence-tag {
  font-weight: 700;
  font-size: 0.88rem;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 50px;
}

.hz-large {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: #0f172a;
}

.py-tag {
  color: #6366f1;
  font-weight: 700;
  font-size: 0.95rem;
}

.vi-tag {
  color: #059669;
  font-weight: 600;
  font-size: 0.92rem;
}

/* Tone Sandhi Cards */
.sandhi-card {
  padding: 1.8rem;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sandhi-title {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sandhi-desc {
  color: #334155;
  font-size: 0.98rem;
  margin-bottom: 1.2rem;
}

.sandhi-box {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 1rem 1.4rem;
  text-align: center;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.hz-highlight {
  font-size: 1.25rem;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
}

.audio-btn-wide {
  width: 100%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #1e293b;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.audio-btn-wide:hover {
  background: #f1f5f9;
  border-color: #6366f1;
  color: #6366f1;
  transform: translateY(-2px);
}

/* VOCABULARIES MODULE STYLING */
.vocab-subtab-bar {
  display: flex;
  gap: 10px;
  background: #ffffff;
  padding: 6px;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
}

.vocab-subtab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.vocab-subtab-btn.active {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 800;
}

.grid-layout-vocab {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
}

.vocab-grid-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vocab-word-item {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vocab-word-item:hover {
  background: #eef2ff;
  border-color: #6366f1;
  transform: translateX(4px);
}

.vocab-word-item.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.vocab-word-item.active .vw-hz,
.vocab-word-item.active .vw-py,
.vocab-word-item.active .vw-vi {
  color: white;
}

.vw-hz {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.vw-py {
  font-size: 0.9rem;
  font-weight: 700;
  color: #6366f1;
}

.vw-vi {
  font-size: 0.85rem;
  color: #64748b;
}

/* Hanzi Learning Detail Card & Multi-Character Component Styling */
.etym-box {
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: 16px;
  padding: 1.2rem;
}

.etym-header {
  color: #b45309;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.etym-body {
  color: #78350f;
  font-size: 0.98rem;
  line-height: 1.5;
}

.app-mnemonic-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 2px solid #a7f3d0;
  border-radius: 16px;
  padding: 1.2rem;
  margin-top: 1rem;
}

.app-mnemonic-header {
  color: #047857;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-mnemonic-body {
  color: #065f46;
  font-size: 0.98rem;
  line-height: 1.6;
  font-weight: 600;
}

.multi-hanzi-wrapper {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.hanzi-writer-box-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.hanzi-writer-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hw-char-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 900;
  color: #4338ca;
  font-size: 1rem;
  margin-top: 6px;
}

.component-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
  max-width: 140px;
}

.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* Interactive Test Engine Styling */
.timer-badge {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-shuffle {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-shuffle:hover {
  background: #dcfce7;
  transform: translateY(-2px);
}

.test-item-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.4rem;
  margin-bottom: 1.4rem;
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 10px;
}

.calib-btn-group {
  display: flex;
  gap: 6px;
}

.calib-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calib-btn:hover {
  background: #f1f5f9;
}

.calib-btn.active-emerald { background: #d1fae5; color: #047857; border-color: #34d399; }
.calib-btn.active-amber { background: #fef3c7; color: #b45309; border-color: #fbbf24; }
.calib-btn.active-red { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

.test-question {
  font-size: 1.05rem;
  color: #0f172a;
  margin-bottom: 1rem;
}

.audio-btn-inline {
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0284c7;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.audio-btn-inline:hover {
  background: #bae6fd;
  color: #0369a1;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-label {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  color: #1e293b;
  transition: all 0.2s ease;
}

.opt-label:hover {
  border-color: #6366f1;
  background: #f4f5ff;
}

.btn-eval {
  width: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.08rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
  transition: all 0.25s ease;
}

.btn-eval:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(99, 102, 241, 0.4);
}

/* Interactive Transfer Practice Questions Styling */
.transfer-quiz-card {
  background: #f8fafc;
  border: 2px dashed #818cf8;
  border-radius: 18px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
}

.transfer-quiz-title {
  font-size: 1rem;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 0.8rem;
}

.transfer-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0.8rem;
}

.transfer-opt-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 10px 16px;
  border-radius: 10px;
  text-align: left;
  font-size: 0.95rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transfer-opt-btn:hover {
  border-color: #6366f1;
  background: #eef2ff;
}

.transfer-opt-btn.correct-selected {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
  font-weight: 700;
}

.transfer-opt-btn.wrong-selected {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* Modal Popup Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  animation: fadeIn 0.25s ease;
}

@media (max-width: 850px) {
  .grid-3, .grid-2, .grid-layout-vocab {
    grid-template-columns: 1fr;
  }
  .daily-banner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .daily-banner-content {
    flex-direction: column;
  }
  .sentence-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
