/* ============================================================
   🌟⭐ ENGLISH STARS - Primary School English Learning App ⭐🌟
   A fun, colorful, child-friendly stylesheet
   For children aged 6-10 🎒📚✏️
   ============================================================ */

/* 🎨🎨🎨 Google Font Import 🎨🎨🎨 */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ============================================================
   🌈 CSS VARIABLES - Color Scheme & Design Tokens 🌈
   ============================================================ */
:root {
  /* 🎨 Primary Colors */
  --color-primary: #6C63FF;
  --color-primary-light: #8B83FF;
  --color-primary-dark: #5A52E0;

  /* 🌟 Accent Colors */
  --color-accent: #FFD93D;
  --color-accent-light: #FFE36D;
  --color-accent-dark: #F0C800;

  /* 🟢 Success / Correct */
  --color-success: #4ECB71;
  --color-success-light: #7EE89D;
  --color-success-dark: #36A854;

  /* 🔴 Error / Wrong */
  --color-error: #FF6B6B;
  --color-error-light: #FF9B9B;
  --color-error-dark: #E04545;

  /* 🟠 Warning */
  --color-warning: #FFA94D;
  --color-warning-light: #FFC078;
  --color-warning-dark: #E08B2E;

  /* 🔵 Info */
  --color-info: #54C7EC;
  --color-info-light: #84D9F2;
  --color-info-dark: #2EADD4;

  /* 🩷 Pink Fun */
  --color-pink: #FF6BB5;
  --color-pink-light: #FF9BD0;
  --color-pink-dark: #E04A96;

  /* 🟣 Purple Fun */
  --color-purple: #A855F7;
  --color-purple-light: #C084FC;
  --color-purple-dark: #8B30E0;

  /* ⬜ Neutrals */
  --color-bg: #F0F4FF;
  --color-bg-card: #FFFFFF;
  --color-bg-dark: #1E1E2E;
  --color-text: #2D2D3F;
  --color-text-light: #6B7280;
  --color-text-white: #FFFFFF;
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;

  /* 🌈 Gradients */
  --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #A855F7 100%);
  --gradient-fun: linear-gradient(135deg, #FF6BB5 0%, #FFD93D 50%, #4ECB71 100%);
  --gradient-sky: linear-gradient(180deg, #54C7EC 0%, #A7E8FF 100%);
  --gradient-sunset: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 100%);
  --gradient-ocean: linear-gradient(135deg, #6C63FF 0%, #54C7EC 100%);
  --gradient-forest: linear-gradient(135deg, #4ECB71 0%, #54C7EC 100%);
  --gradient-candy: linear-gradient(135deg, #FF6BB5 0%, #A855F7 100%);
  --gradient-bg: linear-gradient(135deg, #F0F4FF 0%, #E8EEFF 50%, #FFF0F5 100%);

  /* 📐 Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* 🔵 Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;
  --radius-pill: 9999px;

  /* 🌑 Shadows */
  --shadow-sm: 0 2px 8px rgba(108, 99, 255, 0.08);
  --shadow-md: 0 4px 16px rgba(108, 99, 255, 0.12);
  --shadow-lg: 0 8px 32px rgba(108, 99, 255, 0.16);
  --shadow-xl: 0 12px 48px rgba(108, 99, 255, 0.20);
  --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);
  --shadow-success: 0 4px 16px rgba(78, 203, 113, 0.3);
  --shadow-error: 0 4px 16px rgba(255, 107, 107, 0.3);

  /* ⏱️ Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* 📝 Font */
  --font-family: 'Nunito', 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;
  --font-size-emoji: 3rem;
  --font-size-emoji-lg: 5rem;

  /* 📏 Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 70px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--color-text);
  background: var(--gradient-bg);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  border: none;
  outline: none;
}

/* ============================================================
   🏠 LAYOUT CONTAINERS 🏠
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-lg);
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

.main-content.no-sidebar {
  margin-left: 0;
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page-title {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.page-title .emoji {
  font-size: var(--font-size-emoji);
  vertical-align: middle;
}

/* ============================================================
   🧭 HEADER / NAVIGATION BAR 🧭
   ============================================================ */
.app-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-card);
  border-bottom: 2px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: left var(--transition-normal);
}

.app-header.no-sidebar {
  left: 0;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-primary);
}

.app-header__logo .star {
  font-size: 1.8rem;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.app-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-header__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.app-header__user:hover {
  background: var(--color-border-light);
}

.app-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  font-weight: 800;
}

.app-header__username {
  font-weight: 700;
  font-size: var(--font-size-sm);
}

/* ============================================================
   📋 SIDEBAR - Teacher Navigation 📋
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg-dark);
  color: var(--color-text-white);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-accent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.sidebar__brand .brand-star {
  font-size: 1.6rem;
  animation: twinkle 2s ease-in-out infinite;
}

.sidebar__toggle {
  position: absolute;
  top: var(--space-lg);
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
  border: 2px solid var(--color-bg);
  z-index: 10;
}

.sidebar__toggle:hover {
  transform: scale(1.1);
}

.sidebar__nav {
  flex: 1;
  padding: var(--space-md) 0;
}

.sidebar__section {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: var(--space-md);
  white-space: nowrap;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: var(--font-size-sm);
  border-radius: 0;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-white);
  border-left-color: var(--color-primary-light);
}

.sidebar__link.active {
  background: rgba(108, 99, 255, 0.15);
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

.sidebar__link-icon {
  font-size: 1.3rem;
  min-width: 24px;
  text-align: center;
}

.sidebar__link-text {
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar__link-text,
.sidebar.collapsed .sidebar__section,
.sidebar.collapsed .sidebar__brand span {
  opacity: 0;
  pointer-events: none;
}

.sidebar__footer {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

/* ============================================================
   🔑 LOGIN PAGE 🔑
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-sky);
  position: relative;
  overflow: hidden;
}

/* ☁️ Realistic floating clouds - layered circles for natural cloud shape */
.cloud {
  position: absolute;
  pointer-events: none;
  animation: float-cloud linear infinite;
}

.cloud-shape {
  position: relative;
  opacity: 0.45;
}

.cloud-shape::before,
.cloud-shape::after,
.cloud-shape {
  background: white;
  border-radius: 50%;
}

/* Cloud type 1 - big fluffy cloud */
.cloud-1 .cloud-shape {
  width: 120px;
  height: 50px;
  border-radius: 25px;
}
.cloud-1 .cloud-shape::before {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  top: -35px;
  left: 15px;
}
.cloud-1 .cloud-shape::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  top: -25px;
  left: 55px;
}

/* Cloud type 2 - wide cloud */
.cloud-2 .cloud-shape {
  width: 150px;
  height: 40px;
  border-radius: 20px;
}
.cloud-2 .cloud-shape::before {
  content: '';
  position: absolute;
  width: 55px;
  height: 55px;
  top: -30px;
  left: 25px;
}
.cloud-2 .cloud-shape::after {
  content: '';
  position: absolute;
  width: 65px;
  height: 65px;
  top: -35px;
  left: 65px;
}

/* Cloud type 3 - small puffy cloud */
.cloud-3 .cloud-shape {
  width: 80px;
  height: 35px;
  border-radius: 18px;
}
.cloud-3 .cloud-shape::before {
  content: '';
  position: absolute;
  width: 45px;
  height: 45px;
  top: -22px;
  left: 10px;
}
.cloud-3 .cloud-shape::after {
  content: '';
  position: absolute;
  width: 35px;
  height: 35px;
  top: -18px;
  left: 40px;
}

/* Cloud type 4 - triple bump cloud */
.cloud-4 .cloud-shape {
  width: 180px;
  height: 45px;
  border-radius: 23px;
}
.cloud-4 .cloud-shape::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  top: -32px;
  left: 20px;
}
.cloud-4 .cloud-shape::after {
  content: '';
  position: absolute;
  width: 75px;
  height: 75px;
  top: -40px;
  left: 70px;
}
.cloud-4 .cloud-bump {
  position: absolute;
  width: 45px;
  height: 45px;
  background: white;
  border-radius: 50%;
  top: -20px;
  left: 130px;
  opacity: 0.45;
}

