
/* === Learning System === */
/* Child-friendly, responsive design for gamified learning */

.learning-home {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.learning-home h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.intro {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  line-height: 1.6;
}

.learning-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.level-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.level-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.8rem;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.level-card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.progress {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.progress-bar {
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-text {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.xp-reward {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 12px;
}

.level-card button {
  width: 100%;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.level-card button:hover {
  opacity: 0.9;
}

.xp-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.xp-section h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.xp-display {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.badges {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
}

.badges h3 {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.badge {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s;
}

.badge:hover {
  transform: scale(1.05);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.badge-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.level-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.level-header {
  border-radius: 12px;
  padding: 30px 20px;
  margin-bottom: 24px;
}

.level-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: white;
}

.level-header p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

.level-stats {
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
}

.level-terms h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.terms-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.term-link {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}

.term-link:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.level-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.start-quiz-btn {
  flex: 1;
  padding: 16px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.start-quiz-btn:hover {
  opacity: 0.9;
}

.back-btn {
  padding: 16px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn:hover {
  color: var(--text-primary);
}

/* Quiz page */
.quiz-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.quiz-container {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 24px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--bg-tertiary);
}

.quiz-level {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-primary);
}

.quiz-xp {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
}

.quiz-question {
  margin-bottom: 24px;
}

.quiz-question h3 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.quiz-question p {
  font-size: 1.1rem;
  line-height: 1.6;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-options button {
  padding: 14px 18px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quiz-options button:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
}

.quiz-options button.correct {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4CAF50;
  color: #4CAF50;
}

.quiz-options button.incorrect {
  background: rgba(244, 67, 54, 0.2);
  border-color: #F44336;
  color: #F44336;
}

.quiz-explanation {
  margin-top: 20px;
  padding: 16px;
  background: rgba(33, 150, 243, 0.1);
  border-radius: 8px;
  border-left: 4px solid #2196F3;
}

.quiz-explanation p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.quiz-feedback {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  display: none;
}

.quiz-feedback.pass {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  display: block;
}

.quiz-feedback.fail {
  background: rgba(244, 67, 54, 0.2);
  color: #F44336;
  display: block;
}

.quiz-nav {
  margin-top: 24px;
  display: flex;
  gap: 16px;
}

.quiz-nav button {
  flex: 1;
  padding: 14px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.quiz-nav button.hidden {
  display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .learning-home h1 {
    font-size: 2rem;
  }

  .level-card {
    padding: 16px;
  }

  .badge-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .badge-icon {
    font-size: 2rem;
  }
}
