/* global window */
// Logiq Kidz · data.jsx — mock content for kids learning app (ages 5–7)
window.LK = window.LK || {};

window.LK.player = {
  name: 'Bima',
  age: 6,
  avatar: 'pico',     // chosen mascot
  streak: 4,
  stars: 28,
  coins: 142,
  badgesUnlocked: 4,
  badgesTotal: 12,
  minutesToday: 12,
  minutesLimit: 20,
  isPremium: false,
};

// Five learning tracks (subjects), each tied to a mascot.
window.LK.tracks = [
  { key: 'logic',  name: 'Logika',     tagline: 'Asah pikiran',        color: '#6C5CE7', soft: '#EEEAFD', mascot: 'pico',  progress: 0.42, lessonsDone: 8,  lessonsTotal: 19, recommended: true,  free: true },
  { key: 'math',   name: 'Matematika', tagline: 'Hitung & pola',       color: '#FFB02E', soft: '#FFF1D6', mascot: 'numo',  progress: 0.30, lessonsDone: 6,  lessonsTotal: 20, free: true },
  { key: 'stem',   name: 'Sains',      tagline: 'Eksperimen seru',     color: '#4ECDC4', soft: '#DEF6F4', mascot: 'sparky',progress: 0.18, lessonsDone: 3,  lessonsTotal: 17, free: false },
  { key: 'code',   name: 'Koding',     tagline: 'Geser & jalankan',    color: '#FF8E53', soft: '#FFE2D2', mascot: 'bytey', progress: 0.10, lessonsDone: 2,  lessonsTotal: 20, free: false },
  { key: 'chess',  name: 'Catur',      tagline: 'Strategi & langkah',  color: '#FF6B9D', soft: '#FFDDEA', mascot: 'rooky', progress: 0.05, lessonsDone: 1,  lessonsTotal: 18, free: false },
];

// Logic course detail — 8 lessons, vertical path (Duolingo-style nodes)
window.LK.course = {
  track: 'logic',
  title: 'Petualangan Logika',
  subtitle: 'Bersama Pico si burung hantu pintar',
  level: 'Level 1 · Pemula',
  lessons: [
    { key: 'L1', name: 'Mana yang Sama?',     type: 'match',    state: 'done',     stars: 3, free: true },
    { key: 'L2', name: 'Cari yang Berbeda',   type: 'odd-one',  state: 'done',     stars: 3, free: true },
    { key: 'L3', name: 'Urutan Warna',        type: 'sequence', state: 'done',     stars: 2, free: true },
    { key: 'L4', name: 'Lanjutkan Pola',      type: 'pattern',  state: 'current',  stars: 0, free: true },
    { key: 'L5', name: 'Bayangan Tersembunyi',type: 'shadow',   state: 'locked',   stars: 0, free: true },
    { key: 'L6', name: 'Kelompokkan Bentuk',  type: 'group',    state: 'locked',   stars: 0, free: false },
    { key: 'L7', name: 'Teka-teki Pico',      type: 'puzzle',   state: 'locked',   stars: 0, free: false },
    { key: 'L8', name: 'Ujian Akhir Level',   type: 'boss',     state: 'locked',   stars: 0, free: false, boss: true },
  ],
};

// Current puzzle (lesson L4 — "Lanjutkan Pola")
// Show shapes in a sequence with one missing slot + 3 multiple-choice options.
window.LK.puzzle = {
  prompt: 'Lanjutkan pola berikut',
  hint: 'Lihat warna dan bentuk. Apa yang akan muncul setelah segitiga kuning?',
  sequence: [
    { kind: 'circle',   color: '#FF6B9D' },
    { kind: 'square',   color: '#4ECDC4' },
    { kind: 'triangle', color: '#FFB02E' },
    { kind: 'circle',   color: '#FF6B9D' },
    { kind: 'square',   color: '#4ECDC4' },
    null, // missing slot
  ],
  options: [
    { kind: 'triangle', color: '#FFB02E', correct: true },
    { kind: 'circle',   color: '#4ECDC4', correct: false },
    { kind: 'square',   color: '#FF6B9D', correct: false },
  ],
  step: 4,
  steps: 5,
  hintsLeft: 2,
};

// Badges (achievements)
window.LK.badges = [
  { key: 'first-step',  name: 'Langkah Pertama', desc: 'Selesaikan 1 pelajaran',         icon: 'star',    unlocked: true,  color: '#FFB02E' },
  { key: 'streak-3',    name: 'Tiga Hari',       desc: 'Belajar 3 hari berturut-turut',  icon: 'flame',   unlocked: true,  color: '#FF8E53' },
  { key: 'logic-rookie',name: 'Junior Logika',   desc: 'Selesai 5 pelajaran Logika',     icon: 'sparkle', unlocked: true,  color: '#6C5CE7' },
  { key: 'math-rookie', name: 'Si Hitung',       desc: 'Selesai 5 pelajaran Matematika', icon: 'star',    unlocked: true,  color: '#FFB02E' },
  { key: 'streak-7',    name: 'Satu Minggu',     desc: 'Belajar 7 hari berturut-turut',  icon: 'flame',   unlocked: false, color: '#FF8E53' },
  { key: 'all-mascots', name: 'Kawan Lengkap',   desc: 'Buka 5 mascot teman',            icon: 'gift',    unlocked: false, color: '#4ECDC4' },
  { key: 'puzzle-30',   name: '30 Teka-teki',    desc: '30 pelajaran selesai',           icon: 'check',   unlocked: false, color: '#6C5CE7' },
  { key: 'code-rookie', name: 'Koder Cilik',     desc: 'Selesai pelajaran Koding pertama', icon: 'sparkle', unlocked: false, color: '#FF8E53' },
  { key: 'chess-rookie',name: 'Pengintai Catur', desc: 'Selesai pelajaran Catur pertama', icon: 'star',    unlocked: false, color: '#FF6B9D' },
  { key: 'stars-50',    name: '50 Bintang',      desc: 'Kumpulkan 50 bintang',           icon: 'star',    unlocked: false, color: '#FFB02E' },
  { key: 'no-rush',     name: 'Pelan tapi Pasti', desc: 'Istirahat tepat waktu 5 kali',  icon: 'leaf',    unlocked: false, color: '#4ECDC4' },
  { key: 'all-tracks',  name: 'Penjelajah',      desc: 'Coba semua 5 mata pelajaran',    icon: 'mapPin',  unlocked: false, color: '#6C5CE7' },
];

// Avatar choices for onboarding
window.LK.avatars = ['pico', 'numo', 'sparky', 'bytey', 'rooky'];

// Weekly progress (Parent Zone)
window.LK.weekly = [
  { day: 'Sen', minutes: 18, stars: 6 },
  { day: 'Sel', minutes: 20, stars: 7 },
  { day: 'Rab', minutes: 14, stars: 4 },
  { day: 'Kam', minutes: 19, stars: 6 },
  { day: 'Jum', minutes: 20, stars: 8 },
  { day: 'Sab', minutes: 0,  stars: 0 },
  { day: 'Min', minutes: 12, stars: 4 },
];

window.LK.findTrack = (key) => window.LK.tracks.find((t) => t.key === key);
window.LK.findLesson = (key) => window.LK.course.lessons.find((l) => l.key === key);
