/* ============================================
   WalkieTalk French Games — Main Stylesheet
   v2.0 — Premium Design System
   ============================================ */

/* Inter — self-hosted.
   This was an @import from fonts.googleapis.com, which the CSP in
   netlify.toml blocked (style-src 'self'), so Inter never actually loaded in
   production and the site silently rendered in the system fallback stack.

   Serving it ourselves keeps the CSP as it is, drops a third-party request
   from every page load, and stops visitor IPs being sent to Google — worth
   having on a site aimed at school students.

   One variable-font file covers the whole 300-900 range used across the
   stylesheets, which is smaller than the seven static weights it replaces.
   Latin subset only: it carries every French accent plus OE/oe, which is the
   full range of characters the site's content actually uses. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/inter-latin-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 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: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  overflow-x: hidden;
  /* clip, where supported, hides sideways overflow without making the body a
     scroll container, so position: sticky works inside the page. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* CSS Custom Properties — Light Theme (Default) */
:root {
  --bg-primary: #FAFBFE;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F3F9;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-strong: rgba(255, 255, 255, 0.88);
  --bg-hero-gradient: linear-gradient(180deg, #EEF2FF 0%, #FAFBFE 100%);
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --accent-primary: #1E3A5F;
  --accent-secondary: #E63946;
  --accent-hover: #C62D3A;
  --accent-gradient: linear-gradient(135deg, #1E3A5F 0%, #3B82F6 50%, #8B5CF6 100%);
  --accent-gradient-text: linear-gradient(135deg, #1E3A5F 0%, #3B82F6 100%);
  --accent-gradient-warm: linear-gradient(135deg, #E63946 0%, #F97316 100%);
  --success: #10B981;
  --success-light: #D1FAE5;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --warning: #F59E0B;
  --xp-gold: #F59E0B;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --header-height: 72px;
  --blur-md: blur(12px);
  --blur-lg: blur(20px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

h1 { font-size: 2.75rem; font-weight: 900; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; font-weight: 700; }

p { margin-bottom: 1rem; }

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

a:hover { color: var(--accent-secondary); }

/* Gradient Text Utility */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: var(--accent-gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Utility Classes */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Header / Navigation — Frosted Glass
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: background-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

.nav-desktop {
  display: none;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: scale(1.05);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav — Frosted Glass Panel */
.nav-mobile {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-glass-strong);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-mobile.open {
  right: 0;
}

.nav-mobile-close {
  align-self: flex-end;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  margin-bottom: 1rem;
}

.nav-mobile .nav-link {
  display: block;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  text-align: left;
  font-weight: 500;
}

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}

.nav-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================
   Main Content Area
   ============================================ */
#app {
  min-height: calc(100vh - var(--header-height) - 80px);
  padding-top: 0;
  padding-bottom: 4rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-secondary);
  font-weight: 600;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--accent-primary);
}

/* ============================================
   Buttons — Premium Style
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: -0.01em;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(30, 58, 95, 0.4);
  transform: translateY(-2px);
  color: white;
  filter: brightness(1.1);
}

.btn-gradient {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-gradient:hover {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  color: white;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--accent-secondary);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ============================================
   Cards — Premium Glass Style
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

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

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card-glass:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--border);
}

.card-flat:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

/* ============================================
   Progress Ring
   ============================================ */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.progress-ring-bg {
  fill: none;
  stroke: var(--border);
}

.progress-ring-fill {
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
  position: absolute;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-level {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.badge-xp {
  background: linear-gradient(135deg, #F4A261, #E76F51);
  color: white;
}

.badge-streak {
  background: linear-gradient(135deg, #FF6B6B, #EE5A24);
  color: white;
}

/* ============================================
   XP Bar
   ============================================ */
.xp-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--xp-gold);
}

.xp-display .xp-icon {
  font-size: 1.25rem;
}

/* ============================================
   Streak Display
   ============================================ */
.streak-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

/* ============================================
   Modal / Overlay
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform var(--transition);
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  right: 1rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  border-left: 4px solid var(--success);
}

.toast-error { border-left-color: var(--error); }
.toast-xp { border-left-color: var(--xp-gold); }

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(50px); }
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 640px) {
  h1 { font-size: 3.25rem; }
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
  .hamburger {
    display: none;
  }
}

@media (min-width: 1024px) {
  h1 { font-size: 4rem; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================
   Chatbot Bubble — AI French Tutor
   ============================================ */
.chatbot-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
  transition: all var(--transition);
  animation: chatbotPulse 3s ease-in-out infinite;
}

.chatbot-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
}

.chatbot-fab.open {
  animation: none;
  transform: rotate(0deg);
}

@keyframes chatbotPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35); }
  50% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.55), 0 0 0 8px rgba(59, 130, 246, 0.08); }
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 1200;
  width: 370px;
  max-width: calc(100vw - 2rem);
  height: 500px;
  max-height: calc(100vh - 8rem);
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Chat Header */
.chatbot-header {
  padding: 0.75rem 1rem;
  background: var(--bg-glass-strong);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  pointer-events: auto;
}

