/* ── LESSON PACK: ESSENTIALS III (A1–B1) ──
   Loads after learn-lessons-more.jsx — pushes into window.LESSONS_DATA. */

window.LESSONS_DATA.push(

  /* ─── QUESTION FORMS ─── */
  {
    id:'question-forms', level:'A1', icon:'❓', group:'basics',
    title:{ en:'Making Questions — do, does, wh-words', ar:'تكوين الأسئلة — do, does وكلمات wh', tr:'Soru Kurma — do, does, wh-kelimeleri' },
    summary:{
      en:'Questions have their own word order. Learn the two patterns and you can ask anything.',
      ar:'للأسئلة ترتيب كلمات خاص. تعلّم النمطين وستستطيع سؤال أي شيء.',
      tr:'Soruların kendi kelime sırası vardır. İki kalıbı öğren, her şeyi sorabil.',
    },
    sections:[
      { type:'concept', title:{ en:'Two patterns', ar:'نمطان' }, body:{
        en:'**Yes/No questions:** Do/Does + subject + base verb? *Do you work here? Does she speak English?*\n**Wh- questions:** Wh-word + do/does + subject + base verb? *Where do you work? What does this button do?*\nWith **to be**, just swap: *Is he ready? Where are the tools?* — no do/does needed.',
        ar:'**أسئلة نعم/لا:** Do/Does + الفاعل + الفعل الأساسي؟ *Do you work here?*\n**أسئلة Wh:** كلمة wh + do/does + الفاعل + الفعل؟ *Where do you work?*\nمع **to be** نعكس فقط: *Is he ready?* — بدون do/does.',
      }},
      { type:'table', title:{ en:'Wh-words', ar:'كلمات Wh' }, headers:['Word','Asks about','Example'], rows:[
        ['What','things','What does it measure?'],
        ['Where','places','Where is the meeting?'],
        ['When','time','When does the shift start?'],
        ['Who','people','Who wrote this code?'],
        ['Why','reasons','Why is the test failing?'],
        ['How','manner / way','How does it work?'],
        ['How much / many','quantity','How many sensors do we need?'],
      ]},
      { type:'note', title:{ en:'Pitfall', ar:'تحذير' }, body:{
        en:'After do/does, the verb goes back to base form. ❌ *Does she works here?* → ✅ *Does she work here?* And don\u2019t forget do/does entirely: ❌ *Where you work?* → ✅ *Where do you work?*',
        ar:'بعد do/does يعود الفعل إلى صيغته الأساسية. ❌ *Does she works?* → ✅ *Does she work?* ولا تنسَ do/does: ✅ *Where do you work?*',
      }},
      { type:'examples', title:{ en:'At work', ar:'في العمل' }, items:[
        { en:'Do you have the latest version?',        ar:'هل لديك أحدث نسخة؟',           ctx:'Yes/No' },
        { en:'Does this cable carry power or data?',   ar:'هل ينقل هذا الكابل طاقة أم بيانات؟', ctx:'Yes/No' },
        { en:'What time does the meeting start?',      ar:'في أي وقت يبدأ الاجتماع؟',     ctx:'Wh-' },
        { en:'Who is responsible for the backups?',    ar:'من المسؤول عن النسخ الاحتياطية؟', ctx:'to be' },
      ]},
    ],
    practice:[
      { type:'mcq', q:'___ she work on weekends?', options:['Do','Does','Is','Are'], a:1,
        explainEn:'she → Does.', explainAr:'she → Does.' },
      { type:'mcq', q:'Where ___ you keep the spare parts?', options:['does','are','do','is'], a:2,
        explainEn:'you → do.', explainAr:'you → do.' },
      { type:'mcq', q:'Does he ___ English at work?', options:['speaks','speak','speaking','spoke'], a:1,
        explainEn:'After does → base verb.', explainAr:'بعد does → الفعل الأساسي.' },
      { type:'mcq', q:'___ the printer working?', options:['Does','Do','Is','Are'], a:2,
        explainEn:'"working" needs to be → Is the printer working?', explainAr:'مع الفعل المستمر نستخدم Is.' },
      { type:'fill', q:'___ do you check the readings? — Every morning. (wh-word)', a:'When',
        explainEn:'"Every morning" = time → When.', explainAr:'الإجابة زمن → When.' },
      { type:'fill', q:'How ___ USB ports does this laptop have? (much/many)', a:'many',
        explainEn:'Ports are countable → many.', explainAr:'المنافذ معدودة → many.' },
    ],
  },

  /* ─── SOME / ANY ─── */
  {
    id:'some-any', level:'A1', icon:'🎒', group:'basics',
    title:{ en:'some & any', ar:'some و any', tr:'some ve any' },
    summary:{
      en:'Both mean a quantity — but one lives in positive sentences, the other in questions and negatives.',
      ar:'كلاهما يعني كمية — لكن أحدهما يعيش في الجمل المثبتة والآخر في الأسئلة والنفي.',
      tr:'İkisi de miktar bildirir — ama biri olumlu cümlelerde, diğeri soru ve olumsuzlarda yaşar.',
    },
    sections:[
      { type:'concept', title:{ en:'The rule', ar:'القاعدة' }, body:{
        en:'**some** = positive sentences: *We have some batteries.*\n**any** = negatives and questions: *We don\u2019t have any batteries. Do you have any batteries?*\n**Exception:** use *some* in offers and requests: *Would you like some tea? Can I have some water?*',
        ar:'**some** = الجمل المثبتة: *We have some batteries.*\n**any** = النفي والأسئلة: *We don\u2019t have any batteries.*\n**استثناء:** نستخدم some في العروض والطلبات: *Would you like some tea?*',
      }},
      { type:'table', title:{ en:'The family', ar:'العائلة' }, headers:['','Positive','Negative / Question'], rows:[
        ['things','something','anything'],
        ['people','someone / somebody','anyone / anybody'],
        ['places','somewhere','anywhere'],
      ]},
      { type:'examples', title:{ en:'Examples', ar:'أمثلة' }, items:[
        { en:'There are some emails in your inbox.',       ar:'هناك بعض الرسائل في بريدك.',      ctx:'positive → some' },
        { en:'There aren\u2019t any errors in the log.',    ar:'لا توجد أي أخطاء في السجل.',      ctx:'negative → any' },
        { en:'Is there any coffee left?',                  ar:'هل بقي أي قهوة؟',                 ctx:'question → any' },
        { en:'Would you like some help with that?',        ar:'هل تريد بعض المساعدة في ذلك؟',    ctx:'offer → some' },
        { en:'Someone left a laptop in the meeting room.', ar:'ترك أحدهم حاسوباً في غرفة الاجتماعات.', ctx:'positive → someone' },
      ]},
    ],
    practice:[
      { type:'mcq', q:'We need ___ new cables.', options:['any','some','anything','no'], a:1,
        explainEn:'Positive sentence → some.', explainAr:'جملة مثبتة → some.' },
      { type:'mcq', q:'I don\u2019t have ___ questions.', options:['some','any','something','someone'], a:1,
        explainEn:'Negative → any.', explainAr:'نفي → any.' },
      { type:'mcq', q:'Is there ___ problem with the server?', options:['some','any','someone','somewhere'], a:1,
        explainEn:'Question → any.', explainAr:'سؤال → any.' },
      { type:'mcq', q:'Would you like ___ tea?', options:['any','some','anything','anywhere'], a:1,
        explainEn:'Offer → some.', explainAr:'عرض → some.' },
      { type:'fill', q:'___ called you while you were out. (person, positive)', a:'Someone',
        explainEn:'Positive + person → Someone.', explainAr:'إثبات + شخص → Someone.' },
      { type:'fill', q:'I can\u2019t find my badge ___. (place, negative)', a:'anywhere',
        explainEn:'Negative + place → anywhere.', explainAr:'نفي + مكان → anywhere.' },
    ],
  },

  /* ─── GOING TO vs WILL ─── */
  {
    id:'going-to-vs-will', level:'A2', icon:'🔮', group:'tenses',
    title:{ en:'going to vs will', ar:'going to مقابل will', tr:'going to ve will Karşılaştırması' },
    summary:{
      en:'Two futures: the plan you already have, and the decision you make right now.',
      ar:'مستقبلان: الخطة التي لديك مسبقاً، والقرار الذي تتخذه الآن.',
      tr:'İki gelecek: zaten sahip olduğun plan ve şu anda verdiğin karar.',
    },
    sections:[
      { type:'concept', title:{ en:'The difference', ar:'الفرق' }, body:{
        en:'**going to** = a plan or intention that exists BEFORE speaking: *We are going to upgrade the servers next month.* Also for predictions with evidence: *Look at those clouds — it\u2019s going to rain.*\n**will** = a decision made AT the moment of speaking: *The phone is ringing — I\u2019ll answer it.* Also promises, offers, and predictions from opinion: *I think prices will rise.*',
        ar:'**going to** = خطة موجودة قبل الكلام: *We are going to upgrade the servers.* وتنبؤ بدليل: *It\u2019s going to rain.*\n**will** = قرار لحظة الكلام: *I\u2019ll answer it.* ووعود وعروض وتنبؤات بالرأي: *I think prices will rise.*',
      }},
      { type:'table', title:{ en:'Quick guide', ar:'دليل سريع' }, headers:['Situation','Use','Example'], rows:[
        ['Existing plan','going to','I\u2019m going to study in Germany.'],
        ['Decision now','will','I\u2019ll take this one.'],
        ['Prediction + evidence','going to','That shelf is going to fall!'],
        ['Prediction + opinion','will','I think it will work.'],
        ['Promise / offer','will','I\u2019ll help you with that.'],
      ]},
      { type:'note', title:{ en:'Tip', ar:'نصيحة' }, body:{
        en:'In a meeting, "I\u2019ll send you the file" (deciding now) and "I\u2019m going to send you the file" (I already planned it) are both correct — the difference is only WHEN you decided. Don\u2019t stress: if a plan exists, prefer going to.',
        ar:'في الاجتماع، كلتا الجملتين صحيحتان — الفرق فقط متى قررت. إن وُجدت خطة مسبقة، فضّل going to.',
      }},
      { type:'examples', title:{ en:'Examples', ar:'أمثلة' }, items:[
        { en:'We\u2019re going to test the prototype on Thursday.',  ar:'سنختبر النموذج يوم الخميس.',      ctx:'planned' },
        { en:'No coffee? OK, I\u2019ll make some.',                  ar:'لا قهوة؟ حسناً، سأعدّ بعضها.',    ctx:'decision now' },
        { en:'Careful — that ladder is going to slip!',             ar:'انتبه — السلّم سينزلق!',           ctx:'evidence' },
        { en:'Don\u2019t worry, I\u2019ll be there at eight.',        ar:'لا تقلق، سأكون هناك في الثامنة.', ctx:'promise' },
      ]},
    ],
    practice:[
      { type:'mcq', q:'Look at those black clouds. It ___ rain.', options:['will','is going to','would','rains'], a:1,
        explainEn:'Prediction with evidence → going to.', explainAr:'تنبؤ بدليل → going to.' },
      { type:'mcq', q:'The doorbell? I ___ get it.', options:['am going to','will','would','go to'], a:1,
        explainEn:'Decision at the moment → will.', explainAr:'قرار لحظي → will.' },
      { type:'mcq', q:'We ___ move to a new office in May. (already planned)', options:['will','are going to','would','move'], a:1,
        explainEn:'Existing plan → going to.', explainAr:'خطة موجودة → going to.' },
      { type:'mcq', q:'I promise I ___ finish it today.', options:['am going to','will','would','finish'], a:1,
        explainEn:'Promise → will.', explainAr:'وعد → will.' },
      { type:'fill', q:'A: We have no paper. B: OK, I ___ buy some. (will/going to)', a:'will',
        explainEn:'Decision made now → will.', explainAr:'قرار الآن → will.' },
      { type:'fill', q:'She has the tickets. She ___ going to visit Japan. (is/will)', a:'is',
        explainEn:'Plan exists → is going to.', explainAr:'الخطة موجودة → is going to.' },
    ],
  },

  /* ─── USED TO ─── */
  {
    id:'used-to', level:'A2', icon:'📼', group:'tenses',
    title:{ en:'used to — Past Habits', ar:'used to — عادات الماضي', tr:'used to — Geçmiş Alışkanlıklar' },
    summary:{
      en:'For things that were true before but not now: I used to work nights.',
      ar:'للأشياء التي كانت صحيحة سابقاً وليست الآن: كنت أعمل ليلاً.',
      tr:'Eskiden doğru olup artık olmayan şeyler için: Eskiden gece çalışırdım.',
    },
    sections:[
      { type:'concept', title:{ en:'How it works', ar:'كيف يعمل' }, body:{
        en:'**used to + base verb** = a past habit or state that is finished: *I used to smoke. This building used to be a factory.*\n**Negative:** didn\u2019t use to. *I didn\u2019t use to like coffee.*\n**Question:** Did you use to…? *Did you use to live in Jeddah?*\nNote the spelling: after did/didn\u2019t it is **use to** (no d).',
        ar:'**used to + الفعل الأساسي** = عادة أو حالة ماضية انتهت: *I used to smoke.*\n**النفي:** didn\u2019t use to.\n**السؤال:** Did you use to…?\nلاحظ الإملاء: بعد did/didn\u2019t تصبح **use to** (بدون d).',
      }},
      { type:'examples', title:{ en:'Then vs now', ar:'الماضي مقابل الآن' }, items:[
        { en:'I used to commute two hours a day. Now I work from home.',     ar:'كنت أتنقل ساعتين يومياً. الآن أعمل من المنزل.', ctx:'habit ended' },
        { en:'This area used to be a desert. Now it\u2019s a solar farm.',    ar:'كانت هذه المنطقة صحراء. الآن مزرعة شمسية.',    ctx:'state changed' },
        { en:'She didn\u2019t use to speak English at work.',                 ar:'لم تكن تتحدث الإنجليزية في العمل.',            ctx:'negative' },
        { en:'Did you use to play football at university?',                   ar:'هل كنت تلعب كرة القدم في الجامعة؟',            ctx:'question' },
      ]},
      { type:'note', title:{ en:'Pitfall', ar:'تحذير' }, body:{
        en:'**used to** (past habit) ≠ **be used to** (be accustomed to). *I used to work nights* = before, not now. *I am used to working nights* = it is normal for me now. Notice: be used to + -ing.',
        ar:'**used to** (عادة ماضية) ≠ **be used to** (معتاد على). *I used to work nights* = سابقاً. *I am used to working nights* = معتاد عليها الآن.',
      }},
    ],
    practice:[
      { type:'mcq', q:'I ___ work in a factory, but now I teach.', options:['used to','use to','am used to','using to'], a:0,
        explainEn:'Past habit → used to.', explainAr:'عادة ماضية → used to.' },
      { type:'mcq', q:'Did you ___ live in Istanbul?', options:['used to','use to','be used to','using'], a:1,
        explainEn:'After did → use to (no d).', explainAr:'بعد did → use to بدون d.' },
      { type:'mcq', q:'She didn\u2019t ___ like early meetings.', options:['used to','use to','uses to','using to'], a:1,
        explainEn:'After didn\u2019t → use to.', explainAr:'بعد didn\u2019t → use to.' },
      { type:'mcq', q:'"I am used to the noise" means:', options:['I liked noise before','Noise is normal for me now','There is no noise','I will like noise'], a:1,
        explainEn:'be used to = accustomed to it now.', explainAr:'be used to تعني معتاد الآن.' },
      { type:'fill', q:'This office ___ to be a warehouse. (one word)', a:'used',
        explainEn:'Past state → used to be.', explainAr:'حالة ماضية → used to.' },
      { type:'fill', q:'I am used to ___ (work) with tight deadlines.', a:'working',
        explainEn:'be used to + -ing.', explainAr:'be used to + الفعل مع -ing.' },
    ],
  },

  /* ─── REPORTED SPEECH ─── */
  {
    id:'reported-speech', level:'B1', icon:'🗣️', group:'basics',
    title:{ en:'Reported Speech — He said that…', ar:'الكلام المنقول — He said that…', tr:'Dolaylı Anlatım — He said that…' },
    summary:{
      en:'How to tell someone what another person said — essential for meetings and minutes.',
      ar:'كيف تنقل لشخص ما قاله شخص آخر — أساسي للاجتماعات والمحاضر.',
      tr:'Bir başkasının söylediğini aktarmak — toplantılar ve tutanaklar için şart.',
    },
    sections:[
      { type:'concept', title:{ en:'The backshift', ar:'الإزاحة الزمنية' }, body:{
        en:'When reporting, the tense usually moves one step back:\npresent → past: *"I am busy"* → *He said (that) he was busy.*\npast → past perfect: *"We finished"* → *She said they had finished.*\nwill → would: *"I will call"* → *He said he would call.*\ncan → could · must → had to.\nPronouns and time words change too: *today → that day, tomorrow → the next day, here → there.*',
        ar:'عند النقل، يعود الزمن خطوة واحدة:\nمضارع → ماضٍ: *"I am busy"* → *He said he was busy.*\nماضٍ → ماضٍ تام: *She said they had finished.*\nwill → would · can → could · must → had to.\nوتتغير الضمائر وكلمات الزمن: *today → that day.*',
      }},
      { type:'table', title:{ en:'Backshift table', ar:'جدول الإزاحة' }, headers:['Direct','Reported'], rows:[
        ['"I work here."','He said he worked there.'],
        ['"We are testing it."','They said they were testing it.'],
        ['"I finished the report."','She said she had finished the report.'],
        ['"I will send it tomorrow."','He said he would send it the next day.'],
        ['"I can help."','She said she could help.'],
      ]},
      { type:'note', title:{ en:'say vs tell', ar:'say مقابل tell' }, body:{
        en:'**tell** needs a person: *She told me the test failed.* **say** does not: *She said the test failed.* ❌ *She said me* → ✅ *She told me.* For questions, use asked + if/wh-word: *He asked if we were ready. She asked where the files were* (no question word order!).',
        ar:'**tell** يحتاج شخصاً: *She told me.* أما **say** فلا: *She said.* ❌ *She said me.* وللأسئلة: asked + if أو كلمة wh: *He asked if we were ready.*',
      }},
    ],
    practice:[
      { type:'mcq', q:'"I am late." → He said he ___ late.', options:['is','was','were','has been'], a:1,
        explainEn:'am → was (one step back).', explainAr:'am تصبح was.' },
      { type:'mcq', q:'"We will deliver on Friday." → They said they ___ deliver on Friday.', options:['will','would','can','are going to'], a:1,
        explainEn:'will → would.', explainAr:'will تصبح would.' },
      { type:'mcq', q:'She ___ me the meeting was cancelled.', options:['said','told','say','spoke'], a:1,
        explainEn:'With a person → told me.', explainAr:'مع شخص → told me.' },
      { type:'mcq', q:'"Where are the drawings?" → He asked ___', options:['where are the drawings.','where the drawings were.','where were the drawings?','the drawings are where.'], a:1,
        explainEn:'Reported question = normal word order: where the drawings were.', explainAr:'السؤال المنقول بترتيب الجملة العادي.' },
      { type:'fill', q:'"I can fix it." → She said she ___ fix it.', a:'could',
        explainEn:'can → could.', explainAr:'can تصبح could.' },
      { type:'fill', q:'"We finished the tests." → They said they ___ finished the tests. (one word)', a:'had',
        explainEn:'past → past perfect: had finished.', explainAr:'الماضي → الماضي التام: had finished.' },
    ],
  },

  /* ─── GERUND VS INFINITIVE ─── */
  {
    id:'gerund-infinitive', level:'B1', icon:'🎭', group:'basics',
    title:{ en:'Gerund or Infinitive — enjoy doing, want to do', ar:'المصدر أم الفعل مع to — enjoy doing, want to do', tr:'Gerund mu Mastar mı — enjoy doing, want to do' },
    summary:{
      en:'Why "I enjoy to work" is wrong: some verbs take -ing, some take to + verb.',
      ar:'لماذا "I enjoy to work" خطأ: بعض الأفعال تأخذ -ing وبعضها to + الفعل.',
      tr:'"I enjoy to work" neden yanlış: bazı fiiller -ing, bazıları to + fiil alır.',
    },
    sections:[
      { type:'concept', title:{ en:'Two teams', ar:'فريقان' }, body:{
        en:'Some verbs are followed by **-ing** (gerund), others by **to + base verb** (infinitive). There is no deep logic — you learn the teams.\n**+ -ing:** enjoy, finish, keep, avoid, suggest, mind, practice. *I enjoy solving problems.*\n**+ to:** want, need, decide, plan, hope, promise, agree, learn. *We decided to postpone the launch.*\n**Both, same meaning:** start, begin, continue, like, love. *It started to rain / raining.*',
        ar:'بعض الأفعال يتبعها **-ing** وبعضها **to + الفعل**. لا منطق عميق — تحفظ الفريقين.\n**+ -ing:** enjoy, finish, keep, avoid, suggest. *I enjoy solving problems.*\n**+ to:** want, need, decide, plan, hope. *We decided to postpone.*\n**كلاهما:** start, continue, like.',
      }},
      { type:'table', title:{ en:'The teams', ar:'الفريقان' }, headers:['+ -ing (gerund)','+ to (infinitive)'], rows:[
        ['enjoy doing','want to do'],
        ['finish doing','need to do'],
        ['keep doing','decide to do'],
        ['avoid doing','plan to do'],
        ['suggest doing','hope to do'],
        ['mind doing','promise to do'],
      ]},
      { type:'note', title:{ en:'Also remember', ar:'تذكر أيضاً' }, body:{
        en:'After a **preposition**, always -ing: *good at solving, interested in learning, before starting.* And **stop** changes meaning: *stop smoking* = quit the habit; *stop to smoke* = pause in order to smoke!',
        ar:'بعد **حرف الجر** دائماً -ing: *good at solving, interested in learning.* و**stop** يغيّر المعنى: *stop smoking* = الإقلاع؛ *stop to smoke* = التوقف لكي تدخن!',
      }},
      { type:'examples', title:{ en:'Examples', ar:'أمثلة' }, items:[
        { en:'We finished testing at midnight.',              ar:'أنهينا الاختبار في منتصف الليل.',      ctx:'finish + -ing' },
        { en:'I hope to join the Riyadh project.',            ar:'آمل الانضمام إلى مشروع الرياض.',        ctx:'hope + to' },
        { en:'Keep pressing the button for three seconds.',   ar:'استمر بالضغط على الزر ثلاث ثوانٍ.',     ctx:'keep + -ing' },
        { en:'She is good at explaining complex ideas.',      ar:'هي بارعة في شرح الأفكار المعقدة.',      ctx:'preposition + -ing' },
      ]},
    ],
    practice:[
      { type:'mcq', q:'I enjoy ___ with international teams.', options:['to work','working','work','worked'], a:1,
        explainEn:'enjoy + -ing.', explainAr:'enjoy + -ing.' },
      { type:'mcq', q:'We need ___ the firmware first.', options:['updating','update','to update','updated'], a:2,
        explainEn:'need + to + base verb.', explainAr:'need + to.' },
      { type:'mcq', q:'Avoid ___ the sensor with wet hands.', options:['to touch','touching','touch','touched'], a:1,
        explainEn:'avoid + -ing.', explainAr:'avoid + -ing.' },
      { type:'mcq', q:'She is interested ___ robotics.', options:['to learn','in learning','learn','for learning'], a:1,
        explainEn:'Preposition (in) + -ing.', explainAr:'حرف جر + -ing.' },
      { type:'fill', q:'They decided ___ (open) a new office in Dubai. (two words)', a:'to open',
        explainEn:'decide + to + verb.', explainAr:'decide + to.' },
      { type:'fill', q:'Please finish ___ (write) the report before lunch.', a:'writing',
        explainEn:'finish + -ing.', explainAr:'finish + -ing.' },
    ],
  },

);
