/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
:root {
  /* Font Family */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color System - Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-sidebar: #f1f5f9;
  --border-color: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.15);
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.15);
  
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.15);
  
  --tier-bronze: #cd7f32;
  --tier-silver: #c0c0c0;
  --tier-gold: #fbbf24;
  --tier-diamond: #38bdf8;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --transition-speed: 0.25s;
}

/* Color System - Dark Theme override */
[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #131c2e;
  --bg-sidebar: #0f1524;
  --border-color: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-glow: rgba(129, 140, 248, 0.2);
  
  --success: #34d399;
  --success-hover: #10b981;
  --success-glow: rgba(52, 211, 153, 0.2);
  
  --danger: #f87171;
  --danger-hover: #ef4444;
  --danger-glow: rgba(248, 113, 113, 0.2);
  
  --warning: #fbbf24;
  --warning-glow: rgba(251, 191, 36, 0.2);
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  overflow-x: hidden;
  min-height: 100vh;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  font-size: 1.5rem;
}
.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-selector-container {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-primary);
  padding: 0.35rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.role-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--border-radius-md) - 4px);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  transition: all var(--transition-speed) ease;
}

.role-btn.active {
  background: var(--bg-secondary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

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

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  min-height: calc(100vh - 80px);
}

/* ==========================================
   ROLE SECTIONS & VIEW TOGGLES
   ========================================== */
.role-section {
  display: none;
}
.role-section.active {
  display: block;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.dashboard-content {
  min-width: 0; /* Prevent content from overflowing the grid cell */
  overflow-x: hidden;
}
/* ==========================================
   SIDEBAR COMPONENT
   ========================================== */
.dashboard-sidebar {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.user-summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.avatar-placeholder {
  font-size: 2.25rem;
  background: var(--bg-secondary);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.user-details h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.user-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.25rem;
}
.tier-gold { background-color: var(--warning-glow); color: var(--warning); border: 1px solid var(--warning); }
.tier-teacher { background-color: var(--primary-glow); color: var(--primary); border: 1px solid var(--primary); }
.tier-parent { background-color: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid #ef4444; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
}

.nav-item:hover, .nav-item.active {
  background-color: var(--bg-secondary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================
   TABS VIEW CONTROLLER
   ========================================== */
.tab-content {
  display: none;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ==========================================
   CARDS & COMMON WIDGETS
   ========================================== */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed) ease;
}

.welcome-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.welcome-header p {
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  font-size: 2rem;
  background-color: var(--bg-primary);
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
}

.dashboard-visuals {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .dashboard-visuals {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.achievement-badge-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.5;
  transition: opacity var(--transition-speed);
}
.achievement-badge-card.unlocked {
  opacity: 1;
  background: linear-gradient(135deg, var(--bg-secondary), var(--primary-glow));
  border-color: var(--primary);
}
.achievement-badge-card .badge-icon {
  font-size: 2rem;
}
.achievement-badge-card .badge-title {
  font-size: 0.8rem;
  font-weight: 700;
}
.achievement-badge-card .badge-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ==========================================
   CLASSROOMS CARDS WIDGETS
   ========================================== */
.class-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.class-widget-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-speed);
}

.class-widget-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.class-widget-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--bg-secondary), var(--primary-glow));
}

.class-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.class-card-name {
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
}

.class-card-code {
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--primary);
}

.class-card-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.class-card-stat {
  display: flex;
  flex-direction: column;
}
.class-card-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.class-card-val {
  font-weight: 700;
  font-size: 0.95rem;
}

/* ==========================================
   QUESTIONS REVIEW SCROLL GRID
   ========================================== */
.review-questions-scroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-primary);
}

.review-q-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: border-color var(--transition-speed);
}

.review-q-card:hover {
  border-color: var(--text-muted);
}

.review-q-card.marked-regen {
  border-color: var(--danger);
  background: var(--danger-glow);
}

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

.review-q-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

.review-q-check-lbl {
  font-size: 0.7rem;
  color: var(--danger);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.review-q-check-lbl input {
  accent-color: var(--danger);
}

.review-q-formula {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 0.5rem 0;
}

.review-q-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.review-q-opt {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-primary);
  border-radius: 4px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.review-q-opt.correct {
  background-color: var(--success);
  color: white;
  border-color: var(--success-hover);
  font-weight: 700;
}

/* ==========================================
   STUDENT ASSIGNMENTS STYLES
   ========================================== */
.assignments-grid-student {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.student-assignment-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed);
}

