/* ============================================
   PROJECT ENGLISH AI - STYLES
   Premium Dark UI with Glassmorphism
   ============================================ */

:root {
  /* Color Palette */
  --primary: #6C63FF;
  --primary-light: #8B85FF;
  --primary-dark: #4B44CC;
  --secondary: #3ECFCF;
  --accent-coral: #FF6B6B;
  --accent-gold: #FFE66D;
  --accent-green: #6BCB77;
  --accent-purple: #C77DFF;

  /* Backgrounds */
  --bg-dark: #0A0A14;
  --bg-card: #12121F;
  --bg-card-2: #1A1A2E;
  --bg-glass: rgba(255,255,255,0.04);
  --bg-glass-hover: rgba(255,255,255,0.08);
  --bg-sidebar: #0D0D1A;
  --bg-input: rgba(255,255,255,0.06);

  /* Text */
  --text-primary: #F0F0FF;
  --text-secondary: #A0A0C0;
  --text-muted: #5A5A7A;
  --text-accent: #6C63FF;

  /* Borders */
  --border: rgba(255,255,255,0.08);
  --border-active: rgba(108,99,255,0.5);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6C63FF 0%, #3ECFCF 100%);
  --grad-coral: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
  --grad-green: linear-gradient(135deg, #6BCB77 0%, #3ECFCF 100%);
  --grad-purple: linear-gradient(135deg, #C77DFF 0%, #6C63FF 100%);
  --grad-erasmus: linear-gradient(135deg, #003399 0%, #0066CC 50%, #FFD700 100%);
  --grad-gold: linear-gradient(135deg, #FFE66D 0%, #FF6B6B 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-primary: 0 0 30px rgba(108,99,255,0.3);
  --shadow-glow: 0 0 60px rgba(108,99,255,0.2);

  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: 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;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.6;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

textarea {
  resize: none;
}

ul { list-style: none; }

.hidden { display: none !important; }

/* ============ SPLASH SCREEN ============ */
.splash-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: splashIn 0.8s ease;
}

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

.splash-logo {
  margin-bottom: 24px;
}

.splash-logo .logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  filter: drop-shadow(0 0 30px rgba(108,99,255,0.6));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.splash-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.splash-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}

.splash-loader {
  width: 200px;
  height: 3px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  margin: 0 auto;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  animation: loadProgress 2s ease forwards;
}

@keyframes loadProgress {
  from { width: 0%; }
  to { width: 100%; }
}

/* ============ MAIN APP ============ */
.main-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 100;
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed {
  width: 68px;
  min-width: 68px;
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info,
.sidebar.collapsed .xp-bar-container {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 70px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon-small {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(108,99,255,0.5));
}

.sidebar-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.sidebar-toggle {
  background: var(--bg-glass);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  width: 30px;
  height: 30px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0 8px;
  display: block;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  transition: all var(--transition);
  text-align: left;
  position: relative;
  margin-bottom: 2px;
}

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

.nav-item.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(62,207,207,0.1));
  color: var(--primary-light);
  border: 1px solid rgba(108,99,255,0.25);
}

.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--grad-primary);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-level {
  display: block;
  font-size: 0.7rem;
  color: var(--secondary);
}

.xp-bar-container {
  width: 100%;
}

.xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.xp-bar {
  height: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-dark);
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,20,0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-glass);
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.agent-title-area h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.agent-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: #FF6B6B;
  font-weight: 600;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 1rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Space Grotesk', sans-serif;
}

.level-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border-active);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  transition: all var(--transition);
}

.level-selector-btn:hover {
  background: rgba(108,99,255,0.15);
}

#level-badge {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.level-dropdown {
  position: absolute;
  top: calc(var(--topbar-height) + 4px);
  right: 24px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: dropIn 0.2s ease;
}

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