@keyframes float-cloud {
  from { transform: translateX(-250px); }
  to { transform: translateX(calc(100vw + 250px)); }
}

.login-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  position: relative;
  z-index: 1;
  animation: popIn 0.5s var(--transition-bounce);
}

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

.login-card__title {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.login-card__subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
}

.login-card__emoji {
  font-size: var(--font-size-emoji-lg);
  margin-bottom: var(--space-md);
  display: block;
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-10deg); }
}

.login-card__role-select {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.role-btn {
  flex: 1;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

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

.role-btn.active {
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, 0.08);
}

.role-btn__emoji {
  font-size: var(--font-size-emoji);
  display: block;
  margin-bottom: var(--space-xs);
}

.role-btn__label {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

/* 📝 Form Inputs */
.form-group {
  margin-bottom: var(--space-md);
  text-align: left;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  background: var(--color-bg);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12);
  background: var(--color-bg-card);
}

.form-input::placeholder {
  color: var(--color-text-light);
  font-weight: 400;
}

.form-input.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12);
}

.form-input.success {
  border-color: var(--color-success);
}

.form-error {
  color: var(--color-error);
  font-size: var(--font-size-xs);
  margin-top: var(--space-xs);
  font-weight: 600;
}

.form-select {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  transition: all var(--transition-fast);
}

