// Coptic Deacon Training — content data
// Authentic hymns, ranks, lessons. Coptic script + transliteration + English.

const RANKS = [
  {
    id: 'epsaltos',
    name: 'Epsaltos',
    nameCop: 'Ⲯⲁⲗⲧⲏⲥ',
    arabic: 'إبصالتس',
    en: 'Chanter',
    order: 1,
    color: '#C9A961',
    desc: 'The first rank. Leads the congregation in psalms and hymns.',
    duties: ['Lead congregational responses', 'Chant psalms in tone', 'Memorize the Psalmody'],
    progress: 1.0,
  },
  {
    id: 'anagnostis',
    name: 'Anagnostis',
    nameCop: 'Ⲁⲛⲁⲅⲛⲱⲥⲧⲏⲥ',
    arabic: 'أغنسطس',
    en: 'Reader',
    order: 2,
    color: '#A8763E',
    desc: 'Reads the Pauline, Catholic, and Acts during the Liturgy.',
    duties: ['Read the Pauline Epistle', 'Read the Catholic Epistle', 'Read the Praxis'],
    progress: 0.62,
  },
  {
    id: 'ypodiakon',
    name: 'Ypodiakon',
    nameCop: 'Ϩⲩⲡⲟⲇⲓⲁⲕⲱⲛ',
    arabic: 'إيبوذياكون',
    en: 'Subdeacon',
    order: 3,
    color: '#8B2E2E',
    desc: 'Serves at the altar, prepares the vessels, guards the sanctuary doors.',
    duties: ['Prepare liturgical vessels', 'Guard the sanctuary', 'Assist the Deacon'],
    progress: 0.34,
  },
  {
    id: 'diakon',
    name: 'Diakon',
    nameCop: 'Ⲇⲓⲁⲕⲱⲛ',
    arabic: 'دياكون',
    en: 'Full Deacon',
    order: 4,
    color: '#4A1F2E',
    desc: 'Proclaims the Gospel, leads the responses, ministers with the priest.',
    duties: ['Proclaim the Gospel', 'Lead the litanies', 'Distribute the Holy Body'],
    progress: 0.08,
  },
  {
    id: 'arshidiakon',
    name: 'Arshidiakon',
    nameCop: 'Ⲁⲣⲭⲏⲇⲓⲁⲕⲱⲛ',
    arabic: 'أرشيدياكون',
    en: 'Archdeacon',
    order: 5,
    color: '#2A0E1A',
    desc: 'Chief of the deacons. Coordinates the diaconal service of the church.',
    duties: ['Oversee deacons', 'Lead processions', 'Train new chanters'],
    progress: 0,
    locked: true,
  },
];

const TONES = [
  { id: 'annual', name: 'Annual', cop: 'Ⲣⲟⲙⲡⲓ', desc: 'Used most of the year' },
  { id: 'festal', name: 'Festive', cop: 'Ⲡϣⲁⲓ', desc: 'Lord\'s feasts & resurrection' },
  { id: 'lenten', name: 'Lenten', cop: 'Ⲛⲏⲥⲧⲓⲁ', desc: 'Great Lent & weekday fasts' },
  { id: 'sad', name: 'Sad / Pascha', cop: 'Ⲡⲁⲥⲭⲁ', desc: 'Holy Week, funerals' },
  { id: 'palm', name: 'Palm Sunday', cop: 'Ⲃⲁϊⲁ', desc: 'Hosanna tone' },
];