.level-option {
  display: block;
  width: 100%;
  padding: 10px 20px;
  text-align: left;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.level-option:hover, .level-option.active {
  background: rgba(108,99,255,0.15);
  color: var(--primary-light);
}

/* ============ AGENT PANELS ============ */
.agent-panels {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.agent-panel {
  display: none;
  height: 100%;
  overflow: hidden;
  animation: panelIn 0.3s ease;
}

.agent-panel.active {
  display: flex;
  flex-direction: column;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ CHAT CONTAINER ============ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.speaking-avatar { background: linear-gradient(135deg, rgba(108,99,255,0.3), rgba(62,207,207,0.2)); border: 1px solid rgba(108,99,255,0.3); }
.erasmus-avatar { background: linear-gradient(135deg, rgba(0,51,153,0.4), rgba(255,215,0,0.2)); border: 1px solid rgba(0,102,204,0.4); }
.ielts-avatar { background: linear-gradient(135deg, rgba(107,203,119,0.3), rgba(62,207,207,0.2)); border: 1px solid rgba(107,203,119,0.3); }
.business-avatar { background: linear-gradient(135deg, rgba(199,125,255,0.3), rgba(108,99,255,0.2)); border: 1px solid rgba(199,125,255,0.3); }
.interview-avatar { background: linear-gradient(135deg, rgba(255,107,107,0.3), rgba(255,230,109,0.2)); border: 1px solid rgba(255,107,107,0.3); }
.debate-avatar { background: linear-gradient(135deg, rgba(255,230,109,0.3), rgba(255,107,107,0.2)); border: 1px solid rgba(255,230,109,0.3); }
.pronunciation-avatar { background: linear-gradient(135deg, rgba(62,207,207,0.3), rgba(108,99,255,0.2)); border: 1px solid rgba(62,207,207,0.3); }

.agent-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.agent-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-controls {
  display: flex;
  gap: 8px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all var(--transition);
}

.ctrl-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

/* ============ MESSAGES AREA ============ */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.messages-area::-webkit-scrollbar {
  width: 4px;
}

.messages-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.message {
  display: flex;
  gap: 12px;
  animation: messageIn 0.3s ease;
}

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

.ai-message {
  align-items: flex-start;
}

.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, rgba(108,99,255,0.3), rgba(62,207,207,0.2));
  border-color: rgba(108,99,255,0.3);
}

.message-content {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-message .message-content {
  align-items: flex-end;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.7;
}

.ai-message .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}

.user-message .message-bubble {
  background: linear-gradient(135deg, rgba(108,99,255,0.25), rgba(62,207,207,0.15));
  border: 1px solid rgba(108,99,255,0.25);
  border-top-right-radius: 4px;
  color: var(--text-primary);
}

.message-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Topic Chips */
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.topic-chip {
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
  color: var(--primary-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  transition: all var(--transition);
}

.topic-chip:hover {
  background: rgba(108,99,255,0.25);
  border-color: rgba(108,99,255,0.4);
  transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator .message-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* ============ FEEDBACK PANEL ============ */
.feedback-panel {
  margin: 0 24px;
  background: var(--bg-card);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  animation: panelIn 0.3s ease;
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(62,207,207,0.08));
  border-bottom: 1px solid var(--border);
}

.feedback-header h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.feedback-close {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
}

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

.feedback-content {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.feedback-item {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.feedback-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.feedback-item-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback-score {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
}

.score-excellent { color: #6BCB77; }
.score-good { color: var(--secondary); }
.score-average { color: var(--accent-gold); }
.score-poor { color: var(--accent-coral); }

.feedback-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.feedback-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.fill-excellent { background: linear-gradient(90deg, #6BCB77, #3ECFCF); }
.fill-good { background: linear-gradient(90deg, #3ECFCF, #6C63FF); }
.fill-average { background: linear-gradient(90deg, #FFE66D, #FF6B6B); }
.fill-poor { background: linear-gradient(90deg, #FF6B6B, #C77DFF); }

.feedback-item-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feedback-full-row {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(108,99,255,0.08), rgba(62,207,207,0.05));
  border-color: rgba(108,99,255,0.2);
}

.improved-version {
  font-style: italic;
  color: var(--secondary);
  padding: 8px 12px;
  background: rgba(62,207,207,0.05);
  border-left: 2px solid var(--secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 4px;
  font-size: 0.82rem;
}

.tip-box {
  background: linear-gradient(135deg, rgba(255,230,109,0.08), rgba(255,107,107,0.05));
  border: 1px solid rgba(255,230,109,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--accent-gold);
}

/* ============ CHAT INPUT AREA ============ */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  transition: border-color var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 2px rgba(108,99,255,0.1);
}

#chat-input, textarea[id^="chat-input"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  padding: 2px 0;
}

#chat-input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.voice-btn:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--border-active);
  color: var(--primary-light);
}

.voice-btn.recording {
  background: rgba(255,107,107,0.2);
  border-color: rgba(255,107,107,0.5);
  color: #FF6B6B;
  animation: recordPulse 1s ease infinite;
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,107,0); }
}

.send-btn {
  width: 36px;
  height: 36px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--transition);
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-primary);
}

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

.input-hints {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============ ERASMUS+ PANEL ============ */
.scenario-selector {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.scenario-selector h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.scenario-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  text-align: center;
}

.scenario-card:hover {
  background: rgba(108,99,255,0.12);
  border-color: rgba(108,99,255,0.3);
  transform: translateY(-2px);
}

.scenario-icon { font-size: 1.3rem; }
.scenario-name { font-size: 0.7rem; font-weight: 600; color: var(--text-primary); }
.scenario-desc { font-size: 0.62rem; color: var(--text-muted); }

/* Vocab Panel */
.vocab-panel {
  margin: 0 24px;
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.vocab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(0,51,153,0.2), rgba(255,215,0,0.08));
}

.vocab-header h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vocab-toggle {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: color var(--transition);
}

.vocab-toggle:hover { color: var(--text-primary); }

.vocab-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vocab-category h5 {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.vocab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vocab-tag {
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.2);
  color: #FFD700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition);
}

.vocab-tag:hover {
  background: rgba(255,215,0,0.15);
}

/* ============ IELTS PANEL ============ */
.ielts-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.ielts-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.ielts-parts {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 24px;
  gap: 16px;
}

.part-selector {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
}

.part-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  transition: all var(--transition);
}

.part-btn.active {
  background: var(--grad-green);
  color: white;
  box-shadow: 0 2px 10px rgba(107,203,119,0.3);
}

.part-connector {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.ielts-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.ielts-question-card {
  background: var(--bg-card);
  border: 1px solid rgba(107,203,119,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  flex-shrink: 0;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.part-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6BCB77;
}

.new-question-btn {
  background: rgba(107,203,119,0.1);
  border: 1px solid rgba(107,203,119,0.2);
  color: #6BCB77;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition);
}

.new-question-btn:hover {
  background: rgba(107,203,119,0.2);
}

.question-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 500;
  min-height: 40px;
}

.timer-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.timer-display {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #6BCB77;
  min-width: 50px;
}

.timer-btn {
  background: rgba(107,203,119,0.1);
  border: 1px solid rgba(107,203,119,0.3);
  color: #6BCB77;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
}

.timer-btn:hover {
  background: rgba(107,203,119,0.2);
}

/* Loading dots */
.loading-dots span {
  animation: loadDot 1.4s infinite;
  opacity: 0;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loadDot {
  0%, 60%, 100% { opacity: 0; }
  30% { opacity: 1; }
}

/* ============ INTERVIEW PANEL ============ */
.interview-setup {
  padding: 32px 24px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.interview-setup h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  font-family: 'Space Grotesk', sans-serif;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  transition: border-color var(--transition);
  appearance: none;
  cursor: pointer;
}

.form-group select:focus {
  border-color: var(--border-active);
}

.start-interview-btn {
  background: var(--grad-coral);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  transition: all var(--transition);
  margin-top: 8px;
  box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

.start-interview-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

/* ============ DEBATE PANEL ============ */
.debate-topics {
  padding: 24px;
  flex-shrink: 0;
}

.debate-topics h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-family: 'Space Grotesk', sans-serif;
}

.debate-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.debate-topic-btn {
  background: linear-gradient(135deg, rgba(255,230,109,0.08), rgba(255,107,107,0.05));
  border: 1px solid rgba(255,230,109,0.15);
  color: var(--text-primary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  transition: all var(--transition);
  line-height: 1.4;
}

.debate-topic-btn:hover {
  background: linear-gradient(135deg, rgba(255,230,109,0.15), rgba(255,107,107,0.1));
  border-color: rgba(255,230,109,0.3);
  transform: translateY(-2px);
}

/* ============ VOCABULARY BUILDER ============ */
.vocab-builder-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  gap: 20px;
  overflow-y: auto;
}

.vocab-builder-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.vocab-builder-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.vocab-categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vocab-cat-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
}

.vocab-cat-btn.active,
.vocab-cat-btn:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--border-active);
  color: var(--primary-light);
}

/* Flashcard */
.flashcard-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.flashcard {
  width: 100%;
  max-width: 500px;
  height: 260px;
  perspective: 1000px;
  cursor: pointer;
}

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

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

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.flashcard-back {
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
  overflow-y: auto;
  gap: 14px;
}

.word-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  background: rgba(108,99,255,0.1);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.flashcard-word {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flashcard-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.flashcard-definition {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.flashcard-example {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(108,99,255,0.06);
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.5;
}

.flashcard-synonyms {
  font-size: 0.78rem;
  color: var(--secondary);
}

.flashcard-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fc-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
}

.fc-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.fc-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 60px;
  text-align: center;
}

.fc-rating {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.fc-rating span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rating-btns {
  display: flex;
  gap: 8px;
}

.rating-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
}

.r-easy {
  background: rgba(107,203,119,0.1);
  border: 1px solid rgba(107,203,119,0.3);
  color: #6BCB77;
}

.r-medium {
  background: rgba(255,230,109,0.1);
  border: 1px solid rgba(255,230,109,0.3);
  color: #FFE66D;
}

.r-hard {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.3);
  color: #FF6B6B;
}

.rating-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

/* ============ DAILY CHALLENGE ============ */
.challenge-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  gap: 24px;
  overflow-y: auto;
}

.challenge-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.challenge-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.challenge-streak-display {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
}

.streak-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--grad-coral);
  box-shadow: 0 4px 20px rgba(255,107,107,0.3);
  flex-shrink: 0;
}