.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.12);
}

/* ============================================================
   🔘 BUTTONS - Fun & Bouncy 🔘
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: all var(--transition-bounce);
  border: none;
  position: relative;
  overflow: hidden;
  user-select: none;
}

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

/* ✨ Shimmer effect on hover */
.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(25deg);
  transition: left 0.5s ease;
  pointer-events: none;
}

.btn:hover::after {
  left: 120%;
}

/* 🟣 Primary Button */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--color-text-white);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(108, 99, 255, 0.45);
}

/* 🟢 Success Button */
.btn-success {
  background: var(--gradient-forest);
  color: var(--color-text-white);
  box-shadow: 0 4px 15px rgba(78, 203, 113, 0.35);
}

.btn-success:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(78, 203, 113, 0.45);
}

/* 🔴 Danger Button */
.btn-danger {
  background: var(--gradient-sunset);
  color: var(--color-text-white);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.35);
}

.btn-danger:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 107, 107, 0.45);
}

/* ⭐ Accent / Fun Button */
.btn-accent {
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: 0 4px 15px rgba(255, 217, 61, 0.4);
}

.btn-accent:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 217, 61, 0.5);
}

/* 🩷 Candy Button */
.btn-candy {
  background: var(--gradient-candy);
  color: var(--color-text-white);
  box-shadow: 0 4px 15px rgba(255, 107, 181, 0.35);
}

.btn-candy:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 107, 181, 0.45);
}

/* ⬜ Outline Button */
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-white);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 📏 Button Sizes */
.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
}

.btn-xl {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-xl);
  border-radius: var(--radius-xl);
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn .btn-emoji {
  font-size: 1.3em;
}

/* ============================================================
   🃏 CARDS - Module & Content Cards 🃏
   ============================================================ */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-text);
}

.card-body {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

.card-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 🎯 Module Card (for learning modules) */
.module-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-bounce);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.module-card.color-purple::before { background: var(--gradient-primary); }
.module-card.color-pink::before { background: var(--gradient-candy); }
.module-card.color-green::before { background: var(--gradient-forest); }
.module-card.color-orange::before { background: var(--gradient-sunset); }
.module-card.color-blue::before { background: var(--gradient-ocean); }

.module-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary-light);
}

.module-card__emoji {
  font-size: var(--font-size-emoji-lg);
  margin-bottom: var(--space-md);
  display: block;
  transition: transform var(--transition-bounce);
}

.module-card:hover .module-card__emoji {
  transform: scale(1.15) rotate(-5deg);
}

.module-card__title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.module-card__description {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

.module-card__locked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(50%);
}

.module-card__locked:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.module-card__lock-icon {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 1.5rem;
}

/* 📐 Card Grid Layouts */
.card-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card-grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.card-grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ============================================================
   📊 PROGRESS BARS - Track Learning Progress 📊
   ============================================================ */
.progress {
  width: 100%;
  height: 16px;
  background: var(--color-border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-primary);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 0;
}

/* ✨ Animated shimmer on progress bar */
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-sm { height: 8px; }
.progress-lg { height: 24px; }

.progress-bar.success { background: var(--gradient-forest); }
.progress-bar.warning { background: var(--gradient-sunset); }
.progress-bar.candy { background: var(--gradient-candy); }

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.progress-percentage {
  color: var(--color-primary);
  font-weight: 800;
}

/* 🌟 Star Progress (for XP / level) */
.star-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.star-progress__stars {
  display: flex;
  gap: 2px;
}

.star-progress__star {
  font-size: 1.4rem;
  transition: transform var(--transition-bounce);
}

.star-progress__star.filled {
  animation: starPop 0.3s ease forwards;
}

@keyframes starPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.star-progress__star.empty {
  opacity: 0.25;
}

/* ============================================================
   🏅 BADGES DISPLAY GRID 🏅
   ============================================================ */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--space-md);
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 2px solid var(--color-border-light);
  transition: all var(--transition-bounce);
  cursor: default;
}

.badge-item:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-md);
}

