/*
Theme Name: Happy Learning
Theme URI: https://happylearning.in
Author: Happy Learning Team
Author URI: https://happylearning.in
Description: A gamified Social Science learning platform for students in Grades 7–10. Supports English and Tamil.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: happy-learning
Tags: education, gamification, bilingual, mobile-first, students
*/

/* ============================================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================================ */
:root {
  /* Primary Palette */
  --hl-green:        #2ECC71;
  --hl-green-dark:   #27AE60;
  --hl-green-light:  #A8E6CF;
  --hl-green-bg:     #F0FAF4;

  /* Subject Colors */
  --color-history:   #F4A623;
  --color-geography: #2ECC71;
  --color-civics:    #9B59B6;
  --color-economics: #E74C3C;
  --color-blue:      #5B9BD5;

  /* Neutral */
  --hl-white:        #FFFFFF;
  --hl-bg:           #F4F7F4;
  --hl-bg-card:      #FFFFFF;
  --hl-text:         #1A1A2E;
  --hl-text-muted:   #6B7280;
  --hl-border:       #E5E7EB;
  --hl-shadow:       0 4px 20px rgba(0,0,0,0.08);
  --hl-shadow-hover: 0 8px 32px rgba(46,204,113,0.18);

  /* Gamification */
  --hl-gold:         #F4A623;
  --hl-gold-light:   #FFF4D9;
  --hl-star:         #FFD700;
  --hl-xp:          #FF6B6B;

  /* Typography */
  --font-display:    'Nunito', 'Segoe UI', sans-serif;
  --font-body:       'Nunito', 'Segoe UI', sans-serif;
  --font-tamil:      'Noto Sans Tamil', sans-serif;

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

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--hl-bg);
  color: var(--hl-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.lang-tamil {
  font-family: var(--font-tamil), var(--font-body);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--hl-green-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--hl-green); }
button, input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ============================================================
   GOOGLE FONTS IMPORT
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Noto+Sans+Tamil:wght@400;600;700;800&display=swap');

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.hl-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--hl-white);
  position: relative;
  overflow: hidden;
}

.hl-page {
  display: none;
  min-height: 100vh;
  padding-bottom: 80px;
}

.hl-page.active { display: block; }

/* ============================================================
   TOP NAV BAR
   ============================================================ */
.hl-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hl-white);
  padding: 14px var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--hl-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.hl-topbar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--hl-text);
}

.hl-back-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--hl-bg);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--hl-text);
  transition: var(--transition);
}

.hl-back-btn:hover { background: var(--hl-green-light); }

.hl-points-badge {
  display: flex; align-items: center; gap: 4px;
  background: var(--hl-gold-light);
  border: 2px solid var(--hl-gold);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-weight: 800;
  font-size: 14px;
  color: #B8860B;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.hl-bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--hl-white);
  border-top: 2px solid var(--hl-border);
  display: flex;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.hl-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 0 8px;
  cursor: pointer;
  border: none; background: none;
  color: var(--hl-text-muted);
  font-size: 11px; font-weight: 600;
  font-family: inherit;
  gap: 4px;
  transition: var(--transition);
}

.hl-nav-item .nav-icon { font-size: 22px; }
.hl-nav-item.active { color: var(--hl-green-dark); }
.hl-nav-item.active .nav-icon { transform: scale(1.15); }

/* ============================================================
   PAGE 1: LOGIN / HOME
   ============================================================ */
.hl-login-page {
  background: linear-gradient(160deg, #F0FAF4 0%, #E8F5E9 50%, #F0FAF4 100%);
  padding: var(--space-lg) var(--space-md);
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center;
}

.hl-login-logo {
  text-align: center;
  margin-bottom: var(--space-md);
}

.hl-login-logo h1 {
  font-size: 32px;
  font-weight: 900;
  color: var(--hl-green-dark);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.hl-login-logo .subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--hl-green);
  margin-top: 4px;
}

