@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --primary: #33691E;
  --secondary: #558B2F;
  --tertiary: #689F38;
  --light: #8BC34A;
  --primary-dark: #F1F8E9;
  --bg: #F5F0ED;
  --bg-card: #FEFCFB;
  --bg-hover: #F0E8E3;
  --text: #3E2723;
  --text-secondary: #6D4C41;
  --text-muted: #8D6E63;
  --border: #D7CCC8;
  --border-light: #EFEBE9;
  --success: #66BB6A;
  --error: #EF5350;
  --warning: #FFA726;
  --shadow-sm: 0 1px 3px rgba(62, 39, 35, 0.06);
  --shadow-md: 0 4px 12px rgba(62, 39, 35, 0.08);
  --shadow-lg: 0 8px 24px rgba(62, 39, 35, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ========== HEADER ========== */
.app-header {
  text-align: center;
  padding: 32px 16px 24px;
  animation: fadeInDown 0.6s ease both;
}

.app-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 300;
}

/* ========== TAB NAV ========== */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
  position: sticky;
  top: 8px;
  z-index: 100;
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.1s;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(141, 110, 99, 0.3);
}

.tab-icon {
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .tab-label {
    display: none;
  }
  .tab-icon {
    font-size: 1.3rem;
  }
}

/* ========== SECTIONS ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.subsection-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.word-count-badge {
  background: var(--light);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ========== JOURNAL ========== */
.journal-container {
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.15s;
}

.journal-form-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

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

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

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

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-textarea,
.search-input,
.filter-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.15);
}

.form-input.compact,
.form-textarea.compact {
  padding: 8px 10px;
  font-size: 0.88rem;
}

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

/* ========== BUTTONS ========== */
.btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

.btn-primary.btn-large {
  padding: 16px 32px;
  font-size: 1.05rem;
  width: 100%;
  margin-top: 8px;
}

.btn-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-small {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

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

.btn-cancel:hover {
  background: var(--bg-hover);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
  opacity: 0.6;
}

.btn-icon:hover {
  opacity: 1;
  background: var(--bg-hover);
}

/* ========== SUCCESS MESSAGE ========== */
.success-message {
  background: rgba(102, 187, 106, 0.12);
  color: #2E7D32;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  animation: fadeInUp 0.3s ease both;
}

/* ========== RECENT WORDS ========== */
.recent-words-section {
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.25s;
}

.recent-words-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-word-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.recent-word-card:nth-child(1) { animation-delay: 0s; }
.recent-word-card:nth-child(2) { animation-delay: 0.05s; }
.recent-word-card:nth-child(3) { animation-delay: 0.1s; }
.recent-word-card:nth-child(4) { animation-delay: 0.15s; }
.recent-word-card:nth-child(5) { animation-delay: 0.2s; }

.recent-word-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--tertiary);
}