.badge-item__icon {
  font-size: var(--font-size-emoji);
  margin-bottom: var(--space-xs);
  transition: transform var(--transition-bounce);
}

.badge-item:hover .badge-item__icon {
  transform: rotate(-10deg) scale(1.15);
}

.badge-item__name {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text);
}

.badge-item__date {
  font-size: 0.65rem;
  color: var(--color-text-light);
}

.badge-item.locked {
  opacity: 0.35;
  filter: grayscale(100%);
}

.badge-item.locked:hover {
  transform: none;
  box-shadow: none;
}

.badge-item.new {
  border-color: var(--color-accent);
  background: rgba(255, 217, 61, 0.08);
  animation: badgeGlow 2s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 217, 61, 0.2); }
  50% { box-shadow: 0 0 20px rgba(255, 217, 61, 0.5); }
}

/* ============================================================
   🃏 FLASHCARD FLIP ANIMATION 🃏
   ============================================================ */
.flashcard-container {
  perspective: 1000px;
  width: 320px;
  height: 220px;
  margin: 0 auto;
  cursor: pointer;
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard__front,
.flashcard__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  border: 3px solid transparent;
}

.flashcard__front {
  background: var(--gradient-primary);
  color: var(--color-text-white);
}

.flashcard__back {
  background: var(--color-bg-card);
  color: var(--color-text);
  transform: rotateY(180deg);
  border-color: var(--color-primary-light);
}

.flashcard__emoji {
  font-size: var(--font-size-emoji-lg);
  margin-bottom: var(--space-sm);
}

.flashcard__word {
  font-size: var(--font-size-2xl);
  font-weight: 900;
}

.flashcard__translation {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

.flashcard__hint {
  font-size: var(--font-size-sm);
  opacity: 0.7;
  margin-top: var(--space-md);
}

/* 📚 Flashcard deck (stacked look) */
.flashcard-deck {
  position: relative;
  width: 320px;
  height: 220px;
  margin: 0 auto;
}

.flashcard-deck::before,
.flashcard-deck::after {
  content: '';
  position: absolute;
  border-radius: var(--radius-xl);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm);
}

.flashcard-deck::before {
  inset: 6px 8px -6px 8px;
  z-index: -1;
  opacity: 0.6;
}

.flashcard-deck::after {
  inset: 12px 16px -12px 16px;
  z-index: -2;
  opacity: 0.3;
}

/* ============================================================
   ✅❌ MULTIPLE CHOICE BUTTONS ✅❌
   ============================================================ */
.mc-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  max-width: 600px;
  margin: 0 auto;
}

.mc-option {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 3px solid var(--color-border);
  background: var(--color-bg-card);
  cursor: pointer;
  transition: all var(--transition-bounce);
  font-weight: 700;
  font-size: var(--font-size-lg);
  text-align: center;
  position: relative;
  user-select: none;
}

.mc-option:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: rgba(108, 99, 255, 0.04);
}

.mc-option:active {
  transform: scale(0.97);
}

.mc-option__letter {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 800;
  color: var(--color-text-light);
}

.mc-option.selected {
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, 0.08);
}

.mc-option.correct {
  border-color: var(--color-success);
  background: rgba(78, 203, 113, 0.1);
  box-shadow: var(--shadow-success);
  animation: bounceCorrect 0.5s ease;
}

.mc-option.wrong {
  border-color: var(--color-error);
  background: rgba(255, 107, 107, 0.1);
  box-shadow: var(--shadow-error);
  animation: shakeWrong 0.5s ease;
}

/* ============================================================
   🎉 SUCCESS & ERROR FEEDBACK ANIMATIONS 🎉
   ============================================================ */

/* ✅ Bounce animation for correct answers */
@keyframes bounceCorrect {
  0% { transform: scale(1); }
  20% { transform: scale(1.08); }
  40% { transform: scale(0.96); }
  60% { transform: scale(1.04); }
  80% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* ❌ Shake animation for wrong answers */
@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px); }
  30% { transform: translateX(10px); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
  90% { transform: translateX(4px); }
}

.animate-bounce {
  animation: bounceCorrect 0.5s ease;
}

.animate-shake {
  animation: shakeWrong 0.5s ease;
}

/* 🎆 Big celebration bounce */
@keyframes celebrateBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-celebrate {
  animation: celebrateBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ✨ Pulse glow for highlighting */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(108, 99, 255, 0.2); }
  50% { box-shadow: 0 0 25px rgba(108, 99, 255, 0.5); }
}