.streak-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  line-height: 1;
}

.streak-text {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.challenge-stats {
  display: flex;
  gap: 32px;
  flex: 1;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.daily-challenges h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challenge-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all var(--transition);
  cursor: pointer;
}

.challenge-item:hover {
  border-color: var(--border-active);
  background: var(--bg-card-2);
}

.challenge-item.completed {
  opacity: 0.6;
  border-color: rgba(107,203,119,0.3);
}

.challenge-icon {
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.challenge-info {
  flex: 1;
}

.challenge-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.challenge-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.challenge-xp {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(255,230,109,0.1);
  border: 1px solid rgba(255,230,109,0.2);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.challenge-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.challenge-item.completed .challenge-check {
  border-color: #6BCB77;
  background: rgba(107,203,119,0.2);
  color: #6BCB77;
}

/* ============ PRONUNCIATION LAB ============ */
.pronunciation-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.pronunciation-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pronunciation-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pronunciation-categories {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

.pron-cat {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition);
}

.pron-cat.active {
  background: rgba(62,207,207,0.15);
  border-color: rgba(62,207,207,0.4);
  color: var(--secondary);
}

.pronunciation-exercise {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
  overflow-y: auto;
}

.pron-word-display {
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(62,207,207,0.2);
  border-radius: var(--radius-xl);
}

.pron-word-display h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3ECFCF, #6C63FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.ipa-notation {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

.pron-tips {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.pron-tips h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pron-tips li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
  line-height: 1.8;
}

.pron-tips li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--secondary);
}

.pron-words-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pron-word-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.pron-word-btn:hover, .pron-word-btn.active {
  background: rgba(62,207,207,0.12);
  border-color: rgba(62,207,207,0.3);
  color: var(--secondary);
}

.pron-record-area {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.record-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(62,207,207,0.15), rgba(108,99,255,0.1));
  border: 2px solid rgba(62,207,207,0.3);
  color: var(--secondary);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
}

