/* Teach Bob - Modern Clean Styles */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #475569;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 20px;
  /* Chat colors */
  --chat-header-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --chat-bg: #f8fafc;
  --user-message-bg: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  --bot-message-bg: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  position: relative;
  z-index: 100;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  margin: 0 -16px;
  padding: 20px 16px;
}

.header-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary);
}

.bot-icon {
  width: 44px;
  height: 44px;
}

.bot-icon .bob-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.bob-chat-avatar {
  width: 75%;
  height: 75%;
  object-fit: contain;
  border-radius: 8px;
}

/* Speaking animation for image avatar */
.bot-avatar.speaking .bob-chat-avatar {
  animation: bobPulse 0.5s ease-in-out infinite alternate;
}

@keyframes bobPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
  padding: 32px 0;
}

.phase {
  animation: fadeIn 0.3s ease;
}

.hidden {
  display: none !important;
}

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

/* Cards */
.intro-card,
.topic-card,
.complete-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.intro-card h2,
.topic-card h2,
.complete-card h2 {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--secondary);
}

.intro-card p {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 24px;
}

/* How it works */
.how-it-works {
  margin: 32px 0;
}

.how-it-works h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.steps {
  display: grid;
  gap: 12px;
}

.step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: all 0.2s ease;
  background: var(--bg);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Image Upload for Topic */
.image-upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upload:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

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

.topic-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topic-image-preview:empty {
  display: none;
}

.topic-image-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.topic-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.topic-image-item img:hover {
  transform: scale(1.05);
}