.animate-pulse-glow {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

/* 🌟 Tada for achievements */
@keyframes tada {
  0% { transform: scale(1) rotate(0deg); }
  10%, 20% { transform: scale(0.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.animate-tada {
  animation: tada 0.8s ease-in-out;
}

/* ============================================================
   🎊 CONFETTI CELEBRATION (CSS Only) 🎊
   ============================================================ */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

/* 🟥🟦🟨🟩🟪 Confetti colors */
.confetti-piece:nth-child(5n+1) { background: var(--color-error); }
.confetti-piece:nth-child(5n+2) { background: var(--color-info); }
.confetti-piece:nth-child(5n+3) { background: var(--color-accent); }
.confetti-piece:nth-child(5n+4) { background: var(--color-success); }
.confetti-piece:nth-child(5n+5) { background: var(--color-pink); }

/* 🎊 Position & timing variations */
.confetti-piece:nth-child(1)  { left: 5%;  animation-duration: 2.5s; animation-delay: 0s; }
.confetti-piece:nth-child(2)  { left: 12%; animation-duration: 3.0s; animation-delay: 0.1s; }
.confetti-piece:nth-child(3)  { left: 20%; animation-duration: 2.2s; animation-delay: 0.2s; }
.confetti-piece:nth-child(4)  { left: 28%; animation-duration: 2.8s; animation-delay: 0.05s; }
.confetti-piece:nth-child(5)  { left: 35%; animation-duration: 2.4s; animation-delay: 0.3s; }
.confetti-piece:nth-child(6)  { left: 42%; animation-duration: 3.1s; animation-delay: 0.15s; }
.confetti-piece:nth-child(7)  { left: 50%; animation-duration: 2.6s; animation-delay: 0.25s; }
.confetti-piece:nth-child(8)  { left: 57%; animation-duration: 2.3s; animation-delay: 0.1s; }
.confetti-piece:nth-child(9)  { left: 65%; animation-duration: 2.9s; animation-delay: 0.35s; }
.confetti-piece:nth-child(10) { left: 72%; animation-duration: 2.1s; animation-delay: 0.2s; }
.confetti-piece:nth-child(11) { left: 80%; animation-duration: 2.7s; animation-delay: 0.05s; }
.confetti-piece:nth-child(12) { left: 88%; animation-duration: 3.2s; animation-delay: 0.3s; }
.confetti-piece:nth-child(13) { left: 95%; animation-duration: 2.5s; animation-delay: 0.15s; }
.confetti-piece:nth-child(14) { left: 8%;  animation-duration: 2.8s; animation-delay: 0.4s; }
.confetti-piece:nth-child(15) { left: 45%; animation-duration: 2.3s; animation-delay: 0.45s; }
.confetti-piece:nth-child(16) { left: 60%; animation-duration: 3.0s; animation-delay: 0.1s; }
.confetti-piece:nth-child(17) { left: 75%; animation-duration: 2.6s; animation-delay: 0.35s; }
.confetti-piece:nth-child(18) { left: 30%; animation-duration: 2.4s; animation-delay: 0.5s; }
.confetti-piece:nth-child(19) { left: 18%; animation-duration: 2.9s; animation-delay: 0.2s; }
.confetti-piece:nth-child(20) { left: 85%; animation-duration: 2.2s; animation-delay: 0.4s; }

/* 🎊 Size & shape variations */
.confetti-piece:nth-child(odd) {
  width: 10px;
  height: 14px;
  border-radius: 50% 0;
}

.confetti-piece:nth-child(3n) {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

@keyframes confettiFall {
  0% {
    top: -5%;
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  25% {
    transform: rotate(180deg) translateX(25px) scale(0.9);
  }
  50% {
    transform: rotate(360deg) translateX(-15px) scale(1);
  }
  75% {
    transform: rotate(540deg) translateX(20px) scale(0.8);
    opacity: 0.7;
  }
  100% {
    top: 105%;
    transform: rotate(720deg) translateX(-10px) scale(0.6);
    opacity: 0;
  }
}

/* ============================================================
   🎯 DRAG & DROP EXERCISE STYLING 🎯
   ============================================================ */
.dnd-zone {
  min-height: 80px;
  border: 3px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  background: var(--color-bg);
}

.dnd-zone.drag-over {
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, 0.06);
  box-shadow: inset 0 0 20px rgba(108, 99, 255, 0.08);
  transform: scale(1.01);
}

.dnd-zone.filled {
  border-style: solid;
  border-color: var(--color-success);
  background: rgba(78, 203, 113, 0.05);
}

.dnd-zone__placeholder {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.dnd-item {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  font-weight: 700;
  font-size: var(--font-size-md);
  cursor: grab;
  user-select: none;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-sm);
}

.dnd-item:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.dnd-item:active,
.dnd-item.dragging {
  cursor: grabbing;
  transform: scale(1.08) rotate(2deg);
  box-shadow: var(--shadow-lg);
  opacity: 0.85;
  z-index: 100;
}

.dnd-item.placed {
  background: rgba(108, 99, 255, 0.08);
  border-color: var(--color-primary);
}

.dnd-item.correct {
  background: rgba(78, 203, 113, 0.12);
  border-color: var(--color-success);
}

.dnd-item.wrong {
  background: rgba(255, 107, 107, 0.12);
  border-color: var(--color-error);
  animation: shakeWrong 0.5s ease;
}

/* 🔀 Word ordering sentence builder */
.sentence-builder {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  min-height: 60px;
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border-light);
  margin-bottom: var(--space-md);
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
  justify-content: center;
}

/* ============================================================
   💬 MODAL DIALOGS 💬
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.8) translateY(20px);
  transition: transform var(--transition-bounce);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
  border: none;
  color: var(--color-text-light);
}

.modal__close:hover {
  background: var(--color-error-light);
  color: var(--color-error-dark);
  transform: rotate(90deg);
}

.modal__emoji {
  text-align: center;
  font-size: var(--font-size-emoji-lg);
  margin-bottom: var(--space-md);
  display: block;
}

.modal__title {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: 900;
  margin-bottom: var(--space-sm);
}

.modal__text {
  text-align: center;
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
}

.modal__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* 🏆 Achievement Modal (special) */
.modal.achievement {
  text-align: center;
  background: linear-gradient(180deg, #FFFDE7 0%, #FFFFFF 50%);
  border: 3px solid var(--color-accent);
}

.modal.achievement .modal__emoji {
  animation: tada 0.8s ease-in-out;
}

/* ============================================================
   📊 TABLES - Teacher Dashboard Views 📊
   ============================================================ */
.table-container {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-weight: 800;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-light);
}

.table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm);
  vertical-align: middle;
}

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

.table tr:hover td {
  background: rgba(108, 99, 255, 0.02);
}

.table__avatar-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.table__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.table__name {
  font-weight: 700;
}

/* 🏷️ Status badges in tables */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.status-badge.active {
  background: rgba(78, 203, 113, 0.12);
  color: var(--color-success-dark);
}

.status-badge.inactive {
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-text-light);
}

.status-badge.warning {
  background: rgba(255, 169, 77, 0.12);
  color: var(--color-warning-dark);
}

/* ============================================================
   ⭐🔥 STAR & STREAK COUNTERS ⭐🔥
   ============================================================ */
.counter-group {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.counter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-border-light);
}