.record-btn:hover {
  background: linear-gradient(135deg, rgba(62,207,207,0.25), rgba(108,99,255,0.15));
  transform: translateY(-1px);
}

.record-btn.active {
  border-color: rgba(255,107,107,0.5);
  color: #FF6B6B;
  animation: recordPulse 1s ease infinite;
}

.record-wave {
  display: flex;
  align-items: center;
  gap: 3px;
}

.wave-bar {
  width: 3px;
  height: 20px;
  background: var(--secondary);
  border-radius: 2px;
  animation: waveAnim 0.5s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { animation-duration: 0.4s; }
.wave-bar:nth-child(2) { animation-duration: 0.5s; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-duration: 0.3s; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-duration: 0.6s; animation-delay: 0.05s; }
.wave-bar:nth-child(5) { animation-duration: 0.45s; animation-delay: 0.15s; }

@keyframes waveAnim {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1.5); }
}

/* ============ DASHBOARD ============ */
.dashboard-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  gap: 24px;
  overflow-y: auto;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.dashboard-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.stat-card-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stat-card-value {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Skill Bars */
.score-breakdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.score-breakdown h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-bar-item {}

.skill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.skill-bar-track {
  height: 6px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.grammar-fill { background: var(--grad-primary); }
.vocab-fill { background: var(--grad-purple); }
.fluency-fill { background: var(--grad-green); }
.overall-fill { background: var(--grad-coral); }

/* Recent Feedback */
.recent-feedback {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.recent-feedback h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.feedback-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-state span { font-size: 2rem; }

.feedback-history-item {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: messageIn 0.3s ease;
}

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

.fhi-agent {
  font-size: 0.72rem;
  color: var(--primary-light);
  font-weight: 600;
}

.fhi-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.fhi-tip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 240px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.toast-success { border-color: rgba(107,203,119,0.3); }
.toast.toast-error { border-color: rgba(255,107,107,0.3); }
.toast.toast-info { border-color: rgba(108,99,255,0.3); }
.toast.toast-xp { border-color: rgba(255,230,109,0.3); }

.toast-icon { font-size: 1.1rem; }
.toast-message { font-size: 0.82rem; color: var(--text-primary); flex: 1; }

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left var(--transition);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .mobile-menu-btn { display: flex; }

  .topbar-right .streak-badge,
  .topbar-right .score-display { display: none; }

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

  .feedback-content { grid-template-columns: 1fr; }

  .main-app {
    position: relative;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    backdrop-filter: blur(4px);
  }
}

@media (max-width: 480px) {
  .chat-header { padding: 12px 16px; }
  .messages-area { padding: 12px 16px; }
  .chat-input-area { padding: 12px 16px; }
}

/* ============ SPECIAL EFFECTS ============ */

/* Glow border animation for active elements */
@keyframes borderGlow {
  0%, 100% { border-color: rgba(108,99,255,0.3); }
  50% { border-color: rgba(108,99,255,0.7); }
}

.input-wrapper:focus-within {
  animation: borderGlow 2s ease infinite;
}

/* Shimmer loading */
.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-2) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Score animation */
@keyframes scoreCount {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.score-animate {
  animation: scoreCount 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* EU Stars for Erasmus panel */
.eu-stars {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
}

.eu-star {
  width: 8px;
  height: 8px;
  background: #FFD700;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* ============ TTS VOICE CONTROLS ============ */

.tts-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Speaking wave indicator */
.tts-speaking-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(62, 207, 207, 0.08);
  border: 1px solid rgba(62, 207, 207, 0.25);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  animation: fadeIn 0.3s ease;
}

.tts-speaking-indicator.visible {
  display: flex;
}

.tts-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
}

.tts-wave span {
  display: block;
  width: 3px;
  background: var(--secondary);
  border-radius: 2px;
  animation: ttsWave 0.8s ease-in-out infinite alternate;
}

.tts-wave span:nth-child(1) { height: 4px;  animation-delay: 0.0s; }
.tts-wave span:nth-child(2) { height: 10px; animation-delay: 0.1s; }
.tts-wave span:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.tts-wave span:nth-child(4) { height: 10px; animation-delay: 0.3s; }
.tts-wave span:nth-child(5) { height: 4px;  animation-delay: 0.4s; }

@keyframes ttsWave {
  from { transform: scaleY(0.4); opacity: 0.6; }
  to   { transform: scaleY(1.0); opacity: 1.0; }
}

.tts-speaking-text {
  font-size: 0.7rem;
  color: var(--secondary);
  font-weight: 600;
  white-space: nowrap;
}

/* Stop button */
.tts-stop-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #FF6B6B;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--transition);
  animation: fadeIn 0.2s ease;
}

.tts-stop-btn:hover {
  background: rgba(255, 107, 107, 0.22);
  transform: scale(1.05);
}

/* Toggle button */
.tts-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.tts-toggle-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.tts-toggle-btn.tts-active {
  background: linear-gradient(135deg, rgba(62,207,207,0.18), rgba(108,99,255,0.12));
  border-color: rgba(62, 207, 207, 0.45);
  color: var(--secondary);
  box-shadow: 0 0 12px rgba(62, 207, 207, 0.2);
  animation: ttsGlow 2s ease infinite;
}

@keyframes ttsGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(62, 207, 207, 0.2); }
  50%       { box-shadow: 0 0 18px rgba(62, 207, 207, 0.45); }
}