.student-assignment-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stud-assign-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stud-assign-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.stud-assign-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}
.stud-assign-status.pending {
  background: var(--warning-glow);
  color: var(--warning);
  border: 1px solid var(--warning);
}
.stud-assign-status.completed {
  background: var(--success-glow);
  color: var(--success);
  border: 1px solid var(--success);
}

.stud-assign-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ==========================================
   DATA TABLES
   ========================================== */
.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}
td {
  padding: 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
tr:hover td {
  background-color: var(--bg-primary);
}

/* ==========================================
   QUIZ PLAYGROUND
   ========================================== */
.playground-container {
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.quiz-state-screen {
  display: none;
  width: 100%;
  max-width: 600px;
}
.quiz-state-screen.active {
  display: block;
}

.quiz-intro-content, .results-content {
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.intro-graphics, .results-badge {
  font-size: 4rem;
  background: var(--primary-glow);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce 2s infinite;
}

.settings-preview {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  background: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: var(--bg-sidebar);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
}
.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
}
.btn-danger {
  background-color: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger-hover);
}
.btn-success {
  background-color: var(--success);
}
.btn-success:hover {
  background-color: var(--success-hover);
}
.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
}

/* Active Quiz Layout */
#quiz-active {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.quiz-progress-wrapper {
  flex-grow: 1;
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-bar-container {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width var(--transition-speed) ease-in-out;
}

.quiz-timer {
  background: var(--warning-glow);
  color: var(--warning);
  font-weight: 800;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.question-container {
  text-align: center;
  margin: 3rem 0;
}

.math-question {
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.option-btn {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.option-btn:hover {
  border-color: var(--primary);
  background-color: var(--primary-glow);
  transform: translateY(-2px);
}

.option-btn.correct {
  background-color: var(--success) !important;
  color: white !important;
  border-color: var(--success) !important;
}

.option-btn.wrong {
  background-color: var(--danger) !important;
  color: white !important;
  border-color: var(--danger) !important;
}

.feedback-toast {
  text-align: center;
  font-weight: 700;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-speed) ease;
}
.feedback-toast.show-correct {
  opacity: 1;
  transform: translateY(0);
  background-color: var(--success-glow);
  color: var(--success);
}
.feedback-toast.show-wrong {
  opacity: 1;
  transform: translateY(0);
  background-color: var(--danger-glow);
  color: var(--danger);
}

/* Results metrics */
.results-stats-row {
  display: flex;
  gap: 2rem;
  margin: 1rem 0;
}

.result-stat {
  display: flex;
  flex-direction: column;
}
.res-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.res-val {
  font-size: 1.5rem;
  font-weight: 800;
}

/* ==========================================
   SETTINGS STYLES
   ========================================== */
.settings-container h2 {
  font-size: 1.5rem;
  font-weight: 800;
}
.settings-container .subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.radio-toggle-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.toggle-option input[type="radio"] {
  display: none;
}

.option-card {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  background: var(--bg-primary);
  transition: all var(--transition-speed);
}

.lvl-icon {
  font-size: 1.5rem;
}

.lvl-text {
  display: flex;
  flex-direction: column;
}
.lvl-text strong {
  font-size: 1rem;
  font-weight: 700;
}
.lvl-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toggle-option input[type="radio"]:checked + .option-card {
  border-color: var(--primary);
  background-color: var(--primary-glow);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.85rem;
}

.checkbox-card {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: var(--bg-primary);
  font-weight: 700;
  position: relative;
  transition: all var(--transition-speed);
  gap: 0.4rem;
  min-height: 115px;
  box-sizing: border-box;
}

.checkbox-card input[type="checkbox"] {
  position: absolute;
  top: 8px;
  left: 8px;
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-card .check-icon {
  font-size: 2.2rem;
  display: block;
}

.checkbox-card .topic-name-label {
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--text-primary);
  display: block;
}

.checkbox-card:has(input:checked) {
  border-color: var(--primary);
  background-color: var(--primary-glow);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.form-select {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-speed);
}
.form-select:focus {
  border-color: var(--primary);
}

/* ==========================================
   TEACHER STYLES
   ========================================== */
.teacher-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.alert-card {
  background-color: var(--warning-glow);
  border-color: var(--warning);
  color: var(--text-primary);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.alert-icon {
  font-size: 1.5rem;
}

/* Live Simulator Styles */
.live-header {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.live-status-badge {
  display: inline-block;
  background-color: var(--danger-glow);
  color: var(--danger);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  animation: pulse 1.5s infinite;
}

.live-question-box {
  margin-top: 1rem;
}
.live-question-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.live-question-box h3 {
  font-size: 2rem;
  font-weight: 800;
}

.live-feed-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .live-feed-grid {
    grid-template-columns: 1fr;
  }
}

.feed-logs {
  max-height: 250px;
  overflow-y: auto;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.feed-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  font-size: 0.85rem;
  animation: slideIn 0.3s forwards;
}
.feed-item.correct {
  border-left: 4px solid var(--success);
}
.feed-item.wrong {
  border-left: 4px solid var(--danger);
}

.accuracy-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.circle-chart-container {
  position: relative;
  width: 120px;
  height: 120px;
}

.circle-svg {
  transform: rotate(-90deg);
}

.bg-circle {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 10;
}

.fg-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.circle-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 800;
}

.bar-stats {
  width: 100%;
}
.bar-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* ==========================================
   PARENT STYLES
   ========================================== */
.children-selector {
  display: flex;
  gap: 1rem;
}

.child-profile-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all var(--transition-speed);
  min-width: 80px;
  text-align: center;
}

.child-profile-card.active {
  border-color: var(--primary);
  background-color: var(--primary-glow);
}

.child-profile-card .avatar {
  font-size: 2rem;
}

.child-profile-card .details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.child-profile-card .details strong {
  font-size: 0.95rem;
}
.child-profile-card .details span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.parent-insights-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .parent-insights-grid {
    grid-template-columns: 1fr;
  }
}