/* New Chat Button */
.chatbot-new-chat {
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.chatbot-new-chat:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.chatbot-new-chat span {
  font-size: 1rem;
  font-weight: 400;
}

.chatbot-window.maximized .chatbot-new-chat {
  display: flex; /* Visible only when maximized */
}

/* Window Controls */
.chatbot-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  position: relative;
  z-index: 902;
}

.chatbot-ctrl-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition);
  font-family: inherit;
  position: relative;
  z-index: 903;
}

.chatbot-ctrl-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.chatbot-ctrl-close:hover {
  background: var(--error);
  color: white;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.chatbot-header-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.chatbot-header-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

.chatbot-header-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: absolute;
  bottom: 0;
  right: 0;
}

/* Maximize / Minimize States */
.chatbot-window.maximized {
  width: calc(100vw - 2rem);
  height: calc(100vh - 2rem);
  max-width: 800px;
  max-height: calc(100vh - 2rem);
  bottom: 1rem;
  right: 1rem;
  border-radius: var(--radius-xl);
}

.chatbot-window.minimized {
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
}

.chatbot-fab.has-messages {
  animation: chatbotPulse 1.5s ease-in-out infinite;
}

/* Chat Body */
.chatbot-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Welcome / Starter Screen */
.chatbot-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  text-align: center;
  gap: 0.5rem;
}

.chatbot-welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.chatbot-welcome h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.chatbot-welcome p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  max-width: 280px;
}

/* Starter Prompt Cards */
.chatbot-starters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
  max-width: 320px;
}

.chatbot-starter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: inherit;
}

.chatbot-starter:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.chatbot-starter-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.chatbot-starter strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.chatbot-starter span {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Chat Messages */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.chatbot-msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: chatMsgIn 0.3s ease;
}

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

.chatbot-msg.bot {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  background: var(--accent-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chatbot-msg .french-word {
  font-style: italic;
  font-weight: 600;
}

/* Typing Indicator */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 0.7rem 1rem;
  align-self: flex-start;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Suggestions */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.5rem;
  flex-shrink: 0;
}

.chatbot-suggestion {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.chatbot-suggestion:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* Chat Input */
.chatbot-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.chatbot-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.chatbot-input:focus {
  border-color: var(--accent-primary);
}

.chatbot-input::placeholder {
  color: var(--text-muted);
}

.chatbot-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent-primary);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.chatbot-send:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

/* Quiz Options inside Chat */
.chatbot-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 0.25rem;
  animation: chatMsgIn 0.3s ease;
}

.chatbot-quiz-option {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: inherit;
}

.chatbot-quiz-option:hover:not(.disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.chatbot-quiz-option.disabled {
  cursor: default;
  opacity: 0.7;
}

.chatbot-quiz-option.correct {
  border-color: var(--success) !important;
  background: var(--success-light) !important;
  color: var(--success) !important;
  opacity: 1 !important;
  font-weight: 700;
}

.chatbot-quiz-option.wrong {
  border-color: var(--error) !important;
  background: var(--error-light) !important;
  color: var(--error) !important;
  opacity: 1 !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .chatbot-window {
    right: 0.75rem;
    bottom: 5rem;
    width: calc(100vw - 1.5rem);
    height: calc(100vh - 7rem);
    border-radius: var(--radius-lg);
  }
  .chatbot-window.maximized {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .chatbot-fab {
    bottom: 1rem;
    right: 1rem;
    width: 54px;
    height: 54px;
    font-size: 1.4rem;
  }
  .chatbot-starters {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

/* ============================================
   Error Toast Notifications
   ============================================ */

.toast-container-error {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  pointer-events: none;
}

.toast-error {
  background: var(--bg-card);
  border: 2px solid var(--error);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-error.toast-enter {
  opacity: 1;
  transform: translateX(0);
}

.toast-error.toast-exit {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .toast-container-error {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }
}