/* Settings gear button */
.tts-settings-wrapper {
  position: relative;
}

.tts-settings-btn {
  width: 30px;
  height: 30px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.tts-settings-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
  transform: rotate(30deg);
}

/* Settings dropdown panel */
.tts-settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  animation: dropIn 0.2s ease;
  overflow: hidden;
}

.tts-panel-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(62,207,207,0.1), rgba(108,99,255,0.08));
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tts-setting-row {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.tts-setting-row:last-child {
  border-bottom: none;
}

.tts-setting-row label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tts-setting-row label span {
  font-weight: 700;
  color: var(--secondary);
  text-transform: none;
  letter-spacing: 0;
}

/* Voice select */
.tts-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--transition);
}

.tts-select:focus {
  border-color: var(--border-active);
}

.tts-select option {
  background: var(--bg-card-2);
  color: var(--text-primary);
}

/* Sliders */
.tts-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-glass);
  outline: none;
  cursor: pointer;
}

.tts-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--grad-primary);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(108,99,255,0.5);
  transition: transform var(--transition);
}

.tts-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.tts-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============ SPEAK BUTTON on AI messages ============ */
.speak-msg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  margin-top: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.speak-msg-btn:hover {
  background: rgba(62,207,207,0.1);
  border-color: rgba(62,207,207,0.3);
  color: var(--secondary);
}

/* ============ IMPROVED VERSION LISTEN BUTTON ============ */

.improved-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(62,207,207,0.15), rgba(108,99,255,0.12));
  border: 1px solid rgba(62,207,207,0.35);
  color: var(--secondary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.improved-listen-btn:hover {
  background: linear-gradient(135deg, rgba(62,207,207,0.28), rgba(108,99,255,0.22));
  border-color: rgba(62,207,207,0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(62,207,207,0.25);
}

.improved-listen-btn:active {
  transform: scale(0.96);
}

/* Tip listen button - small icon only */
.tip-listen-btn {
  background: transparent;
  border: 1px solid rgba(255,230,109,0.25);
  color: rgba(255,230,109,0.7);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  cursor: pointer;
  margin-left: 8px;
  transition: all var(--transition);
  vertical-align: middle;
}

.tip-listen-btn:hover {
  background: rgba(255,230,109,0.12);
  border-color: rgba(255,230,109,0.5);
  color: var(--accent-gold);
}