.counter__icon {
  font-size: 1.5rem;
}

.counter__value {
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-text);
}

.counter__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  font-weight: 600;
}

/* 🔥 Streak counter with fire animation */
.counter.streak .counter__icon {
  animation: fireFlicker 0.8s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  0% { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.1) rotate(3deg); }
}

/* ⭐ XP Star counter */
.counter.xp {
  border-color: var(--color-accent);
  background: rgba(255, 217, 61, 0.06);
}

/* 💎 Gem counter */
.counter.gems {
  border-color: var(--color-info);
  background: rgba(84, 199, 236, 0.06);
}

/* 🏆 Level display */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: var(--color-text-white);
  font-weight: 900;
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-glow);
  position: relative;
}

.level-badge::after {
  content: 'LVL';
  position: absolute;
  bottom: -14px;
  font-size: 0.5rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 1px;
}

/* ============================================================
   👨‍🏫 TEACHER DASHBOARD 👨‍🏫
   ============================================================ */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-left: 4px solid var(--color-primary);
  transition: all var(--transition-normal);
}

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

.stat-card.purple { border-left-color: var(--color-purple); }
.stat-card.pink { border-left-color: var(--color-pink); }
.stat-card.green { border-left-color: var(--color-success); }
.stat-card.orange { border-left-color: var(--color-warning); }
.stat-card.blue { border-left-color: var(--color-info); }

.stat-card__icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.stat-card__info {
  flex: 1;
}

.stat-card__value {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  line-height: 1;
  color: var(--color-text);
}

.stat-card__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  font-weight: 600;
}

/* 📋 Teacher class list */
.class-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.class-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

/* ============================================================
   👦👧 STUDENT DASHBOARD 👦👧
   ============================================================ */