// Hymns with line-by-line lyrics in Coptic, transliteration, English
const HYMNS = [
  {
    id: 'agios',
    title: 'Agios O Theos',
    titleCop: 'Ⲁ̀ⲅⲓⲟⲥ ⲟ̀ Ⲑⲉⲟⲥ',
    titleEn: 'Holy God',
    duration: 184,
    tone: 'annual',
    rank: 'epsaltos',
    difficulty: 1,
    occasion: 'Trisagion — sung before the Gospel',
    lines: [
      { t: 0,   cop: 'Ⲁ̀ⲅⲓⲟⲥ ⲟ̀ Ⲑⲉⲟⲥ',          tr: 'Agios o Theos',           en: 'Holy God' },
      { t: 14,  cop: 'Ⲁ̀ⲅⲓⲟⲥ Ⲓⲥⲭⲩⲣⲟⲥ',         tr: 'Agios Ischyros',          en: 'Holy Mighty' },
      { t: 30,  cop: 'Ⲁ̀ⲅⲓⲟⲥ Ⲁ̀ⲑⲁⲛⲁⲧⲟⲥ',         tr: 'Agios Athanatos',         en: 'Holy Immortal' },
      { t: 50,  cop: 'Ⲟ̀ ⲥⲧⲁⲩⲣⲱⲑⲓⲥ ⲇⲓ ⲏ̀ⲙⲁⲥ',     tr: 'O stavrothis di imas',    en: 'Who was crucified for us' },
      { t: 78,  cop: 'Ⲉ̀ⲗⲉⲏⲥⲟⲛ ⲏ̀ⲙⲁⲥ',           tr: 'Eleison imas',            en: 'Have mercy upon us' },
      { t: 110, cop: 'Ⲇⲟⲝⲁ Ⲡⲁⲧⲣⲓ ⲕⲉ Ⲩ̀ⲓⲱ',       tr: 'Doxa Patri ke Yio',       en: 'Glory to the Father and the Son' },
      { t: 138, cop: 'Ⲕⲉ Ⲁ̀ⲅⲓⲱ Ⲡⲛⲉⲩⲙⲁⲧⲓ',         tr: 'Ke Agio Pnevmati',        en: 'And the Holy Spirit' },
      { t: 160, cop: 'Ⲁⲙⲏⲛ. Ⲁⲗⲗⲏⲗⲟⲩⲓⲁ',         tr: 'Amen. Allelouia',         en: 'Amen. Alleluia' },
    ],
  },
  {
    id: 'kyrie',
    title: 'Kyrie Eleison',
    titleCop: 'Ⲕⲩⲣⲓⲉ ⲉⲗⲉⲏⲥⲟⲛ',
    titleEn: 'Lord have mercy',
    duration: 92,
    tone: 'annual',
    rank: 'epsaltos',
    difficulty: 1,
    occasion: 'Litany response — sung throughout the Liturgy',
    lines: [
      { t: 0,  cop: 'Ⲕⲩⲣⲓⲉ ⲉⲗⲉⲏⲥⲟⲛ',  tr: 'Kyrie eleison', en: 'Lord have mercy' },
      { t: 18, cop: 'Ⲕⲩⲣⲓⲉ ⲉⲗⲉⲏⲥⲟⲛ',  tr: 'Kyrie eleison', en: 'Lord have mercy' },
      { t: 36, cop: 'Ⲕⲩⲣⲓⲉ ⲉⲗⲉⲏⲥⲟⲛ',  tr: 'Kyrie eleison', en: 'Lord have mercy' },
    ],
  },
  {
    id: 'hiten',
    title: 'Hiten',
    titleCop: 'Ϩⲓⲧⲉⲛ',
    titleEn: 'Through the intercessions',
    duration: 248,
    tone: 'annual',
    rank: 'anagnostis',
    difficulty: 2,
    occasion: 'Sung after the Gospel reading',
    lines: [
      { t: 0,   cop: 'Ϩⲓⲧⲉⲛ ⲛⲓⲡⲣⲉⲥⲃⲓⲁ',           tr: 'Hiten ni-presvia',          en: 'Through the intercessions' },
      { t: 28,  cop: 'Ⲛ̀ⲧⲉ ϯⲑⲉⲟⲧⲟⲕⲟⲥ ⲉ̀ⲑⲟⲩⲁⲃ Ⲙⲁⲣⲓⲁ',  tr: 'Ente ti-Theotokos eth-ouab Maria', en: 'Of the holy Theotokos Mary' },
      { t: 64,  cop: 'Ⲡϭⲟⲓⲥ ⲁ̀ⲣⲓϩ̀ⲙⲟⲧ ⲛⲁⲛ',         tr: 'Eptchoys arihmot nan',      en: 'O Lord grant us' },
      { t: 100, cop: 'Ⲙ̀ⲡⲓⲭⲱ ⲉ̀ⲃⲟⲗ ⲛ̀ⲧⲉ ⲛⲉⲛⲛⲟⲃⲓ',     tr: 'Empikho evol ente nennovi', en: 'The forgiveness of our sins' },
      { t: 150, cop: 'Ⲧⲉⲛⲟⲩⲱϣⲧ ⲙ̀ⲙⲟⲕ ⲱ̀ Ⲡⲭ̅ⲥ̅',      tr: 'Tenoosht emmok o Pi-Christos', en: 'We worship You O Christ' },
      { t: 200, cop: 'Ⲛⲉⲙ Ⲡⲉⲕⲓⲱⲧ ⲛ̀ⲁ̀ⲅⲁⲑⲟⲥ',         tr: 'Nem Pekiot en-aghathos',    en: 'With Your Good Father' },
    ],
  },
  {
    id: 'pekethronos',
    title: 'Pek-ethronos',
    titleCop: 'Ⲡⲉⲕⲑ̀ⲣⲟⲛⲟⲥ',
    titleEn: 'Your Throne',
    duration: 312,
    tone: 'festal',
    rank: 'anagnostis',
    difficulty: 3,
    occasion: 'Psalm 50 paraphrase, sung in the Resurrection rite',
    lines: [
      { t: 0,   cop: 'Ⲡⲉⲕⲑ̀ⲣⲟⲛⲟⲥ Ⲫϯ',     tr: 'Pek-ethronos eF-noyti', en: 'Your throne, O God' },
      { t: 40,  cop: 'ϣⲁ ⲉ̀ⲛⲉϩ ⲛ̀ⲧⲉ ⲡⲓⲉ̀ⲛⲉϩ', tr: 'Sha eneh ente piehneh', en: 'Endures forever and ever' },
    ],
  },
  {
    id: 'tenoueh',
    title: 'Tenouwosht',
    titleCop: 'Ⲧⲉⲛⲟⲩⲱϣⲧ',
    titleEn: 'We worship You',
    duration: 156,
    tone: 'annual',
    rank: 'epsaltos',
    difficulty: 2,
    occasion: 'Hymn of the Trisagion section',
    lines: [
      { t: 0, cop: 'Ⲧⲉⲛⲟⲩⲱϣⲧ ⲙ̀ⲙⲟⲕ', tr: 'Tenoosht emmok', en: 'We worship You' },
    ],
  },
  {
    id: 'omonogenis',
    title: 'O Monogenis',
    titleCop: 'Ⲟ̀ Ⲙⲟⲛⲟⲅⲉⲛⲏⲥ',
    titleEn: 'Only Begotten Son',
    duration: 268,
    tone: 'annual',
    rank: 'ypodiakon',
    difficulty: 3,
    occasion: 'Hymn of the Only-Begotten Son before the Trisagion',
    lines: [
      { t: 0, cop: 'Ⲟ̀ Ⲙⲟⲛⲟⲅⲉⲛⲏⲥ Ⲩ̀ⲓⲟⲥ', tr: 'O Monogenis Yios', en: 'Only-Begotten Son' },
    ],
  },
  {
    id: 'epouro',
    title: 'Ep-ouro',
    titleCop: 'Ⲡⲟⲩⲣⲟ',
    titleEn: 'O King of Peace',
    duration: 198,
    tone: 'annual',
    rank: 'epsaltos',
    difficulty: 2,
    occasion: 'Sung at the end of Vespers, Matins, and the Liturgy',
    lines: [
      { t: 0,  cop: 'Ⲡⲟⲩⲣⲟ ⲛ̀ⲧⲉ ϯϩⲓⲣⲏⲛⲏ',     tr: 'Epouro ente ti-hirini',   en: 'O King of Peace' },
      { t: 30, cop: 'Ⲙⲟⲓ ⲛⲁⲛ ⲛ̀ⲧⲉⲕϩⲓⲣⲏⲛⲏ',    tr: 'Moi nan entek-hirini',    en: 'Grant us Your peace' },
      { t: 70, cop: 'Ⲥⲉⲙⲛⲓ ⲛⲁⲛ ⲛ̀ⲧⲉⲕϩⲓⲣⲏⲛⲏ',   tr: 'Semni nan entek-hirini',  en: 'Establish for us Your peace' },
      { t:120, cop: 'Ⲭⲁ ⲛⲉⲛⲛⲟⲃⲓ ⲛⲁⲛ ⲉ̀ⲃⲟⲗ',    tr: 'Kha nennovi nan evol',    en: 'And forgive us our sins' },
    ],
  },
  {
    id: 'evlogimenos',
    title: 'Evlogimenos',
    titleCop: 'Ⲉⲩⲗⲟⲅⲏⲙⲉⲛⲟⲥ',
    titleEn: 'Blessed is He',
    duration: 222,
    tone: 'palm',
    rank: 'anagnostis',
    difficulty: 3,
    occasion: 'Hosanna — Palm Sunday entry into Jerusalem',
    lines: [
      { t: 0, cop: 'Ⲉⲩⲗⲟⲅⲏⲙⲉⲛⲟⲥ ⲟ̀ ⲉⲣⲭⲟⲙⲉⲛⲟⲥ', tr: 'Evlogimenos o erkhomenos', en: 'Blessed is He who comes' },
    ],
  },
  {
    id: 'pekran',
    title: 'Pek-ran',
    titleCop: 'Ⲡⲉⲕⲣⲁⲛ',
    titleEn: 'Your Name',
    duration: 144,
    tone: 'sad',
    rank: 'diakon',
    difficulty: 4,
    occasion: 'Pascha week — vespers',
    lines: [
      { t: 0, cop: 'Ⲡⲉⲕⲣⲁⲛ ⲉ̀ⲑⲟⲩⲁⲃ', tr: 'Pekran eth-ouab', en: 'Your Holy Name' },
    ],
  },
];