.topic-image-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.topic-image-item .remove-btn:hover {
  background: var(--error);
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-warning {
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary:hover {
  background: var(--border);
}

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

.btn-success:hover {
  background: #059669;
}

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

.btn-warning:hover {
  background: #d97706;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.2);
}

/* Progress Section */
.progress-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

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

.progress-label {
  font-weight: 600;
  color: var(--secondary);
}

.progress-percent {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.progress-container {
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  height: 32px;
}

.progress-bar {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 24px;
}

.progress-hint {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Chat */
.chat-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-header {
  background: var(--chat-header-bg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-header-info {
  flex: 1;
}

.chat-header-info h3 {
  color: white;
  font-size: 18px;
  margin-bottom: 2px;
}

.chat-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-status {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.chat-lang {
  font-size: 16px;
}

.chat-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Desktop/Mobile visibility */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 600px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }
}

/* Chat Menu (Mobile) */
.chat-menu-wrapper {
  position: relative;
}

.chat-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.chat-menu.hidden {
  display: none;
}

.chat-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.chat-menu-item:hover {
  background: var(--bg);
}

.chat-menu-item span:first-child {
  font-size: 18px;
}

/* Voice toggle in mobile menu */
.voice-toggle-mobile {
  position: relative;
}

.voice-toggle-mobile input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider-small {
  position: relative;
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  margin-left: auto;
  transition: background 0.3s;
}

.toggle-slider-small::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.voice-toggle-mobile input:checked + .toggle-slider-small {
  background: var(--primary);
}

.voice-toggle-mobile input:checked + .toggle-slider-small::before {
  transform: translateX(20px);
}

/* Voice Mode Toggle */
.voice-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.voice-mode-toggle:hover {
  background: rgba(255,255,255,0.15);
}

.voice-mode-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255,255,255,0.3);
  border-radius: 20px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.voice-mode-toggle input:checked + .toggle-slider {
  background: var(--success);
}

.voice-mode-toggle input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

.toggle-icon {
  font-size: 16px;
}

.toggle-label {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .toggle-label {
    display: none;
  }

  .voice-mode-toggle {
    padding: 6px 8px;
  }
}

.bot-avatar {
  width: 44px;
  height: 44px;
  background: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bot-avatar svg {
  width: 32px;
  height: 32px;
}

/* Bob speaking animation - glow + mouth */
.bot-avatar.speaking {
  animation: bob-speaking-glow 1.2s ease-in-out infinite;
}

@keyframes bob-speaking-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.7), 0 0 40px rgba(139, 92, 246, 0.5), 0 0 60px rgba(139, 92, 246, 0.2);
  }
}

/* Mouth animation when speaking */
.bot-avatar.speaking .bob-mouth-closed {
  animation: mouth-talk 0.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes mouth-talk {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.4) scaleX(0.9);
  }
}

.chat-container {
  max-height: 400px;
  min-height: 200px;
  overflow-y: auto;
  padding: 24px;
  background: var(--chat-bg);
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Mini-task prompt */
.mini-task {
  padding: 16px 24px;
  background: var(--chat-bg);
}

.mini-task-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  animation: miniTaskPulse 2s ease-in-out infinite;
}

@keyframes miniTaskPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.mini-task-badge {
  display: inline-block;
  background: #f59e0b;
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.mini-task-title {
  font-size: 18px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}

.mini-task-desc {
  font-size: 15px;
  color: #78350f;
  margin-bottom: 12px;
  line-height: 1.5;
}

.mini-task-hint {
  font-size: 13px;
  color: #a16207;
  font-style: italic;
}

/* Demo intro overlay */
.demo-intro-overlay,
.demo-complete-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* Above cookie banner */
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.demo-intro-overlay.visible,
.demo-complete-modal.visible {
  opacity: 1;
}

.demo-intro-card,
.demo-complete-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 440px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.demo-intro-overlay.visible .demo-intro-card,
.demo-complete-modal.visible .demo-complete-card {
  transform: scale(1);
}

.demo-intro-icon,
.demo-complete-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.demo-intro-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.demo-intro-text {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.demo-intro-topic {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.demo-intro-topic-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.demo-intro-topic strong {
  font-size: 18px;
  color: var(--primary);
}

.demo-intro-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-style: italic;
}

.demo-complete-card h2 {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 12px;
}

.demo-complete-card p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.demo-skip-link {
  margin-top: 16px;
  margin-bottom: 0;
}

.demo-skip-link a {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}

.demo-skip-link a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Demo answer suggestions - compact */
.demo-suggestions {
  padding: 8px 12px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-top: 2px solid #10b981;
}

.demo-suggestions-label {
  font-size: 12px;
  color: #047857;
  margin-bottom: 6px;
  font-weight: 500;
}

.demo-suggestions-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.demo-suggestion-btn {
  background: white;
  border: 1px solid #10b981;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12px;
  color: #047857;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

.demo-suggestion-btn:hover {
  background: #10b981;
  color: white;
}

@media (max-width: 768px) {
  .demo-suggestions-list {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .demo-suggestion-btn {
    max-width: none;
  }
}

/* Messages */
.message {
  max-width: 80%;
  padding: 14px 18px;
  margin-bottom: 12px;
  animation: messageSlide 0.3s ease-out;
  line-height: 1.5;
  font-size: 15px;
}

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

.message-user {
  background: var(--user-message-bg);
  color: white;
  margin-left: auto;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.message-bot {
  background: var(--bot-message-bg);
  color: var(--text);
  margin-right: auto;
  border-radius: 18px 18px 18px 4px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.message-bot.test {
  background: #fffbeb;
  border: 2px solid var(--warning);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 4px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Thinking Indicator (Bob is thinking...) */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bot-message-bg);
  border-radius: 18px 18px 18px 4px;
  width: fit-content;
  max-width: 80%;
  animation: fadeIn 0.3s ease-out;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.thinking-text {
  color: var(--primary-dark);
  font-weight: 500;
  font-size: 15px;
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: thinking-dot 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* Input Area */
.input-area {
  position: relative;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-row textarea {
  flex: 1;
  resize: none;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  max-height: 120px;
  transition: all 0.2s;
}

.input-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-send,
.btn-voice {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

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

.btn-send:hover {
  background: var(--primary-dark);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-voice {
  background: var(--bg);
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.btn-voice:hover {
  background: var(--border);
}

.btn-voice.recording {
  background: var(--error);
  color: white;
  border-color: var(--error);
  animation: glow-recording 1.2s ease-in-out infinite;
}

.btn-voice.recording .voice-icon {
  animation: pulse-icon 0.8s ease-in-out infinite;
}

.btn-voice .voice-label,
.btn-voice .voice-timer {
  display: none;
}

.btn-voice.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-voice.disabled:hover {
  background: var(--bg);
  transform: none;
}

/* Voice toggle disabled state */
.voice-toggle input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes glow-recording {
  0%, 100% {
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 30px rgba(239, 68, 68, 0.5), 0 0 40px rgba(239, 68, 68, 0.2);
  }
}

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

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

/* Help Button */
.btn-help {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 18px;
}

.btn-help:hover {
  background: var(--border);
  border-color: var(--primary);
}

.btn-help.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* Help Popover */
.help-popover {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  width: 320px;
  z-index: 100;
  animation: popoverIn 0.2s ease;
}

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

.help-popover::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--card-bg);
}

.help-popover::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 23px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--border);
}

.help-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--secondary);
}

.help-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.help-close:hover {
  background: var(--bg);
  color: var(--text);
}

.help-popover-body {
  display: flex;
  gap: 8px;
  padding: 16px;
}

.help-popover-body input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.help-popover-body input:focus {
  outline: none;
  border-color: var(--primary);
}

.help-response {
  padding: 0 16px 16px;
}

.help-response-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

#help-response-text {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  max-height: 150px;
  overflow-y: auto;
}

.help-loading {
  padding: 16px;
  display: flex;
  justify-content: center;
}

/* Processing Overlay */
.processing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(16, 185, 129, 0.03) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.4s ease;
  border-radius: var(--radius);
  overflow: hidden;
}

.processing-overlay::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(99, 102, 241, 0.05) 60deg, transparent 120deg);
  animation: rotateGlow 8s linear infinite;
  pointer-events: none;
}

@keyframes rotateGlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.processing-content {
  text-align: center;
  max-width: 360px;
  padding: 40px 32px;
  position: relative;
  z-index: 1;
}

.processing-content h3 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 28px;
}

/* Processing Progress Bar */
.processing-progress {
  margin-bottom: 28px;
}

.processing-progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.processing-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 6px;
  transition: width 0.5s ease-out;
  position: relative;
}