.hl-hero-image {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(46,204,113,0.2);
  margin: 0 auto var(--space-lg);
}

.hl-hero-image img { width: 100%; object-fit: cover; }

/* Language Toggle */
.hl-lang-toggle {
  background: var(--hl-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  width: 100%;
  margin-bottom: var(--space-md);
  box-shadow: var(--hl-shadow);
}

.hl-lang-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--hl-text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.hl-lang-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

.hl-lang-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--hl-border);
  background: var(--hl-white);
  cursor: pointer;
  font-size: 15px; font-weight: 700;
  color: var(--hl-text-muted);
  transition: var(--transition);
  font-family: inherit;
}

.hl-lang-btn .lang-check {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 2px solid var(--hl-border);
  background: var(--hl-white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: var(--transition);
}

.hl-lang-btn.selected {
  border-color: var(--hl-green);
  color: var(--hl-green-dark);
  background: var(--hl-green-bg);
}

.hl-lang-btn.selected .lang-check {
  background: var(--hl-green);
  border-color: var(--hl-green);
  color: var(--hl-white);
}

/* Login Buttons */
.hl-login-buttons {
  width: 100%;
  display: flex; flex-direction: column; gap: 10px;
}

.hl-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  font-size: 16px; font-weight: 800;
  font-family: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.hl-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition);
}

.hl-btn:hover::after { background: rgba(255,255,255,0.12); }
.hl-btn:active { transform: scale(0.97); }

.hl-btn-primary {
  background: linear-gradient(135deg, var(--hl-green) 0%, var(--hl-green-dark) 100%);
  color: var(--hl-white);
  box-shadow: 0 4px 16px rgba(46,204,113,0.35);
}

.hl-btn-primary:hover { box-shadow: 0 6px 24px rgba(46,204,113,0.45); }

.hl-btn-secondary {
  background: var(--hl-white);
  color: var(--hl-green-dark);
  border: 2px solid var(--hl-green);
  box-shadow: none;
}

.hl-btn-ghost {
  background: transparent;
  color: var(--hl-text-muted);
  font-size: 14px;
}

.hl-btn-google {
  background: var(--hl-white);
  color: var(--hl-text);
  border: 2px solid var(--hl-border);
  box-shadow: var(--hl-shadow);
}

.hl-btn-danger {
  background: linear-gradient(135deg, #E74C3C, #C0392B);
  color: var(--hl-white);
  box-shadow: 0 4px 16px rgba(231,76,60,0.3);
}

.hl-btn-gold {
  background: linear-gradient(135deg, var(--hl-gold), #E67E22);
  color: var(--hl-white);
  box-shadow: 0 4px 16px rgba(244,166,35,0.35);
}

.hl-btn-sm {
  padding: 10px 20px;
  font-size: 14px;
}

/* ============================================================
   FORM CARD
   ============================================================ */
.hl-form-card {
  background: var(--hl-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--hl-shadow);
  width: 100%;
  margin-bottom: var(--space-md);
}

.hl-form-title {
  font-size: 22px; font-weight: 900;
  color: var(--hl-text);
  margin-bottom: 4px;
}

.hl-form-subtitle {
  font-size: 13px; color: var(--hl-text-muted);
  margin-bottom: var(--space-lg);
}

.hl-field {
  margin-bottom: var(--space-md);
}

.hl-field label {
  display: block;
  font-size: 13px; font-weight: 700;
  color: var(--hl-text);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.hl-field input,
.hl-field select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--hl-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--hl-text);
  background: var(--hl-bg);
  transition: var(--transition);
  outline: none;
}

.hl-field input:focus,
.hl-field select:focus {
  border-color: var(--hl-green);
  background: var(--hl-white);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.12);
}