.recent-word-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-word-text {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.recent-word-translation {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recent-word-pron {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.language-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ========== MASTERY ========== */
.mastery-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.mastery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease;
}

.mastery-dot.filled {
  background: var(--primary);
}

.mastery-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.mastery-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.mastery-0 { background: var(--border-light); color: var(--text-muted); }
.mastery-1 { background: rgba(255, 167, 38, 0.15); color: #E65100; }
.mastery-2 { background: rgba(141, 110, 99, 0.15); color: var(--primary-dark); }
.mastery-3 { background: rgba(161, 136, 127, 0.2); color: var(--primary-dark); }
.mastery-4,
.mastery-5 { background: rgba(102, 187, 106, 0.15); color: #2E7D32; }

.mastery-bar-container {
  flex: 1;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.mastery-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 0;
}

.mastery-percent {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* ========== WORD LIST ========== */
.wordlist-container {
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.15s;
}

.wordlist-controls {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-bar {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding-left: 40px;
}

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 140px;
}

.results-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
}

.word-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.word-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.word-card:nth-child(1) { animation-delay: 0s; }
.word-card:nth-child(2) { animation-delay: 0.03s; }
.word-card:nth-child(3) { animation-delay: 0.06s; }
.word-card:nth-child(4) { animation-delay: 0.09s; }
.word-card:nth-child(5) { animation-delay: 0.12s; }
.word-card:nth-child(6) { animation-delay: 0.15s; }
.word-card:nth-child(7) { animation-delay: 0.18s; }
.word-card:nth-child(8) { animation-delay: 0.21s; }

.word-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--tertiary);
}

.word-card.editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

.word-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.word-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.word-card-word {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.word-card-translation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.word-card-pron {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.word-card-example {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--tertiary);
  font-style: italic;
}

.word-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* ========== QUIZ ========== */
.quiz-container {
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.15s;
}

.quiz-setup {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.setup-option {
  margin-bottom: 20px;
}

.option-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.option-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

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

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

.range-input {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--primary);
}

.range-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pool-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Quiz progress */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quiz-progress-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Quiz card */
.quiz-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  text-align: center;
  animation: fadeInUp 0.4s ease both;
}

.quiz-direction {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quiz-prompt {
  font-family: 'Libre Baskerville', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.quiz-hint-pron {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 8px;
}

.quiz-answer-area {
  margin: 24px 0;
}

.quiz-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.2rem;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  max-width: 400px;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
}

.quiz-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(141, 110, 99, 0.15);
}

.quiz-input.correct {
  border-color: var(--success);
  background: rgba(102, 187, 106, 0.08);
}

.quiz-input.incorrect {
  border-color: var(--error);
  background: rgba(239, 83, 80, 0.08);
}

.quiz-feedback {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  animation: fadeInUp 0.3s ease both;
}

.quiz-feedback.correct {
  background: rgba(102, 187, 106, 0.12);
  color: #2E7D32;
}

.quiz-feedback.incorrect {
  background: rgba(239, 83, 80, 0.1);
  color: #C62828;
}

.feedback-text strong {
  font-family: 'Libre Baskerville', serif;
}

.quiz-actions {
  margin-top: 20px;
}

/* Quiz results */
.quiz-results {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}

.results-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.results-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.score-big {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  font-family: 'Libre Baskerville', serif;
}

.score-percent {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
}

.results-breakdown {
  text-align: left;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.result-row.correct {
  background: rgba(102, 187, 106, 0.08);
}

.result-row.incorrect {
  background: rgba(239, 83, 80, 0.06);
}

.result-icon {
  font-weight: 700;
  font-size: 1rem;
  width: 20px;
}

.result-row.correct .result-icon { color: var(--success); }
.result-row.incorrect .result-icon { color: var(--error); }

.result-word {
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
}

.result-answer {
  color: var(--text-secondary);
}

.result-yours {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--error);
  font-style: italic;
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== STATS ========== */
.stats-container {
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.15s;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0 28px;
}

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }
.stat-card:nth-child(6) { animation-delay: 0.25s; }

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

.stat-card.highlight {
  border-top: 3px solid var(--primary);
}

.stat-card.accent {
  border-top: 3px solid var(--success);
}

.stat-card.warn {
  border-top: 3px solid var(--warning);
}

.stat-number {
  display: block;
  font-family: 'Libre Baskerville', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

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

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.3s;
}

.chart-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.recent-quiz-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
}

.recent-quiz-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-quiz-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.88rem;
}

.rq-word {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.rq-mastery {
  font-weight: 600;
  color: var(--primary);
}

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

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  animation: fadeInUp 0.5s ease both;
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

/* ========== SKELETON ========== */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-card {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--light) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  height: 60px;
}

.skeleton-card.tall {
  height: 100px;
}

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

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

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

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your Vocabulary Journal! This is your personal language learning companion. You're on the Journal tab where you can add new words.", "view": "user", "highlight_selector": ".journal-form-section", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Enter a word or phrase in your target language, its translation, and optionally add pronunciation notes and an example sentence.", "view": "user", "highlight_selector": ".word-form", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Your recently added words appear below the form with their mastery level dots — all starting at 0% until you quiz yourself.", "view": "user", "highlight_selector": ".recent-words-section", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Switch to the Words tab to see your full vocabulary collection. Search, sort by mastery or date, and filter by language.", "view": "user", "highlight_selector": ".tab-nav", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Each word card shows its mastery level, pronunciation, and example sentence. Click the edit or delete icons to manage entries.", "view": "user", "highlight_selector": ".word-cards-grid", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Head to the Quiz tab to test yourself! Choose your quiz direction, focus on weak words, and set the number of questions.", "view": "user", "highlight_selector": ".quiz-setup", "wait_for": "user_interaction"},
  {"step": 7, "narration": "During the quiz, type your answer and press Enter. Each answer updates the word's mastery percentage — correct answers increase it, wrong answers decrease it.", "view": "user", "highlight_selector": ".quiz-card", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "After completing a quiz, review your results showing which words you got right and wrong. Your mastery scores are updated automatically.", "view": "user", "highlight_selector": ".quiz-results", "wait_for": "tap_to_continue"},
  {"step": 9, "narration": "The Stats tab gives you an overview of your progress — total words, average mastery, quiz accuracy, and charts showing your mastery distribution.", "view": "user", "highlight_selector": ".stats-grid", "wait_for": "tap_to_continue"}
]
-->

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

.ai-preview-card {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-preview-text,
.ai-preview-tip,
.recent-word-example,
.recent-word-tip {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.recent-word-example {
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--tertiary);
  font-style: italic;
}

.recent-word-tip {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tts-button {
  margin-left: auto;
  font-size: 1rem;
}

.chart-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mastery-trend-card {
  margin-bottom: 24px;
}

.empty-trend-state {
  padding: 24px 8px 8px;
  text-align: center;
}

.export-btn {
  white-space: nowrap;
}