// Liturgical calendar (sample — Coptic year)
const TODAY = {
  copticDate: '23 Parmouti 1742',
  gregorian: 'Friday, 1 May 2026',
  season: 'Holy Fifty Days',
  fast: null,
  tone: 'festal',
  feast: null,
  readings: [
    { type: 'Pauline',    ref: '1 Cor 15:1–11',  cop: 'Ⲡⲁⲩⲗⲟⲥ' },
    { type: 'Catholic',   ref: '1 John 5:1–12',  cop: 'Ⲕⲁⲑⲟⲗⲓⲕⲟⲛ' },
    { type: 'Praxis',     ref: 'Acts 3:1–21',    cop: 'Ⲡⲣⲁⲝⲓⲥ' },
    { type: 'Synaxarium', ref: 'St. Mark — Founding of the See of Alexandria', cop: 'Ⲥⲩⲛⲁⲝⲁⲣⲓⲟⲛ' },
    { type: 'Psalm',      ref: 'Psalm 65:1–4',   cop: 'Ⲯⲁⲗⲙⲟⲥ' },
    { type: 'Gospel',     ref: 'John 21:1–14',   cop: 'Ⲉⲩⲁⲅⲅⲉⲗⲓⲟⲛ' },
  ],
};

// Curriculum tracks
const TRACKS = [
  {
    id: 'foundations',
    title: 'Foundations of Service',
    rank: 'epsaltos',
    desc: 'Posture, vestments, the Coptic alphabet, basic responses.',
    lessons: 12,
    completed: 12,
  },
  {
    id: 'annual-responses',
    title: 'Annual Tone Responses',
    rank: 'epsaltos',
    desc: 'Every congregational response in the Liturgy of St. Basil.',
    lessons: 18,
    completed: 14,
  },
  {
    id: 'reading-rite',
    title: 'The Reading Rite',
    rank: 'anagnostis',
    desc: 'How to read the Pauline, Catholic, Praxis, and Synaxarium.',
    lessons: 9,
    completed: 5,
  },
  {
    id: 'tasbeha',
    title: 'Tasbeha — Midnight Praises',
    rank: 'anagnostis',
    desc: 'The four Hooses, Psali Watos, Theotokia, Lobsh.',
    lessons: 22,
    completed: 8,
  },
  {
    id: 'altar-service',
    title: 'Altar Service & Vessels',
    rank: 'ypodiakon',
    desc: 'Preparing the bread, wine, paten, chalice; orarion and tunic.',
    lessons: 14,
    completed: 4,
  },
  {
    id: 'holy-week',
    title: 'Pascha & Holy Week Rite',
    rank: 'ypodiakon',
    desc: 'Pek-ethronos, Thok-te-tigom, the twelve hours of Good Friday.',
    lessons: 16,
    completed: 1,
  },
  {
    id: 'gospel-proclamation',
    title: 'Gospel Proclamation',
    rank: 'diakon',
    desc: 'Tone, posture, censer handling. The litanies of peace and the fathers.',
    lessons: 11,
    completed: 0,
  },
];

