@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary-color: #1a3a6b;
  --primary-light: #2b5c9e;
  --accent-color: #e8312a;
  --accent-light: #ff524c;
  --success-color: #2e7d32;
  --success-bg: #e8f5e9;
  --success-text: #1b5e20;
  --error-color: #c62828;
  --error-bg: #ffebee;
  --error-text: #b71c1c;
  
  --bg-dark: #0f172a;
  --bg-slate: #f8fafc;
  --bg-white: #ffffff;
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --sidebar-shadow: 4px 0 24px rgba(15, 23, 42, 0.03);
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Levels accent colors */
  --level-100: #e8312a;     /* Level 1: Red */
  --level-200: #4fc3f7;     /* Level 2: Sky Blue */
  --level-300: #a78bfa;     /* Level 3: Purple */
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
}

/* Dark mode styling (optional, default to sleek dark/light dynamic mix) */
body.dark-mode {
  --bg-slate: #0b0f19;
  --bg-white: #131c2e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-slate);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

/* App container */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar navigation */
.sidebar {
  width: 280px;
  background-color: var(--bg-white);
  border-right: 1.5px solid var(--border-color);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.sidebar-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.sidebar-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

body.dark-mode .sidebar-title {
  color: #fff;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.menu-item:hover, .menu-item.active {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

body.dark-mode .menu-item:hover, body.dark-mode .menu-item.active {
  background-color: #1e293b;
  color: #fff;
}

.menu-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: var(--transition-smooth);
}

/* Sidebar progress card */
.sidebar-progress-card {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: var(--border-radius-md);
  padding: 20px;
  color: #fff;
  margin-top: auto;
  box-shadow: 0 8px 20px -5px rgba(26, 58, 107, 0.4);
}

.sidebar-progress-card h4 {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 8px;
}

.sidebar-progress-val {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 12px;
}

.progress-bar-bg {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  background: #fff;
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  flex-grow: 1;
  padding: 40px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

.welcome-section h1 {
  font-size: 32px;
  color: var(--primary-color);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

body.dark-mode .welcome-section h1 {
  color: #fff;
}

.welcome-section p {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 4px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Switcher Button */
.theme-btn {
  background: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.theme-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Views Wrapper */
.view-container {
  flex-grow: 1;
}

.app-view {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard View styling */
.hero-banner {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: var(--card-shadow);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232, 49, 42, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
}

.hero-content {
  max-width: 500px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  background: var(--accent-color);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
  letter-spacing: 1.5px;
}

.hero-content h2 {
  font-size: 32px;
  margin-bottom: 12px;
}

.hero-content p {
  opacity: 0.85;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.hero-btn {
  background: #fff;
  color: #0f172a;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 12px 28px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  background: #f8fafc;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.stat-card {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.green { background: #dcfce7; color: #15803d; }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-icon.red { background: #fee2e2; color: #b91c1c; }

.stat-info h4 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-top: 4px;
  color: var(--text-main);
}

/* Dashboard split layout */
.dash-split {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 36px;
}

.section-card {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 28px;
  box-shadow: var(--card-shadow);
}

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

.section-header h3 {
  font-size: 20px;
  color: var(--primary-color);
}

body.dark-mode .section-header h3 {
  color: #fff;
}

.text-btn {
  color: var(--primary-light);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* Recent Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-slate);
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.activity-badge {
  background: var(--primary-color);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-details h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.activity-details p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.activity-score {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--success-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.activity-score.perfect {
  color: #fbbf24;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Level Tracker Card */
.level-progress-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.level-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.level-row-name {
  font-weight: 700;
}

.level-row-stat {
  color: var(--text-muted);
  font-weight: 600;
}

.level-bar-fill {
  height: 8px;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Explore / Modules view style */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  padding: 16px 24px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
}

.search-input-wrap {
  position: relative;
  flex-grow: 1;
  max-width: 420px;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-slate);
  border: 1.5px solid var(--border-color);
  padding: 11px 16px 11px 42px;
  font-size: 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  outline: none;
  transition: var(--transition-smooth);
}

.search-input:focus {
  border-color: var(--primary-light);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(43, 92, 158, 0.1);
}

.filter-tabs {
  display: flex;
  background: var(--bg-slate);
  padding: 4px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.filter-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.filter-tab:hover {
  color: var(--text-main);
}

.filter-tab.active {
  background: var(--bg-white);
  color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Worksheets grid */
.worksheets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.worksheet-card {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.worksheet-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-light);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.unit-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--primary-color);
}

body.dark-mode .unit-badge { color: #fff; }

.level-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
  color: #fff;
}

.level-tag.l1 { background-color: var(--level-100); }
.level-tag.l2 { background-color: var(--level-200); color: #073b4c; }
.level-tag.l3 { background-color: var(--level-300); }

.card-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.word-tag {
  background-color: var(--bg-slate);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
}

.worksheet-card:hover .word-tag {
  background-color: rgba(43, 92, 158, 0.05);
  border-color: rgba(43, 92, 158, 0.15);
  color: var(--primary-color);
}

body.dark-mode .worksheet-card:hover .word-tag {
  color: var(--level-200);
}

.card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1.5px solid var(--border-color);
  padding-top: 16px;
  font-size: 13px;
  font-weight: 600;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #cbd5e1;
}

.status-indicator.not-started .status-dot { background-color: #94a3b8; }
.status-indicator.in-progress .status-dot { background-color: #fbbf24; }
.status-indicator.completed .status-dot { background-color: var(--success-color); }

.card-score {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-main);
}

/* Quiz view runner layout */
.quiz-header {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px 28px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.back-btn {
  background: var(--bg-slate);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.back-btn:hover {
  background: var(--border-color);
}

.quiz-title-info {
  text-align: center;
}

.quiz-title-info h2 {
  font-size: 22px;
  color: var(--primary-color);
}

body.dark-mode .quiz-title-info h2 { color: #fff; }

.quiz-title-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
}

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-toggle-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Dynamic quiz container */
.quiz-sheet-container {
  max-width: 820px;
  margin: 0 auto;
}

.quiz-container {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 60px;
}

.quiz-header-bar {
  background-color: var(--primary-color);
  color: #fff;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-header-bar h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.quiz-header-bar .num-badge {
  background-color: var(--level-100);
  color: #fff;
  font-weight: 900;
  font-size: 26px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-body {
  padding: 32px 40px;
}

/* Word bank in quiz */
.quiz-word-bank {
  background-color: #f0f4ff;
  border-bottom: 2px solid var(--border-color);
  padding: 18px 32px;
}

body.dark-mode .quiz-word-bank {
  background-color: #1a2333;
}

.quiz-word-bank-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.quiz-word-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.quiz-word-chip-wrap {
  text-align: center;
}

.quiz-word-chip {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 6px;
}

body.dark-mode .quiz-word-chip {
  background-color: var(--primary-light);
}

.quiz-translation-input {
  border: none;
  border-bottom: 1.5px dashed var(--text-muted);
  background: transparent;
  font-size: 12px;
  color: var(--text-main);
  width: 100%;
  outline: none;
  text-align: center;
  padding: 2px 0;
}

.quiz-translation-input:focus {
  border-bottom-color: var(--accent-color);
}

/* Task block inside quiz */
.quiz-task {
  margin-bottom: 40px;
}

.quiz-task-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

body.dark-mode .quiz-task-heading {
  border-bottom-color: var(--primary-light);
}

.quiz-task-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary-color);
}

body.dark-mode .quiz-task-label {
  color: var(--primary-light);
}

.quiz-task-instruction {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

/* Task 1 matching table */
.quiz-match-table {
  width: 100%;
  border-collapse: collapse;
}

.quiz-match-table tr {
  margin-bottom: 8px;
}

.quiz-match-table td {
  padding: 8px 4px;
  vertical-align: middle;
}

.quiz-match-table .def-cell {
  width: 60%;
  background: var(--bg-slate);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
}

.quiz-match-table .arrow-cell {
  text-align: center;
  color: var(--text-muted);
  width: 8%;
  font-size: 18px;
}

.quiz-match-table select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--border-color);
  font-size: 14px;
  background-color: var(--bg-white);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quiz-match-table select:focus {
  border-color: var(--primary-color);
}

/* Task 2 Gap filling */
.quiz-gap-item {
  margin-bottom: 14px;
  font-size: 15px;
  line-height: 1.6;
}

.quiz-gap-item span {
  font-weight: 700;
  color: var(--primary-color);
  margin-right: 6px;
}

body.dark-mode .quiz-gap-item span {
  color: var(--primary-light);
}

.quiz-gap-input {
  border: none;
  border-bottom: 2px solid var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  width: 140px;
  text-align: center;
  outline: none;
  padding: 2px 4px;
  background: transparent;
  color: var(--text-main);
}

body.dark-mode .quiz-gap-input {
  border-bottom-color: var(--primary-light);
}

.quiz-gap-input:focus {
  border-bottom-color: var(--accent-color);
}

/* Task 3 Paragraph box */
.quiz-paragraph-box {
  background: var(--bg-slate);
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 2.2;
  margin-bottom: 16px;
}

.quiz-paragraph-box .quiz-gap-input {
  width: 120px;
  margin: 0 4px;
}

.quiz-not-needed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

/* Task 4 table */
.quiz-task4-table {
  width: 100%;
  border-collapse: collapse;
}

.quiz-task4-table th {
  text-align: left;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.quiz-task4-table td {
  padding: 10px 8px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.quiz-task4-table tr:last-child td {
  border-bottom: none;
}

.quiz-task4-table .sent-cell {
  width: 55%;
  line-height: 1.4;
}

.quiz-radio-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  font-size: 13px;
  cursor: pointer;
  background-color: var(--bg-white);
  color: var(--text-main);
  font-weight: 600;
  transition: var(--transition-smooth);
}

.quiz-radio-btn.selected-ok {
  background-color: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

body.dark-mode .quiz-radio-btn.selected-ok {
  background-color: #0c4a6e;
  border-color: #0284c7;
  color: #e0f2fe;
}

.quiz-fix-input {
  border: none;
  border-bottom: 1.5px solid var(--text-muted);
  font-size: 13px;
  width: 140px;
  outline: none;
  padding: 2px 4px;
  background: transparent;
  color: var(--text-main);
}

.quiz-fix-input:focus {
  border-bottom-color: var(--primary-color);
}

/* Task 5 Writing */
.quiz-free-write {
  width: 100%;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  outline: none;
  background-color: var(--bg-white);
  color: var(--text-main);
  line-height: 1.6;
}

.quiz-free-write:focus {
  border-color: var(--primary-color);
}

/* Quiz check action */
.quiz-check-area {
  text-align: center;
  margin-top: 36px;
  border-top: 1.5px solid var(--border-color);
  padding-top: 28px;
}

.quiz-check-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 16px 48px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(26, 58, 107, 0.2);
  transition: var(--transition-smooth);
}

body.dark-mode .quiz-check-btn {
  background-color: var(--primary-light);
}

.quiz-check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 58, 107, 0.3);
  opacity: 0.95;
}

/* Graded answers feedback styling */
.feedback-hint {
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  display: inline-block;
}

/* Correct/Incorrect items styling */
.item-correct select, 
.item-correct .quiz-gap-input, 
.item-correct.quiz-gap-item,
.item-correct.quiz-task4-row td:first-child {
  background-color: var(--success-bg) !important;
  color: var(--success-text) !important;
  border-color: var(--success-color) !important;
}

.item-correct .feedback-hint {
  color: var(--success-color);
}

.item-incorrect select, 
.item-incorrect .quiz-gap-input, 
.item-incorrect.quiz-gap-item,
.item-incorrect.quiz-task4-row td:first-child {
  background-color: var(--error-bg) !important;
  color: var(--error-text) !important;
  border-color: var(--error-color) !important;
}

.item-incorrect .feedback-hint {
  color: var(--error-color);
}

/* Score Box display */
.quiz-score-box {
  margin: 24px auto 0;
  max-width: 380px;
  background-color: var(--bg-slate);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  text-align: center;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.score-num-big {
  font-size: 48px;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: var(--primary-color);
}

body.dark-mode .score-num-big { color: var(--primary-light); }

.score-num-big.perfect {
  color: #fbbf24;
}

.score-lbl {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

.score-msg-txt {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* Achievements view styling */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.badge-card {
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-smooth);
}

.badge-card:hover {
  transform: translateY(-2px);
}

.badge-card.locked {
  opacity: 0.6;
}

.badge-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
  background: var(--bg-slate);
  transition: var(--transition-smooth);
}

.badge-card:not(.locked) .badge-icon {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(245, 158, 11, 0.4);
}

.badge-card.perfect-score:not(.locked) .badge-icon {
  background: linear-gradient(135deg, #ec4899, #d946ef);
  box-shadow: 0 8px 20px -6px rgba(217, 70, 239, 0.4);
}

.badge-card.level-completed:not(.locked) .badge-icon {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.4);
}

.badge-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.badge-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive responsive adjustments */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: 250px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 30px 24px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .quiz-body {
    padding: 20px;
  }
  .quiz-word-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quiz-match-table td {
    display: block;
    width: 100%;
  }
  .quiz-match-table .def-cell {
    width: 100%;
  }
  .quiz-match-table .arrow-cell {
    transform: rotate(90deg);
    padding: 4px 0;
  }
}

/* Book Banner Card in Modules Explorer */
.book-banner-card {
  display: flex;
  gap: 36px;
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 32px;
  margin-bottom: 36px;
  box-shadow: var(--card-shadow);
  align-items: center;
  transition: var(--transition-smooth);
  cursor: pointer;
  user-select: none;
}

.book-banner-card img {
  height: 160px;
  width: auto;
  border-radius: 6px;
  box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.22);
  transition: var(--transition-smooth);
}

.book-banner-card:hover img {
  transform: scale(1.05);
}

.book-banner-info {
  flex-grow: 1;
}

.book-banner-info h3 {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

body.dark-mode .book-banner-info h3 {
  color: #fff;
}

.book-banner-info p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.55;
}

.book-banner-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  background: var(--bg-slate);
  transition: var(--transition-smooth);
  margin-left: 16px;
  flex-shrink: 0;
}

body.dark-mode .book-banner-toggle {
  background: #1e293b;
}

.book-banner-card:hover .book-banner-toggle {
  background: var(--border-color);
}

body.dark-mode .book-banner-card:hover .book-banner-toggle {
  background: #334155;
}

.chevron-icon {
  stroke: var(--gold);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: var(--transition-smooth);
  transform: rotate(0deg);
}

.book-banner-card.expanded .chevron-icon {
  transform: rotate(180deg);
}

.book-section {
  margin-bottom: 48px;
}

.book-section:last-child {
  margin-bottom: 12px;
}

/* Accordion collapse and transition */
.worksheets-grid.collapsed {
  display: none !important;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.worksheets-grid:not(.collapsed) {
  animation: fadeInSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sidebar Account Widget */
.sidebar-account-card {
  margin-top: 20px;
  border-top: 1.5px solid var(--border-color);
  padding-top: 20px;
}

.account-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
  text-align: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.logout-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  background: var(--bg-slate);
  color: var(--error-color);
  border-color: var(--error-color);
}

body.dark-mode .logout-btn:hover {
  background: rgba(198, 40, 40, 0.1);
  color: #f87171;
  border-color: #f87171;
}