.hl-field .field-error {
  display: none;
  color: #E74C3C;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.hl-field.has-error input,
.hl-field.has-error select { border-color: #E74C3C; }
.hl-field.has-error .field-error { display: block; }

/* ============================================================
   PAGE 2: SUBJECT SELECTION
   ============================================================ */
.hl-subjects-page {
  padding: var(--space-md);
}

.hl-greeting {
  padding: var(--space-lg) var(--space-md) var(--space-md);
}

.hl-greeting-name {
  font-size: 26px; font-weight: 900;
  color: var(--hl-text);
  line-height: 1.1;
}

.hl-greeting-grade {
  font-size: 14px; font-weight: 700;
  color: var(--hl-green-dark);
  margin-top: 4px;
}

.hl-section-title {
  font-size: 22px; font-weight: 900;
  color: var(--hl-text);
  margin-bottom: 4px;
  padding: 0 var(--space-md);
}

.hl-section-sub {
  font-size: 13px;
  color: var(--hl-text-muted);
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-md);
}

/* Subject Grid */
.hl-subjects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 var(--space-md);
}

.hl-subject-card {
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.hl-subject-card:hover { transform: translateY(-3px) scale(1.02); }
.hl-subject-card:active { transform: scale(0.97); }

.hl-subject-card[data-subject="history"]   { background: linear-gradient(145deg, #F9C74F, var(--color-history)); }
.hl-subject-card[data-subject="geography"] { background: linear-gradient(145deg, #52D68A, var(--color-geography)); }
.hl-subject-card[data-subject="civics"]    { background: linear-gradient(145deg, #B57BEE, var(--color-civics)); }
.hl-subject-card[data-subject="economics"] { background: linear-gradient(145deg, #FF7E7E, var(--color-economics)); }

.hl-subject-icon-box {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}

.hl-subject-name {
  font-size: 20px; font-weight: 900;
  color: var(--hl-white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
  line-height: 1.2;
}

.hl-subject-count {
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.85);
}

/* ============================================================
   PAGE 3: LESSON LIST
   ============================================================ */
.hl-lessons-page {
  padding-bottom: 80px;
}

.hl-progress-bar-wrap {
  padding: var(--space-md) var(--space-md) 0;
}

.hl-progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 700;
  color: var(--hl-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.hl-progress-track {
  background: var(--hl-border);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.hl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hl-green), var(--hl-green-dark));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hl-lessons-list {
  padding: var(--space-md);
  display: flex; flex-direction: column; gap: 10px;
}

.hl-lesson-card {
  background: var(--hl-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex; align-items: center; gap: var(--space-md);
  cursor: pointer;
  box-shadow: var(--hl-shadow);
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.hl-lesson-card:hover {
  border-color: var(--hl-green-light);
  box-shadow: var(--hl-shadow-hover);
  transform: translateX(4px);
}

.hl-lesson-play-btn {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--hl-green-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: var(--transition);
}

.hl-lesson-card.completed .hl-lesson-play-btn {
  background: var(--hl-green);
}

.hl-lesson-info { flex: 1; min-width: 0; }

.hl-lesson-title {
  font-size: 15px; font-weight: 800;
  color: var(--hl-text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.hl-lesson-status {
  font-size: 12px; font-weight: 700;
  color: var(--hl-text-muted);
}

.hl-lesson-card.completed .hl-lesson-status { color: var(--hl-green-dark); }

.hl-lesson-arrow {
  font-size: 18px;
  color: var(--hl-text-muted);
  flex-shrink: 0;
}

/* ============================================================
   PAGE 4: LESSON DETAIL
   ============================================================ */
.hl-lesson-page {
  padding-bottom: 100px;
}

.hl-video-container {
  position: relative;
  width: 100%;
  background: #000;
}

.hl-video-container iframe,
.hl-video-container video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  border: none;
}

/* Language Tabs for Videos */
.hl-video-tabs {
  display: flex;
  background: var(--hl-bg);
  border-bottom: 2px solid var(--hl-border);
}

.hl-video-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px; font-weight: 700;
  color: var(--hl-text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.hl-video-tab.active {
  color: var(--hl-green-dark);
  border-bottom-color: var(--hl-green);
}

/* Lesson Content */
.hl-lesson-content {
  padding: var(--space-md);
}

.hl-lesson-hero-title {
  font-size: 24px; font-weight: 900;
  color: var(--hl-text);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.hl-lesson-desc {
  font-size: 14px;
  color: var(--hl-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

/* Points Banner */
.hl-points-banner {
  background: var(--hl-gold-light);
  border: 2px solid var(--hl-gold);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--space-md);
  font-size: 14px; font-weight: 800;
  color: #B8860B;
}

/* Complete & Quiz Buttons */
.hl-lesson-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 var(--space-md) var(--space-md);
}

.hl-btn-complete {
  background: linear-gradient(135deg, var(--hl-green) 0%, var(--hl-green-dark) 100%);
  color: var(--hl-white);
  border-radius: var(--radius-full);
  border: none;
  padding: 18px;
  font-size: 17px; font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(46,204,113,0.35);
  transition: var(--transition);
  width: 100%;
}

.hl-btn-complete.completed {
  background: linear-gradient(135deg, #95E1B3, var(--hl-green-light));
  color: var(--hl-green-dark);
  box-shadow: none;
  cursor: default;
}

.hl-btn-quiz {
  background: var(--hl-white);
  color: var(--hl-text-muted);
  border: 2px solid var(--hl-border);
  border-radius: var(--radius-full);
  padding: 16px;
  font-size: 16px; font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
  width: 100%;
}

.hl-btn-quiz.enabled {
  background: linear-gradient(135deg, #667EEA, #764BA2);
  color: var(--hl-white);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(102,126,234,0.35);
}

/* ============================================================
   QUIZ SYSTEM
   ============================================================ */
.hl-quiz-page {
  padding: var(--space-md);
  padding-bottom: 100px;
}

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

.hl-quiz-progress-text {
  font-size: 14px; font-weight: 800;
  color: var(--hl-green-dark);
}

.hl-quiz-progress-dots {
  display: flex; gap: 4px;
}

.hl-quiz-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--hl-border);
  transition: var(--transition);
}

.hl-quiz-dot.done { background: var(--hl-green); }
.hl-quiz-dot.current { background: var(--hl-green-dark); transform: scale(1.3); }

.hl-question-card {
  background: var(--hl-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--hl-shadow);
  margin-bottom: var(--space-md);
}

.hl-question-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.hl-badge-mcq   { background: #E8F5E9; color: var(--hl-green-dark); }
.hl-badge-fill  { background: #E3F2FD; color: #1565C0; }
.hl-badge-match { background: #F3E5F5; color: #6A1B9A; }

.hl-question-text {
  font-size: 18px; font-weight: 800;
  color: var(--hl-text);
  line-height: 1.4;
  margin-bottom: var(--space-lg);
}

/* MCQ Options */
.hl-mcq-options {
  display: flex; flex-direction: column; gap: 10px;
}

.hl-mcq-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--hl-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background: var(--hl-white);
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  color: var(--hl-text);
  text-align: left;
  width: 100%;
}

.hl-mcq-option:hover { border-color: var(--hl-green); background: var(--hl-green-bg); }

.hl-mcq-option .option-letter {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--hl-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  flex-shrink: 0;
  transition: var(--transition);
}

.hl-mcq-option.correct {
  border-color: var(--hl-green);
  background: var(--hl-green-bg);
  color: var(--hl-green-dark);
}

.hl-mcq-option.correct .option-letter {
  background: var(--hl-green);
  color: var(--hl-white);
}

.hl-mcq-option.wrong {
  border-color: #E74C3C;
  background: #FEF2F2;
  color: #C0392B;
}

.hl-mcq-option.wrong .option-letter {
  background: #E74C3C;
  color: var(--hl-white);
}

/* Fill in blank */
.hl-fill-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--hl-border);
  border-radius: var(--radius-md);
  font-size: 16px; font-family: inherit;
  color: var(--hl-text);
  outline: none;
  transition: var(--transition);
}

.hl-fill-input:focus {
  border-color: var(--hl-green);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.12);
}

/* Match the following */
.hl-match-container {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

.hl-match-col { display: flex; flex-direction: column; gap: 8px; }

.hl-match-item {
  padding: 10px 12px;
  border: 2px solid var(--hl-border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: var(--hl-white);
  font-family: inherit;
  color: var(--hl-text);
}

.hl-match-item.selected {
  border-color: var(--hl-green);
  background: var(--hl-green-bg);
  color: var(--hl-green-dark);
}

.hl-match-item.matched {
  border-color: var(--hl-green);
  background: var(--hl-green);
  color: var(--hl-white);
}

/* Answer Feedback */
.hl-answer-feedback {
  display: none;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
  animation: slideUp 0.3s ease;
}

.hl-answer-feedback.visible { display: block; }

.hl-answer-feedback.correct-fb {
  background: var(--hl-green-bg);
  border: 2px solid var(--hl-green);
}

.hl-answer-feedback.wrong-fb {
  background: #FEF2F2;
  border: 2px solid #E74C3C;
}

.hl-feedback-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 900;
  margin-bottom: 6px;
}

.hl-feedback-header.correct-text { color: var(--hl-green-dark); }
.hl-feedback-header.wrong-text   { color: #C0392B; }

.hl-feedback-explanation {
  font-size: 13px;
  color: var(--hl-text-muted);
  line-height: 1.6;
}

/* Submit / Next buttons */
.hl-quiz-actions {
  margin-top: var(--space-md);
  display: flex; flex-direction: column; gap: 8px;
}

/* ============================================================
   RESULT SCREEN
   ============================================================ */
.hl-result-page {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.hl-result-trophy {
  font-size: 72px;
  line-height: 1;
  margin-bottom: var(--space-md);
  animation: bounceIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hl-result-title {
  font-size: 28px; font-weight: 900;
  color: var(--hl-text);
  margin-bottom: 4px;
}

.hl-result-subtitle {
  font-size: 15px; color: var(--hl-text-muted);
  margin-bottom: var(--space-xl);
}

.hl-result-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-sm);
  width: 100%;
  margin-bottom: var(--space-xl);
}

.hl-result-stat {
  background: var(--hl-white);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  box-shadow: var(--hl-shadow);
}

.hl-result-stat-val {
  font-size: 28px; font-weight: 900;
  color: var(--hl-green-dark);
  line-height: 1.1;
}

.hl-result-stat-label {
  font-size: 11px; font-weight: 700;
  color: var(--hl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.hl-profile-page {
  padding: var(--space-md) var(--space-md) 100px;
}

.hl-profile-hero {
  background: linear-gradient(145deg, var(--hl-green), var(--hl-green-dark));
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  margin-bottom: var(--space-md);
}

.hl-profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900;
  color: var(--hl-white);
  margin: 0 auto var(--space-sm);
  border: 3px solid rgba(255,255,255,0.5);
}

.hl-profile-name {
  font-size: 22px; font-weight: 900;
  color: var(--hl-white);
  line-height: 1.1;
  margin-bottom: 4px;
}

.hl-profile-email {
  font-size: 13px; color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-sm);
}

.hl-grade-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  padding: 4px 16px;
  font-size: 14px; font-weight: 800;
  color: var(--hl-white);
}

/* Stats Row */
.hl-profile-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.hl-stat-card {
  background: var(--hl-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  box-shadow: var(--hl-shadow);
  text-align: center;
}

.hl-stat-icon { font-size: 28px; margin-bottom: 6px; }
.hl-stat-val {
  font-size: 32px; font-weight: 900;
  color: var(--hl-text);
  line-height: 1;
  margin-bottom: 4px;
}

.hl-stat-val.gold { color: var(--hl-gold); }
.hl-stat-val.green { color: var(--hl-green-dark); }

.hl-stat-label {
  font-size: 12px; font-weight: 700;
  color: var(--hl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Badges */
.hl-badges-section {
  margin-bottom: var(--space-md);
}

.hl-section-heading {
  font-size: 20px; font-weight: 900;
  color: var(--hl-text);
  margin-bottom: var(--space-md);
}

.hl-badges-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.hl-badge-card {
  background: var(--hl-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--hl-shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.hl-badge-icon {
  font-size: 36px;
  margin-bottom: 6px;
  filter: grayscale(1);
}

.hl-badge-card.unlocked .hl-badge-icon { filter: none; }

.hl-badge-name {
  font-size: 13px; font-weight: 800;
  color: var(--hl-text);
  margin-bottom: 2px;
}

.hl-badge-status {
  font-size: 11px; font-weight: 700;
  color: var(--hl-text-muted);
}

.hl-badge-progress {
  height: 4px;
  background: var(--hl-border);
  border-radius: var(--radius-full);
  margin-top: 6px;
  overflow: hidden;
}

.hl-badge-fill {
  height: 100%;
  background: var(--hl-green);
  border-radius: var(--radius-full);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.1); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

@keyframes confetti {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(60px) rotate(720deg); opacity: 0; }
}

.hl-animate-pulse { animation: pulse 1.8s ease-in-out infinite; }

/* Page transitions */
.hl-page { animation: slideUp 0.3s ease; }

/* ============================================================
   CONFETTI OVERLAY
   ============================================================ */
.hl-confetti-wrap {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.hl-confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confetti 1.5s ease-out forwards;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.hl-toast {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--hl-text);
  color: var(--hl-white);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 700;
  z-index: 9998;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

.hl-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hl-toast.success { background: var(--hl-green-dark); }
.hl-toast.error   { background: #E74C3C; }
.hl-toast.gold    { background: var(--hl-gold); color: #1A1A1A; }

/* ============================================================
   POINTS POPUP (GAMIFICATION)
   ============================================================ */
.hl-points-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--hl-white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  z-index: 9997;
  box-shadow: 0 16px 64px rgba(0,0,0,0.2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 260px;
}

.hl-points-popup.visible { transform: translate(-50%, -50%) scale(1); }

.hl-points-popup-icon { font-size: 56px; margin-bottom: var(--space-sm); }
.hl-points-popup-pts {
  font-size: 40px; font-weight: 900;
  color: var(--hl-green-dark);
  margin-bottom: 4px;
}

.hl-points-popup-label {
  font-size: 14px; font-weight: 700;
  color: var(--hl-text-muted);
}

/* Overlay */
.hl-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9996;
}

.hl-overlay.visible { display: block; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.hl-admin-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md);
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (min-width: 481px) {
  .hl-wrapper {
    box-shadow: 0 0 60px rgba(0,0,0,0.15);
    margin: 0 auto;
    border-radius: 0;
  }
}

@media (max-width: 360px) {
  .hl-subject-name { font-size: 17px; }
  .hl-greeting-name { font-size: 22px; }
  .hl-question-text { font-size: 16px; }
}

/* ============================================================
   LOADER
   ============================================================ */
.hl-loader {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}

.hl-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--hl-green-light);
  border-top-color: var(--hl-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   EMPTY STATE
   ============================================================ */
.hl-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--hl-text-muted);
}

.hl-empty-icon { font-size: 56px; margin-bottom: var(--space-md); }
.hl-empty-text { font-size: 16px; font-weight: 700; }

/* ============================================================
   MODAL
   ============================================================ */
.hl-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 9990;
  align-items: flex-end;
}

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

.hl-modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}

.hl-modal-box {
  position: relative;
  background: var(--hl-white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.hl-modal-handle {
  width: 40px; height: 4px;
  background: var(--hl-border);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.hl-modal-title {
  font-size: 22px; font-weight: 900;
  color: var(--hl-text);
  margin-bottom: var(--space-lg);
  text-align: center;
}