// Quiz bank
const QUIZ_BANK = [
  {
    id: 'q1',
    type: 'multiple-choice',
    track: 'foundations',
    prompt: 'Which letter is this?',
    coptic: 'Ⲱ',
    options: ['Alpha', 'Omega', 'Pi', 'Sima'],
    correct: 1,
    explain: 'Ⲱ is "Omega" — the last letter of the Coptic alphabet, derived from Greek.',
  },
  {
    id: 'q2',
    type: 'multiple-choice',
    track: 'foundations',
    prompt: 'When does the deacon say "Ⲥⲧⲁⲑⲏⲧⲉ" (Stathite)?',
    options: [
      'After the Gospel reading',
      'Before the Trisagion',
      'Before the Creed',
      'During the Fraction',
    ],
    correct: 2,
    explain: '"Stathite" means "Stand up" — said before the Creed (Ⲡⲓⲥⲧⲉⲩⲱ) to call the congregation to stand.',
  },
  {
    id: 'q3',
    type: 'multiple-choice',
    track: 'annual-responses',
    prompt: 'The response "Ⲕⲩⲣⲓⲉ ⲉⲗⲉⲏⲥⲟⲛ" means…',
    options: ['Holy God', 'Lord have mercy', 'Glory to God', 'Amen'],
    correct: 1,
    explain: 'Kyrie eleison = "Lord have mercy". Repeated as the response to most litanies.',
  },
  {
    id: 'q4',
    type: 'audio',
    track: 'annual-responses',
    prompt: 'Identify this hymn from its opening phrase',
    audio: 'agios',
    options: ['Hiten', 'Agios O Theos', 'Ep-ouro', 'O Monogenis'],
    correct: 1,
    explain: '"Agios o Theos, Agios Ischyros, Agios Athanatos" — the Trisagion before the Gospel.',
  },
  {
    id: 'q5',
    type: 'fill-blank',
    track: 'annual-responses',
    prompt: 'Complete: "Ⲡⲟⲩⲣⲟ ⲛ̀ⲧⲉ ϯ ___"',
    options: ['ϩⲓⲣⲏⲛⲏ (peace)', 'ⲛⲏⲥⲧⲓⲁ (fast)', 'ⲁ̀ⲅⲁⲡⲏ (love)', 'ϣⲱⲓϣ (sacrifice)'],
    correct: 0,
    explain: 'Ⲡⲟⲩⲣⲟ ⲛ̀ⲧⲉ ϯϩⲓⲣⲏⲛⲏ — "O King of Peace".',
  },
  {
    id: 'q6',
    type: 'multiple-choice',
    track: 'reading-rite',
    prompt: 'Which reading is read FIRST in the Liturgy?',
    options: ['Gospel', 'Pauline Epistle', 'Catholic Epistle', 'Praxis'],
    correct: 1,
    explain: 'Order: Pauline → Catholic → Praxis → Synaxarium → Psalm → Gospel.',
  },
  {
    id: 'q7',
    type: 'multiple-choice',
    track: 'altar-service',
    prompt: 'The orarion (deacon\'s stole) is worn over which shoulder?',
    options: ['Right', 'Left', 'Both', 'Around the neck'],
    correct: 1,
    explain: 'The orarion is worn over the LEFT shoulder, with the long end hanging down both front and back.',
  },
  {
    id: 'q8',
    type: 'multiple-choice',
    track: 'holy-week',
    prompt: 'Which tone is used during Holy Week?',
    options: ['Festal (Shai)', 'Annual (Rompi)', 'Sad / Pascha', 'Palm Sunday tone'],
    correct: 2,
    explain: 'The "Sad" or Paschal tone is used from Palm Sunday evening through Holy Saturday.',
  },
];

const VESTMENTS = [
  { id: 'tunia',    name: 'Tunia',    cop: 'Ⲥⲧⲓⲭⲁⲣⲓⲟⲛ',  en: 'White tunic',     desc: 'White tunic worn by all ranks. Symbol of the resurrection garment.' },
  { id: 'orarion',  name: 'Orarion',  cop: 'Ⲱⲣⲁⲣⲓⲟⲛ',    en: 'Stole',           desc: 'Worn over the left shoulder by the Deacon. Wraps both shoulders for the Subdeacon.' },
  { id: 'epimanikion', name: 'Epimanikion', cop: 'Ⲉⲡⲓⲙⲁⲛⲓⲕⲓⲟⲛ', en: 'Cuffs', desc: 'Worn on the wrists. Symbolizes the bonds of Christ.' },
  { id: 'taylasan', name: 'Taylasan', cop: 'Ⲧⲁⲩⲗⲁⲥⲁⲛ',   en: 'Hood',            desc: 'Worn during processions and in some monastic services.' },
];

window.COPTIC_DATA = {
  RANKS, TONES, HYMNS, TODAY, TRACKS, QUIZ_BANK, VESTMENTS,
};