.student-welcome {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.student-welcome__greeting {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.student-welcome__name {
  color: var(--color-primary);
}

.student-welcome__message {
  font-size: var(--font-size-md);
  color: var(--color-text-light);
  margin-bottom: var(--space-lg);
}

/* 🗓️ Daily challenge banner */
.daily-challenge {
  background: var(--gradient-fun);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.daily-challenge::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.daily-challenge__emoji {
  font-size: var(--font-size-emoji-lg);
  z-index: 1;
}

.daily-challenge__content {
  z-index: 1;
}

.daily-challenge__title {
  font-size: var(--font-size-xl);
  font-weight: 900;
}

.daily-challenge__text {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

/* ============================================================
   😀 EMOJI DISPLAY - Large & Fun 😀
   ============================================================ */
.emoji-display {
  font-size: var(--font-size-emoji-lg);
  line-height: 1;
  text-align: center;
}

.emoji-display.sm { font-size: var(--font-size-emoji); }
.emoji-display.lg { font-size: 6rem; }
.emoji-display.xl { font-size: 8rem; }

/* 😃 Emoji with bounce hover */
.emoji-bounce {
  display: inline-block;
  transition: transform var(--transition-bounce);
  cursor: default;
}

.emoji-bounce:hover {
  transform: scale(1.2) rotate(-5deg);
}

/* 🎭 Emoji result indicator */
.result-emoji {
  font-size: 5rem;
  text-align: center;
  margin: var(--space-lg) 0;
  animation: celebrateBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================
   🌈 FUN GRADIENT BACKGROUNDS 🌈
   ============================================================ */
.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-fun { background: var(--gradient-fun); }
.bg-gradient-sky { background: var(--gradient-sky); }
.bg-gradient-sunset { background: var(--gradient-sunset); }
.bg-gradient-ocean { background: var(--gradient-ocean); }
.bg-gradient-forest { background: var(--gradient-forest); }
.bg-gradient-candy { background: var(--gradient-candy); }

/* 🌊 Animated gradient background */
.bg-animated {
  background: linear-gradient(-45deg, #6C63FF, #FF6BB5, #FFD93D, #4ECB71);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   🔔 NOTIFICATIONS & TOASTS 🔔
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-left: 4px solid var(--color-primary);
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-error); }
.toast.warning { border-left-color: var(--color-warning); }

.toast__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast__text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  flex: 1;
}

.toast__close {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  font-size: 1.2rem;
  background: none;
  border: none;
}

.toast__close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ============================================================
   🏷️ TAGS & CHIPS 🏷️
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 700;
  background: rgba(108, 99, 255, 0.1);
  color: var(--color-primary);
}

.tag.green { background: rgba(78, 203, 113, 0.1); color: var(--color-success-dark); }
.tag.red { background: rgba(255, 107, 107, 0.1); color: var(--color-error-dark); }
.tag.orange { background: rgba(255, 169, 77, 0.1); color: var(--color-warning-dark); }
.tag.pink { background: rgba(255, 107, 181, 0.1); color: var(--color-pink-dark); }
.tag.blue { background: rgba(84, 199, 236, 0.1); color: var(--color-info-dark); }

/* ============================================================
   📖 EXERCISE / QUIZ LAYOUT 📖
   ============================================================ */
.exercise-container {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-xl);
}

.exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.exercise-header__progress {
  flex: 1;
  margin: 0 var(--space-lg);
}

.exercise-header__counter {
  font-weight: 800;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  white-space: nowrap;
}

.exercise-question {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.exercise-question__text {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.exercise-question__hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  font-style: italic;
}

.exercise-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* 📝 Fill in the blank */
.fill-blank {
  display: inline-block;
  min-width: 120px;
  border-bottom: 3px solid var(--color-primary);
  padding: var(--space-xs) var(--space-sm);
  margin: 0 var(--space-xs);
  font-size: var(--font-size-xl);
  font-weight: 700;
  text-align: center;
  color: var(--color-primary);
  background: transparent;
  transition: border-color var(--transition-fast);
}

.fill-blank:focus {
  border-color: var(--color-primary-dark);
  outline: none;
}

.fill-blank.correct {
  border-color: var(--color-success);
  color: var(--color-success-dark);
}

.fill-blank.wrong {
  border-color: var(--color-error);
  color: var(--color-error-dark);
  animation: shakeWrong 0.5s ease;
}

/* ============================================================
   🌟 LEADERBOARD 🌟
   ============================================================ */
.leaderboard {
  max-width: 500px;
  margin: 0 auto;
}

.leaderboard__podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding: var(--space-xl) 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.podium-place__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
  border: 3px solid var(--color-accent);
}

.podium-place.first .podium-place__avatar {
  width: 72px;
  height: 72px;
  font-size: 2rem;
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.4);
}

.podium-place__name {
  font-weight: 800;
  font-size: var(--font-size-sm);
}

.podium-place__score {
  font-weight: 600;
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

.podium-place__bar {
  width: 80px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--gradient-primary);
  margin-top: var(--space-sm);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-text-white);
}