.struggling-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.struggle-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem;
}

.struggle-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.struggle-title span {
  color: var(--danger);
  background: var(--danger-glow);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.struggle-rec {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-bars-stats {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.topic-stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.topic-info-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.bar-outer {
  height: 10px;
  background: var(--bg-primary);
  border-radius: 5px;
  overflow: hidden;
}

.bar-inner {
  height: 100%;
  background: var(--success);
  border-radius: 5px;
}

/* ==========================================
   LEADERBOARD & RANK STYLES
   ========================================== */
.live-rank-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--primary-glow), var(--warning-glow));
  border: 2px solid var(--primary);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease-out;
}

.rank-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rank-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.rank-points {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-glow);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1.25rem;
  transition: all var(--transition-speed);
}

.leaderboard-item.rank-1 {
  border-color: #fbbf24;
  background: linear-gradient(135deg, var(--bg-primary), rgba(251, 191, 36, 0.1));
}
.leaderboard-item.rank-2 {
  border-color: #c0c0c0;
  background: linear-gradient(135deg, var(--bg-primary), rgba(192, 192, 192, 0.08));
}
.leaderboard-item.rank-3 {
  border-color: #cd7f32;
  background: linear-gradient(135deg, var(--bg-primary), rgba(205, 127, 50, 0.08));
}
.leaderboard-item.is-you {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--bg-primary), var(--primary-glow));
}

.lb-rank-badge {
  font-size: 1.5rem;
  min-width: 2rem;
  text-align: center;
}

.lb-name {
  flex-grow: 1;
  font-weight: 700;
  font-size: 0.95rem;
}

.lb-points {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

.lb-correct {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

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

/* ==========================================
   SOCIAL & CO-OP QUEST STYLES
   ========================================== */
.activity-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed);
}
.activity-card:hover {
  transform: translateY(-2px);
}
.activity-avatar {
  font-size: 2rem;
  background: var(--bg-primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.activity-body {
  flex-grow: 1;
}
.activity-actions {
  display: flex;
  gap: 0.35rem;
}
.reaction-emoji-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-speed);
}
.reaction-emoji-btn:hover {
  transform: scale(1.2);
  background: var(--primary-glow);
  border-color: var(--primary);
}

/* Co-op Quest Custom Layouts */
.quest-party-member {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
  min-width: 100px;
}
.quest-party-avatar {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.quest-party-dmg {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--danger);
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-boss {
  animation: shake 0.4s !important;
}

/* Authentication Layout styles */
.auth-overlay-active {
  animation: fadeIn 0.3s ease-out forwards;
}
.auth-tabs button {
  color: var(--text-secondary);
  border-radius: 0;
  transition: all var(--transition-speed);
}
.auth-tabs button.active {
  color: var(--primary) !important;
  border-bottom: 2px solid var(--primary) !important;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================
   SCHOOL BY NEXXBIT PORTAL STYLES
   ========================================== */

/* Redesigned Authentication Screen */
.auth-card-wide {
  width: 100%;
  max-width: 860px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  max-height: 90vh;
  overflow-y: auto;
}

/* Row 1: Quick Logins Grid */
.quick-logins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.quick-login-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.quick-login-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--primary-glow);
}

