:root {
  /* Color Palette - "Lush Academia" Aesthetic */
  --bg-deep: #0F172A;
  --bg-card: #1E293B;
  --accent-primary: #38BDF8;
  --accent-secondary: #818CF8;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --border-light: rgba(255, 255, 255, 0.1);
  --glass: rgba(30, 41, 59, 0.7);
  --success: #2DD4BF;
  
  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  
  /* Effects */
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.2);
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
}

/* App Container (Mobile First but stretches) */
.app-container {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 0%, #1E293B, #0F172A);
  overflow: hidden;
}

/* Header */
.app-header {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg-deep), transparent);
  z-index: 10;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.avatar-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  padding: 2px;
}

.placeholder-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #334155;
  border: 2px solid var(--bg-deep);
}

/* AI Character Stage */
.ai-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  overflow: hidden;
}

.ai-visual-container {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.ai-glow-orb {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(129, 140, 248, 0.1) 70%);
  border-radius: 50%;
  filter: blur(40px);
  animation: pulse-glow 4s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.ai-avatar-main {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* Representing the "Human-like" AI Model visually */
.ai-character-face {
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #475569, #1E293B);
  position: relative;
}

.ai-eye-left, .ai-eye-right {
  position: absolute;
  top: 45%;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-primary);
  animation: blink 4s infinite;
}

.ai-eye-left { left: 35%; }
.ai-eye-right { right: 35%; }

@keyframes blink {
  0%, 95%, 100% { transform: scaleY(1); }
  97.5% { transform: scaleY(0.1); }
}

.ai-voice-waves {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  margin-top: var(--space-lg);
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 2px;
  animation: wave 1.2s infinite ease-in-out;
}

@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 24px; }
}

/* Speech Bubble */
.speech-bubble {
  background: var(--glass);
  backdrop-filter: blur(12px);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 380px;
  margin-top: var(--space-md);
  position: relative;
  animation: slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.speech-text {
  font-size: 1.1rem;
  color: var(--text-main);
  text-align: center;
  margin-bottom: var(--space-xs);
}

.translation-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Controls Interaction Area */
.interaction-area {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: linear-gradient(to top, var(--bg-deep) 80%, transparent);
}

.mic-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.mic-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
  transition: transform 0.2s;
  z-index: 5;
}

.mic-button:active {
  transform: scale(0.9);
}

.mic-rings {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0;
  pointer-events: none;
}

.mic-button-container.active .mic-rings {
  animation: ripple 2s infinite;
}

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

.action-bar {
  display: flex;
  justify-content: space-around;
  padding-bottom: var(--space-lg);
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.icon-btn:hover {
  background: #334155;
  color: var(--text-main);
}

.icon-btn.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Progress Stats */
.stats-tray {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.stat-val {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Navigation Drawer (Bottom) */
.nav-bar {
  background: var(--bg-card);
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

/* Dashboard / Lessons Styles */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  scrollbar-width: none;
}
.content-scroll::-webkit-scrollbar { display: none; }

.section-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lesson-card {
  background: var(--glass);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-md);
  transition: transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.lesson-card:active {
  transform: scale(0.98);
}

.lesson-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.lesson-info {
  flex: 1;
}

.lesson-tag {
  font-size: 0.7rem;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 4px;
}

.lesson-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
}

/* Vocab / Cards Styles */
.vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.vocab-card {
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  text-align: center;
}

.vocab-word {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.vocab-def {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Profile / Achievements Styles */
.achievement-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
}

.badge-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(255, 165, 0, 0.3);
}

.badge-locked {
  background: #334155;
  color: var(--text-muted);
  box-shadow: none;
  opacity: 0.5;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  width: 20%;
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
}

/* Utilities */
.placeholder-icon {
  width: 24px;
  height: 24px;
  background: currentColor;
  opacity: 0.4;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.flex-grow { flex: 1; }

/* Lesson Topic Switcher */
.topic-selector {
  padding: var(--space-xs) var(--space-md) var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topic-selector::-webkit-scrollbar { display: none; }

.topic-chip {
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.topic-chip.selected {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}