.podium-place.first .podium-place__bar { height: 120px; background: var(--gradient-candy); }
.podium-place.second .podium-place__bar { height: 85px; }
.podium-place.third .podium-place__bar { height: 60px; background: var(--gradient-ocean); }

.leaderboard__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.leaderboard__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.leaderboard__item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.leaderboard__rank {
  font-weight: 900;
  font-size: var(--font-size-md);
  min-width: 30px;
  text-align: center;
  color: var(--color-text-light);
}

.leaderboard__item-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.leaderboard__item-name {
  flex: 1;
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.leaderboard__item-score {
  font-weight: 800;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
}

/* ============================================================
   🔄 LOADING SPINNERS & SKELETON SCREENS 🔄
   ============================================================ */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner.sm { width: 20px; height: 20px; border-width: 3px; }
.spinner.lg { width: 60px; height: 60px; border-width: 5px; }

/* ⭐ Fun star spinner */
.spinner-stars {
  font-size: 2rem;
  animation: spin 1.5s linear infinite;
  display: inline-block;
}

/* 💀 Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-border-light) 25%,
    var(--color-bg) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-text { height: 16px; margin-bottom: var(--space-sm); }
.skeleton-title { height: 24px; width: 60%; margin-bottom: var(--space-md); }
.skeleton-avatar { width: 48px; height: 48px; border-radius: var(--radius-full); }
.skeleton-card { height: 180px; }
.skeleton-btn { height: 44px; width: 120px; border-radius: var(--radius-pill); }

/* ============================================================
   🎨 UTILITY CLASSES 🎨
   ============================================================ */

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--color-text-light); }
.text-white { color: var(--color-text-white); }
.text-bold { font-weight: 800; }
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

/* Spacing */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Borders */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* ============================================================
   📱 RESPONSIVE DESIGN - Tablet & Mobile 📱
   ============================================================ */

/* 📱 Tablet breakpoint (768px) */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --header-height: 60px;
    --font-size-3xl: 2rem;
    --font-size-2xl: 1.5rem;
    --font-size-emoji-lg: 4rem;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: 260px;
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-md);
  }

  .app-header {
    left: 0;
    padding: 0 var(--space-md);
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .mc-options {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .flashcard-container,
  .flashcard-deck {
    width: 280px;
    height: 190px;
  }

  .daily-challenge {
    flex-direction: column;
    text-align: center;
  }

  .modal {
    padding: var(--space-xl);
    width: 95%;
  }

  .counter-group {
    justify-content: center;
  }

  .leaderboard__podium {
    gap: var(--space-sm);
  }

  .podium-place__bar { width: 60px; }
  .podium-place.first .podium-place__bar { height: 90px; }
  .podium-place.second .podium-place__bar { height: 65px; }
  .podium-place.third .podium-place__bar { height: 45px; }

  /* 📋 Responsive table */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th, .table td {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-xs);
  }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    top: auto;
    bottom: var(--space-lg);
  }

  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* 📱 Small mobile (480px) */
@media (max-width: 480px) {
  :root {
    --font-size-3xl: 1.75rem;
    --font-size-emoji-lg: 3rem;
  }

  body {
    font-size: 14px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .login-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .login-card__role-select {
    flex-direction: column;
  }

  .btn-xl {
    font-size: var(--font-size-lg);
    padding: var(--space-md) var(--space-xl);
  }

  .exercise-container {
    padding: var(--space-md);
  }

  .exercise-question__text {
    font-size: var(--font-size-lg);
  }

  .modal__actions {
    flex-direction: column;
  }

  .modal__actions .btn {
    width: 100%;
  }
}

/* 🖥️ Large screens (1200px+) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   ♿ ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 🎯 Focus visible styles */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
.btn:focus-visible {
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.3);
}

/* ============================================================
   🖨️ PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .app-header,
  .toast-container,
  .confetti-container,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

/* ============================================================
   🌙 END OF ENGLISH STARS STYLESHEET 🌙
   Total: 1000+ lines of colorful, child-friendly CSS!
   Made with love for young English learners! 💛
   ============================================================ */