.processing-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

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

.processing-status {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-light);
  font-weight: 500;
  transition: opacity 0.3s;
}

.processing-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  text-align: left;
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  animation: tipGlow 2s ease-in-out infinite alternate;
}

@keyframes tipGlow {
  0% {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
    transform: scale(1.01);
  }
}

.tip-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: tipBounce 1s ease-in-out infinite;
}

@keyframes tipBounce {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

#processing-tip-text {
  font-size: 14px;
  color: #92400e;
  line-height: 1.5;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

@media (max-width: 600px) {
  .help-popover {
    width: calc(100vw - 40px);
    left: 50%;
    transform: translateX(-50%);
    position: fixed;
    bottom: auto;
    top: auto;
    margin-bottom: 0;
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .help-popover::after,
  .help-popover::before {
    left: calc(50% - 8px);
  }

  .btn-help {
    width: 44px;
    height: 44px;
  }

}

/* Attach Image Button */
.btn-attach {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-attach:hover {
  background: var(--border);
  color: var(--primary);
}

.btn-attach.has-images {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

/* Image Preview Container */
.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
}

.image-preview-container.hidden {
  display: none;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item .remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.image-preview-item .remove-image:hover {
  background: var(--error);
}

/* Message with images */
.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.message-images img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
}

.message-images img:hover {
  opacity: 0.9;
}

/* Image modal for full-size view */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* Test Section */
.test-section,
.eval-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.test-section p,
.eval-section p {
  margin-bottom: 16px;
  font-weight: 500;
}

/* Completion */
.complete-card {
  text-align: center;
}

.celebration {
  font-size: 64px;
  margin-bottom: 16px;
}

.complete-card p {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 24px;
}

.complete-card strong {
  color: var(--primary);
}

/* Achievements */
.achievements-unlocked {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}

.achievements-unlocked h3 {
  margin-bottom: 16px;
  color: var(--secondary);
}

#new-achievements {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
}

.achievement-badge .icon {
  font-size: 24px;
}

/* Previous Topics */
.previous-topics {
  margin-top: 32px;
}

.previous-topics h3 {
  margin-bottom: 16px;
  color: var(--secondary);
}

#topics-list {
  display: grid;
  gap: 12px;
}

.topic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.topic-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.topic-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.topic-info span {
  color: var(--text-muted);
  font-size: 14px;
}

.topic-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.topic-status.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.topic-status.completed {
  background: #d1fae5;
  color: #047857;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topic-lang {
  font-size: 20px;
}

.load-more-btn {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 14px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

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

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    padding: 0 12px;
  }

  .intro-card,
  .topic-card,
  .complete-card {
    padding: 24px;
  }

  .chat-container {
    max-height: 300px;
  }

  .message {
    max-width: 90%;
  }

  .input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  }

  .input-row {
    gap: 8px;
  }

  .input-row textarea {
    padding: 10px 12px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .btn-send,
  .btn-voice,
  .btn-attach {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .image-preview-item {
    width: 60px;
    height: 60px;
  }

  .chat-wrapper {
    padding-bottom: 80px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  /* iOS keyboard open state */
  .keyboard-open .chat-wrapper {
    padding-bottom: 80px;
  }

  .keyboard-open .chat-container {
    max-height: none;
  }
}

/* iOS safe area support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .input-area {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Blog Link in Header */
.btn-blog-header {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.btn-blog-header:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

/* Help Button in Header */
.btn-help-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-light);
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s;
}

.btn-help-header:hover {
  background: var(--border);
}

/* Auth Buttons */
.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
}