.quick-login-avatar {
  font-size: 2.5rem;
}

.quick-login-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.quick-login-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--border-color);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}

/* Row 2: Role Sign In Selector Grid */
.role-signin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .role-signin-grid {
    grid-template-columns: 1fr;
  }
}

.role-signin-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.role-signin-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.role-signin-card.active {
  border-color: var(--primary);
  background: var(--primary-glow);
  box-shadow: var(--shadow-md);
}

.role-signin-avatar {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.role-signin-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.role-signin-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Subject Widgets Grid in Teacher Settings */
.teacher-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.subject-widget-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all var(--transition-speed) ease;
}

.subject-widget-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.subject-widget-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.subject-widget-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.subject-widget-topics {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.subject-widget-remove-btn {
  margin-top: 1rem;
  width: 100%;
}

/* Profound Sidebar profile enhancements */
.dashboard-sidebar .user-summary-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
}

.dashboard-sidebar .avatar-placeholder {
  width: 90px;
  height: 90px;
  font-size: 3.25rem;
  box-shadow: var(--shadow-md);
  border: 2.5px solid var(--primary);
}

/* Subject Cards Selectors Widget */
.subject-selector-widget .subject-card {
  flex: 1;
  padding: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.subject-selector-widget .subject-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.subject-selector-widget .subject-card.active {
  border-color: var(--primary) !important;
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  box-shadow: 0 4px 16px var(--primary-glow) !important;
}

/* Sidebar nav Play Quiz CTA Highlight and Size */
.sidebar-nav .nav-item[data-tab="student-playground"] {
  background: var(--primary-glow) !important;
  border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  padding: 0.85rem 1rem !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0.75rem !important;
  box-shadow: 0 4px 12px var(--primary-glow) !important;
  border-radius: var(--border-radius-md) !important;
  transition: all 0.3s ease !important;
}
.sidebar-nav .nav-item[data-tab="student-playground"]:hover {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 6px 20px var(--primary-glow) !important;
  transform: translateY(-2px) !important;
}

/* Enlarged Start Challenge Button inside student playground */
#start-quiz-btn {
  padding: 1.25rem 3.5rem !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: 0 8px 24px var(--primary-glow) !important;
  transition: all 0.2s ease !important;
}
#start-quiz-btn:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 12px 32px var(--primary-glow) !important;
}

/* ==========================================
   COMPACT REDESIGNED AUTHENTICATION SCREEN
   ========================================== */
.auth-card-compact {
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  margin: auto;
  font-family: var(--font-family);
  animation: fadeIn 0.3s ease;
  transition: max-width 0.3s ease;
}

@media (min-width: 768px) {
  /* Expand the card width when showing wider forms */
  .auth-card-compact:has(#register-form-container:not([style*="display: none"])) {
    max-width: 760px;
  }
}

#login-form-area {
  max-width: 400px;
  margin: 0 auto;
}

#register-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1.25rem;
}

@media (min-width: 768px) {
  #register-form {
    grid-template-columns: 1fr 1fr;
  }
  #register-form > .auth-form-group:first-of-type {
    grid-column: span 2;
  }
  
  /* Flatten specific containers into the parent grid to align fields across wrappers */
  #register-student-only-fields,
  #register-teacher-only-fields,
  #register-parent-only-fields {
    display: contents;
  }
  
  /* Make long fields or compound groups span both columns explicitly starting from column 1 */
  #register-school-group,
  #register-parent-email-group,
  #register-teacher-school-group,
  #register-parent-role-group {
    grid-column: 1 / span 2;
  }
  
  #register-form > button[type="submit"] {
    grid-column: span 2;
  }
}

.auth-brand-logo {
  font-size: 3.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-brand-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-top: 0.5rem;
  text-align: center;
}

.auth-brand-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  margin-bottom: 2rem;
  text-align: center;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.75rem;
  gap: 0.5rem;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition-speed) ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px; /* overlap border */
}