.btn-text:hover {
  color: var(--text);
  text-decoration: underline;
}

.btn-full {
  width: 100%;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.user-email {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-logout svg {
  flex-shrink: 0;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-content h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--secondary);
}

.modal-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-footer-text {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Image Lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-lightbox.visible {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

.lightbox-prev,
.lightbox-next {
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-counter {
  color: white;
  font-size: 14px;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

/* Google Login Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-google:hover {
  background: var(--bg);
  border-color: #4285F4;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.btn-google svg {
  flex-shrink: 0;
}

/* Login Divider */
.login-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  padding: 0 16px;
}

/* Error/Success Text */
.error-text {
  color: var(--error);
  font-size: 14px;
  margin-bottom: 16px;
}

.success-text {
  color: var(--success);
  font-size: 14px;
  margin-bottom: 16px;
  padding: 12px;
  background: #d1fae5;
  border-radius: var(--radius);
}

/* Migration Modal */
.migration-info {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0;
}

.migration-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.migration-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.migration-label {
  color: var(--text-muted);
}

.migration-value {
  font-weight: 600;
  color: var(--primary);
}

/* Speak Button */
.btn-speak {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  margin-left: 8px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-speak:hover {
  opacity: 1;
}

.btn-speak.playing {
  opacity: 1;
}

@media (max-width: 768px) {
  .header-right {
    gap: 12px;
  }

  .user-email {
    display: none;
  }

  .btn-logout span {
    display: none;
  }

  .btn-logout {
    padding: 8px;
  }

  .modal-content {
    padding: 20px;
    margin: 0;
  }
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

.landing-page {
  max-width: 1000px;
  margin: 0 auto;
}

/* Hero Section */
.hero-section {
  padding: 40px 0 60px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
  align-items: center;
}

.hero-bob {
  text-align: center;
}

.bob-large {
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  animation: bobFloat 3s ease-in-out infinite;
}

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

.bob-large svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 20px 40px rgba(99, 102, 241, 0.3));
}

.bob-greeting {
  position: relative;
}

.speech-bubble {
  display: inline-block;
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: 20px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--primary);
  position: relative;
  animation: fadeIn 0.5s ease 0.3s both;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid var(--primary);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--card-bg);
}

.hero-text {
  text-align: left;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.hero-highlight {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 32px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.hero-highlight em {
  color: var(--primary);
  font-style: normal;
  font-weight: 700;
}

.btn-large {
  padding: 18px 36px;
  font-size: 18px;
}

/* Section Cards */
.section-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 36px;
}

.section-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.section-icon-img {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 16px auto;
  object-fit: contain;
  border-radius: 12px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--secondary);
}

/* Science Section */
.science-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.science-item {
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.science-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.science-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.science-icon-img {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  object-fit: contain;
  border-radius: 8px;
}

.science-item h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.science-item p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.science-item strong {
  color: var(--primary);
}

/* Bob Personality Section */
.bob-personality-section {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

.bob-personality-section .section-header h2 {
  color: white;
}

.bob-traits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.bob-trait {
  text-align: center;
  padding: 24px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.trait-emoji {
  font-size: 40px;
  margin-bottom: 12px;
}

.trait-icon-img {
  width: 80px;
  height: 80px;
  margin-bottom: 12px;
  object-fit: contain;
  border-radius: 12px;
}

.bob-trait h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.bob-trait p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

/* Steps Section */
.steps-horizontal {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

.step-card {
  flex: 1;
  max-width: 200px;
  text-align: center;
  padding: 24px 16px;
}

.step-card .step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  margin: 0 auto 16px;
}

.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-arrow {
  color: var(--primary);
  font-size: 24px;
  font-weight: bold;
  padding-top: 36px;
}

/* Use Cases Section */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.use-case {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.use-case:hover {
  background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}

.use-case-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.use-case-icon-img {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 12px auto;
  object-fit: contain;
  border-radius: 10px;
}

.use-case h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.use-case p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* CTA Section */
.cta-section {
  background: #6366f1;
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  margin-bottom: 40px;
}

.cta-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.cta-content p {
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  margin-bottom: 24px;
}

.cta-content .btn-primary {
  background: white;
  color: var(--primary);
}

.cta-content .btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

.cta-note {
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
}

/* Responsive Landing Page */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }

  .hero-text {
    text-align: center;
  }

  .hero-title {
    font-size: 32px;
  }

  .bob-large {
    width: 140px;
    height: 140px;
  }

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

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

  .steps-horizontal {
    flex-direction: column;
    align-items: center;
  }

  .step-card {
    max-width: 100%;
  }

  .step-arrow {
    transform: rotate(90deg);
    padding: 8px 0;
  }

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

  .section-card {
    padding: 28px 20px;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle,
  .hero-highlight {
    font-size: 16px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .bob-traits {
    grid-template-columns: 1fr;
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .cta-section {
    padding: 40px 24px;
  }

  .cta-content h2 {
    font-size: 24px;
  }

  .btn-large {
    padding: 16px 28px;
    font-size: 16px;
  }
}

/* Landing Footer */
.landing-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
   NEW LANDING PAGE STYLES
   ============================================ */

/* New Hero Section */
.hero-new {
  padding: 60px 0 80px;
}

.hero-content-new {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text-new {
  text-align: left;
}

.hero-title-new {
  font-size: 48px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero-subtitle-new {
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.hero-protege {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.hero-benefits {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
}

.hero-benefit svg {
  flex-shrink: 0;
}

.hero-bob-new {
  text-align: center;
}

/* Demo Section */
.demo-section {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.demo-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}

.demo-chat {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

.demo-chat-header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.demo-bob-avatar {
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.demo-bob-avatar svg {
  width: 32px;
  height: 32px;
}

.demo-chat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-topic {
  color: white;
  font-weight: 600;
  font-size: 15px;
}

.demo-status {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.demo-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 8px;
}

.demo-messages-wrapper {
  position: relative;
}

.demo-messages {
  height: 320px;
  padding: 16px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.demo-fade-overlay {
  pointer-events: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, white 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.demo-messages-wrapper:hover .demo-fade-overlay {
  opacity: 1;
}

.demo-message {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  animation: demoMessageIn 0.3s ease;
}

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

.demo-message-user {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.demo-message-user::before {
  content: attr(data-label);
  display: block;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.demo-message-bob {
  background: var(--bg);
  color: var(--text);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.demo-message-bob::before {
  content: 'Bob';
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .demo-messages {
    height: 280px;
  }

  .demo-message {
    max-width: 85%;
  }
}

/* Demo thinking dots */
.demo-thinking {
  display: inline-block;
  animation: demoPulse 1s ease-in-out infinite;
  letter-spacing: 2px;
}

@keyframes demoPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Demo restart button */
.demo-restart {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.btn-demo-restart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-demo-restart:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-demo-restart svg {
  transition: transform 0.3s;
}

.btn-demo-restart:hover svg {
  transform: rotate(-180deg);
}

/* Demo Progress Panel */
.demo-progress-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

.demo-progress-label {
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 20px;
  font-size: 15px;
}

.demo-progress-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
}

.demo-progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.demo-progress-circle circle {
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-progress-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}

.demo-progress-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Steps Grid - 3 columns */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card-new {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.step-card-new:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.step-number-new {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.step-card-new h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 12px;
}

.step-card-new p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Use Cases Grid - 3 columns new */
.use-cases-grid-new {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.use-case-new {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.2s;
}

.use-case-new:hover {
  background: white;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.use-case-icon-new {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}

.use-case-icon-new img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.use-case-new h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 12px;
}

.use-case-new p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Trust Section */
.trust-section {
  padding: 40px 0;
}

.trust-items {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.trust-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-icon svg {
  width: 22px;
  height: 22px;
}

/* Final CTA */
.cta-final {
  margin-top: 40px;
}

/* Responsive New Landing */
@media (max-width: 900px) {
  .hero-content-new {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-text-new {
    text-align: center;
    order: 2;
  }

  .hero-bob-new {
    order: 1;
  }

  .hero-title-new {
    font-size: 36px;
  }

  .hero-subtitle-new {
    font-size: 18px;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-benefits {
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto;
  }

  .demo-container {
    grid-template-columns: 1fr;
  }

  .demo-progress-panel {
    display: flex;
    align-items: center;
    gap: 24px;
    text-align: left;
  }

  .demo-progress-label {
    margin-bottom: 0;
  }

  .demo-progress-circle {
    width: 100px;
    height: 100px;
    margin: 0;
    flex-shrink: 0;
  }

  .demo-progress-value {
    font-size: 24px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .use-cases-grid-new {
    grid-template-columns: 1fr;
  }

  .trust-items {
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto;
    gap: 24px;
  }
}

@media (max-width: 600px) {
  .hero-new {
    padding: 40px 0 60px;
  }

  .hero-title-new {
    font-size: 28px;
  }

  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas a {
    width: 100%;
  }

  .demo-messages {
    min-height: 180px;
  }

  .demo-progress-panel {
    flex-direction: column;
    text-align: center;
  }

  .step-card-new {
    padding: 24px 20px;
  }

  .use-case-new {
    padding: 24px 20px;
  }
}

/* Button as link */
a.btn-secondary,
a.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  z-index: 1000;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: var(--border);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 1000;
  min-width: 140px;
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.lang-menu button:hover {
  background: var(--bg);
}

@media (max-width: 600px) {
  .lang-btn {
    padding: 6px 10px;
  }

  .lang-menu {
    right: -10px;
  }

  /* Hide "Teach Bob" text on mobile, show only icon */
  .logo h1 {
    display: none;
  }

  .logo {
    gap: 0;
  }
}

/* ============================================
   PRICING MODAL STYLES
   ============================================ */

.credits-display {
  cursor: pointer;
  transition: all 0.2s;
}

.credits-display:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.credits-add {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-wide {
  max-width: 800px;
}

/* Material Review Modal */
.modal-icon {
  margin-right: 8px;
}

.material-review-content {
  max-height: 50vh;
  overflow-y: auto;
  margin: 20px 0;
  padding-right: 8px;
}

.review-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.review-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.review-text {
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.review-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.review-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.review-list li:last-child {
  border-bottom: none;
}

.review-list li::before {
  content: '•';
  position: absolute;
  left: 8px;
  color: var(--primary);
  font-weight: bold;
}

.review-list li.empty {
  color: var(--text-muted);
  font-style: italic;
}

.review-list li.empty::before {
  content: '';
}

.review-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.review-hint {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Review modal: view mode vs review mode */
.view-mode-only {
  display: none;
}

.review-footer.view-mode .review-mode-only {
  display: none;
}

.review-footer.view-mode .view-mode-only {
  display: flex;
  justify-content: center;
}

/* Credits Explanation */
.credits-explain-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.credits-explain-box h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #0369a1;
}

.credits-explain-box ul {
  margin: 0;
  padding-left: 20px;
}

.credits-explain-box li {
  font-size: 13px;
  color: #0c4a6e;
  margin-bottom: 4px;
}

.credits-explain-box li:last-child {
  margin-bottom: 0;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.pricing-card {
  position: relative;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.pricing-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.pricing-card.popular {
  border-color: var(--primary);
  background: linear-gradient(180deg, #eef2ff 0%, white 100%);
}

.pricing-card.for-schools {
  background: linear-gradient(180deg, #f0fdf4 0%, white 100%);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.pricing-badge.school-badge {
  background: var(--success);
}

.pricing-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 4px;
}

.pricing-credits {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.pricing-price {
  margin-bottom: 8px;
}

.price-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--secondary);
}

.pricing-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  min-height: 44px;
}

.price-per-credit {
  font-size: 12px;
  color: var(--text-muted);
}

.price-savings {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin: 0 auto;
}

/* Promo Code Section */
.pricing-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
}

.credit-code-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.credit-code-input-row {
  display: flex;
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}


.credit-code-input-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  text-transform: uppercase;
}

.credit-code-input-row button {
  flex-shrink: 0;
  white-space: nowrap;
}

.credit-code-input-row input:focus {
  outline: none;
  border-color: var(--primary);
}

#credit-code-result {
  margin-top: 12px;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius);
}

#credit-code-result.success {
  background: #d1fae5;
  color: #047857;
}

#credit-code-result.error {
  background: #fee2e2;
  color: #dc2626;
}

/* Responsive Pricing */
@media (max-width: 800px) {
  .modal-wide {
    max-width: calc(100vw - 32px);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .pricing-card {
    padding: 16px 12px;
  }

  .price-amount {
    font-size: 24px;
  }

  .pricing-header h3 {
    font-size: 16px;
  }
}

@media (max-width: 500px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 16px;
    text-align: left;
    padding: 16px;
  }

  .pricing-badge {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    width: fit-content;
    margin-bottom: 4px;
  }

  .pricing-header {
    grid-column: 1;
    grid-row: 2;
  }

  .pricing-price {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
    margin: 0;
  }

  .pricing-details {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    min-height: auto;
    margin-bottom: 8px;
  }

  .pricing-card button {
    grid-column: 1 / -1;
  }

}

/* Manage Promo Link */
.manage-credit-code-section {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ============================================
   PROMO CODE MANAGEMENT STYLES
   ============================================ */

.credit-code-create-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.credit-code-create-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 16px;
}

.credit-code-create-form .form-group {
  margin-bottom: 12px;
}

.credit-code-create-form .form-group label {
  font-size: 14px;
  font-weight: 500;
}

.credit-code-create-form .form-group input {
  padding: 10px 12px;
  font-size: 14px;
}

.credit-code-cost-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.credit-code-cost-preview strong {
  font-size: 18px;
  color: var(--warning);
}

#credit-code-create-result {
  margin-top: 12px;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius);
  text-align: center;
}

#credit-code-create-result.success {
  background: #d1fae5;
  color: #047857;
}

#credit-code-create-result.error {
  background: #fee2e2;
  color: #dc2626;
}

.credit-code-list-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 16px;
}

.credit-codes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credit-code-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.credit-code-info {
  flex: 1;
  min-width: 200px;
}

.credit-code-value {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
  cursor: pointer;
}

.credit-code-value:hover {
  background: var(--primary);
  color: white;
}

.credit-code-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.credit-code-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.credit-code-stat strong {
  color: var(--text);
}

.credit-code-actions {
  display: flex;
  gap: 8px;
}

.credit-code-actions .btn-danger {
  padding: 8px 12px;
  font-size: 13px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.credit-code-actions .btn-danger:hover {
  background: #dc2626;
  color: white;
}

.credit-code-expired {
  opacity: 0.6;
}

.credit-code-expired .credit-code-value {
  text-decoration: line-through;
}

.no-credit-codes {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.loading-text {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .credit-code-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .credit-code-actions {
    width: 100%;
  }

  .credit-code-actions button {
    flex: 1;
  }
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--secondary);
  color: white;
  padding: 16px 24px;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}

.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-buttons .btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.cookie-buttons .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* App Footer */
.app-footer {
  padding: 16px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  color: var(--text-muted);
}

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-sep {
  opacity: 0.4;
}

/* Legal Modal Styles */
.modal-legal {
  max-width: 700px;
  max-height: 85vh;
}

.modal-legal .modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.legal-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.legal-text h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-text h3:first-of-type {
  margin-top: 16px;
}

.legal-text p {
  margin-bottom: 12px;
}

.legal-text strong {
  color: var(--text);
}

/* Support Form Styles */
.support-status {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
}

.support-status.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.support-status.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

#support-modal .modal-content {
  max-width: 480px;
}

#support-form .form-group {
  margin-bottom: 16px;
}

#support-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

#support-form input,
#support-form textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

#support-form input:focus,
#support-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

#support-form textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-full {
  width: 100%;
}

@media (max-width: 600px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }

  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }

  .app-footer {
    display: none;
  }
}

/* ===== Attachments Section ===== */
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}

.attachments-upload-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.attachments-upload-area.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.btn-upload:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(88, 86, 214, 0.05);
}

.btn-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-upload svg {
  flex-shrink: 0;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* PDF Preview */
.topic-pdf-preview {
  margin-top: 12px;
}

.topic-pdf-preview.hidden {
  display: none;
}

.pdf-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.pdf-preview-item svg {
  color: #dc2626;
  flex-shrink: 0;
}

.pdf-name {
  font-weight: 500;
  word-break: break-all;
}

.pdf-size {
  color: var(--text-muted);
  font-size: 12px;
}

.btn-remove-pdf {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.btn-remove-pdf:hover {
  color: #dc2626;
}

/* ==================== iOS Fixes ==================== */

/* Prevent iOS zoom on input focus (requires font-size >= 16px) */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Ensure proper touch targets on iOS (min 44px) */
@media screen and (max-width: 768px) {
  button,
  .btn-primary,
  .btn-secondary,
  a.btn-primary,
  a.btn-secondary {
    min-height: 44px;
  }
}

/* iOS safe area for bottom fixed elements */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .input-row,
  .chat-input-container {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