.auth-tab-btn:hover {
  color: var(--text-primary);
}

.auth-tab-btn.active {
  color: var(--primary);
  font-weight: 800;
  border-bottom-color: var(--primary);
}

/* Auth forms and input formatting */
.auth-form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.auth-form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: block;
}

.auth-input-wrapper {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-speed) ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.auth-btn-primary {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  margin-top: 1.5rem;
}

.auth-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.auth-btn-secondary {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

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

.auth-demo-credentials-info {
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: center;
}

/* Redesigned Quick Logins button & avatars */
.quick-login-avatar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  gap: 0.35rem;
  transition: transform var(--transition-speed) ease;
  padding: 0.25rem;
}

.quick-login-avatar-btn:hover {
  transform: translateY(-2px);
}

.quick-login-avatar-circle {
  font-size: 2.2rem;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
}

.quick-login-avatar-btn:hover .quick-login-avatar-circle {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--primary-glow);
}

.quick-login-avatar-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circle-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .circle-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile-responsive styles */
@media (max-width: 968px) {
  #mobile-menu-toggle {
    display: block !important;
  }

  .dashboard-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .dashboard-content {
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  
  .dashboard-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -290px !important;
    width: 280px !important;
    height: 100vh !important;
    border-radius: 0 !important;
    border-right: 1px solid var(--border-color) !important;
    border-top: none !important;
    border-bottom: none !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: left var(--transition-speed) ease-in-out !important;
    box-shadow: var(--shadow-lg) !important;
    background-color: var(--bg-sidebar) !important;
    padding: 1.5rem !important;
    gap: 1.5rem !important;
  }
  
  .dashboard-sidebar.active {
    left: 0 !important;
  }
  
  .dashboard-sidebar .user-summary-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding-bottom: 1.5rem !important;
    border-bottom: 1px solid var(--border-color) !important;
  }
  
  .dashboard-sidebar .avatar-placeholder {
    width: 90px !important;
    height: 90px !important;
    font-size: 3.25rem !important;
    box-shadow: var(--shadow-md) !important;
    border: 2.5px solid var(--primary) !important;
  }
  
  .join-class-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .sidebar-nav {
    flex-direction: column !important;
    overflow-x: visible !important;
    white-space: normal !important;
    gap: 0.5rem !important;
    padding: 0 !important;
  }
  
  .nav-item {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    width: 100% !important;
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 1.05rem 0.5rem !important;
  }
  .card {
    padding: 1.25rem 1rem !important;
  }
  .math-question {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem) !important;
    line-height: 1.3 !important;
  }
  .options-grid {
    grid-template-columns: 1fr !important;
  }
  .option-btn {
    padding: 1.15rem !important;
    font-size: 1.25rem !important;
  }
  .question-container {
    margin: 1.5rem 0 !important;
  }
}

/* Extra small screens - stat card compact mode */
@media (max-width: 480px) {
  .app-container {
    padding: 0.75rem !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }
  .stat-card {
    padding: 0.9rem 0.75rem !important;
    gap: 0.6rem !important;
  }
  .stat-icon {
    font-size: 1.4rem !important;
    width: 36px !important;
    height: 36px !important;
  }
  .stat-value {
    font-size: 1rem !important;
  }
  .stat-label {
    font-size: 0.7rem !important;
  }
  .history-card .table-wrapper {
    overflow-x: auto !important;
  }
  .dashboard-visuals {
    grid-template-columns: 1fr !important;
  }
  .welcome-header h1 {
    font-size: 1.35rem !important;
  }
}

/* ==========================================
   DUAL LANGUAGE PROGRAMME (DLP) CUSTOM STYLES
   ========================================== */
.dlp-subtext {
  display: block;
  font-size: 0.82em;
  font-style: italic;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.75;
  margin-top: 0.45rem;
  line-height: 1.35;
}

.dlp-choice-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.9rem 0.65rem !important;
  gap: 0.15rem !important;
  line-height: 1.2 !important;
}

.dlp-choice-btn .choice-en {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.dlp-choice-btn .choice-ms {
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.8;
  display: block;
}

@media (max-width: 480px) {
  .dlp-choice-btn .choice-en {
    font-size: 0.95rem;
  }
  .dlp-choice-btn .choice-ms {
    font-size: 0.72rem;
  }
  .dlp-subtext {
    font-size: 0.78em;
    margin-top: 0.35rem;
  }
}

