-- ============================================================================
-- Joseph platform — full content seed (idempotent)
-- ============================================================================
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------------------------------------------------------
-- 1. Project types (8 per spec §5.5)
-- ----------------------------------------------------------------------------
DELETE FROM project_types;
INSERT INTO project_types (type_key, name_ar, name_en, description_ar, description_en, icon, steps, templates) VALUES
('services','مشروع خدمات','Services Project','تقدّم خدمة لعملاء مقابل أجر','Deliver a paid service to clients','briefcase',
  '[{"title_en":"Choose Your Service","title_ar":"اختر خدمتك","desc_en":"Pick one specific service you can deliver excellently","desc_ar":"اختر خدمة واحدة محددة يمكنك تقديمها بامتياز"},{"title_en":"Study the Need","title_ar":"ادرس الحاجة","desc_en":"Talk to 10 potential customers about their pain","desc_ar":"تحدّث مع 10 عملاء محتملين عن مشكلتهم"},{"title_en":"Define Customer","title_ar":"حدّد العميل","desc_en":"Write a 1-paragraph persona","desc_ar":"اكتب فقرة عن شخصية العميل"},{"title_en":"Pricing","title_ar":"التسعير","desc_en":"Set a clear price tier","desc_ar":"حدد طبقة سعر واضحة"},{"title_en":"First Experiment","title_ar":"التجربة الأولى","desc_en":"Deliver to 3 clients for feedback","desc_ar":"قدّم الخدمة لـ3 عملاء للحصول على تقييم"},{"title_en":"Marketing","title_ar":"التسويق","desc_en":"Publish 5 case studies","desc_ar":"انشر 5 قصص نجاح"},{"title_en":"Money","title_ar":"المال","desc_en":"Separate personal vs business cash","desc_ar":"افصل أموالك الشخصية عن المشروع"},{"title_en":"Team","title_ar":"الفريق","desc_en":"Identify first hire","desc_ar":"حدد أول تعيين"},{"title_en":"Expand","title_ar":"التوسع","desc_en":"Add a second service line","desc_ar":"أضف خط خدمة ثاني"}]',
  '["service_canvas.pdf","pricing_template.pdf"]'),
('products','مشروع منتجات','Products Project','تصنّع وتبيع منتجات','Manufacture and sell physical products','box-seam','[]','[]'),
('digital','مشروع رقمي','Digital Project','تطبيق أو موقع أو منصة','App, website, or platform','laptop','[]','[]'),
('training','تدريب وكوتشنج','Training & Coaching','تدرّب أو ترشد آخرين','Teach or coach others','mortarboard','[]','[]'),
('trade','تجارة','Trade','تشتري وتبيع بهامش ربح','Buy and sell at margin','shop','[]','[]'),
('content','صناعة محتوى','Content Creation','تنتج محتوى يجذب جمهور','Produce audience-attracting content','camera-video','[]','[]'),
('social','مشروع اجتماعي','Social Project','مشروع خدمي للمجتمع','Community service project','people','[]','[]'),
('kingdom_sustainable','مشروع ملكوتي مستدام','Sustainable Kingdom Project','مشروع ربحي برسالة ملكوتية','For-profit with Kingdom mission','heart','[]','[]');

-- ----------------------------------------------------------------------------
-- 2. Kingdom models (3 per spec §5.6)
-- ----------------------------------------------------------------------------
DELETE FROM kingdom_models;
INSERT INTO kingdom_models (model_key, name_ar, name_en, description_ar, description_en, examples, is_featured) VALUES
('kingdom_principles','مشروع بمبادئ ملكوتية','Business with Kingdom Principles','مشروع تجاري يعمل بمبادئ الإنجيل: نزاهة، عدل، رحمة، أمانة','A regular business that operates by Gospel principles — honesty, justice, mercy, faithfulness',
  '[{"title_en":"Honest Construction Company","title_ar":"شركة مقاولات أمينة","desc_en":"Fixed pricing, no bribes, fair wages","desc_ar":"تسعير ثابت، بدون رشاوي، أجور عادلة"},{"title_en":"Transparent Trading","title_ar":"تجارة شفافة","desc_en":"Clear margins published to customers","desc_ar":"هامش ربح معلن للعملاء"}]',1),
('direct_service','مشروع يخدم المجتمع','Direct Community Service','مشروع هدفه المباشر خدمة الناس وحل مشكلة','Project whose direct goal is to serve people and solve a real problem',
  '[{"title_en":"Affordable Tutoring","title_ar":"دروس بسعر مقبول","desc_en":"Quality education at scholarship pricing","desc_ar":"تعليم جودة بأسعار رمزية"},{"title_en":"Youth Tech Academy","title_ar":"أكاديمية شباب تقنية","desc_en":"Free coding for underserved","desc_ar":"برمجة مجانية للفئات الأقل حظًا"}]',1),
('bam','Business as Mission (BAM)','Business as Mission','مشروع ربحي مصمم منذ البداية ليحمل رسالة ويُموّل خدمة','A profitable business designed from day one to carry a mission and fund ministry',
  '[{"title_en":"Cafe Funding a Mission Field","title_ar":"كافيه يموّل خدمة إرسالية","desc_en":"Profits cover mission family salary","desc_ar":"الأرباح تغطي راتب عائلة مرسلة"},{"title_en":"Software Studio Hiring Refugees","title_ar":"استوديو برمجة يوظف لاجئين","desc_en":"For-profit with refugee employment as core","desc_ar":"شركة ربحية توظف اللاجئين كرسالة أساسية"}]',1);

-- ----------------------------------------------------------------------------
-- 3. Lessons (5+ per section, 7 sections → 35+ lessons)
-- ----------------------------------------------------------------------------
DELETE FROM lessons;

-- Section 1: calling
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(1,'دعوتك ليست وظيفتك','Your Calling Is Not Your Job','الدعوة أعمق من المهنة؛ هي الطريقة التي يستخدم بها الله شخصيتك ومواهبك لخدمة الآخرين.','Calling runs deeper than career. It is the way God uses your personality and gifts to serve others.','«قبلما صورتك في البطن عرفتك»','"Before I formed you in the womb I knew you"','إرميا 1:5','اكتب 3 لحظات شعرت فيها بحضور الله وأنت تخدم.','Write 3 moments when you felt God''s presence while serving.','هل تستمد هويتك من وظيفتك أم من دعوتك؟','Do you draw your identity from your job or your calling?','article',420,1,1),
(1,'مواهبك ليست صدفة','Your Gifts Are Not Random','كل موهبة فيك خطّط لها الله. اكتشف ما يجعلك تنسى الوقت.','Every gift in you was planned by God. Notice what makes you lose track of time.','«مواهب موزعة حسب نعمة الله»','"Gifts distributed according to God''s grace"','رومية 12:6','اسأل 5 أشخاص يعرفونك جيداً عن أكبر موهبة فيك.','Ask 5 people who know you well what your biggest gift is.','ما هي الموهبة التي حاول الناس استخدامها فيك؟','What gift have people tried to draw out of you?','article',360,1,2),
(1,'الفرق بين الموهبة والشغف','Gift vs. Passion','الموهبة ما تجيده، والشغف ما يحرّك قلبك. الدعوة تلتقي حيث يجتمعان مع حاجة العالم.','Gift is what you do well; passion is what moves your heart. Calling meets where they intersect with the world''s need.','«ابتغوا أحسن الإحسانات»','"Eagerly desire the greater gifts"','1كورنثوس 12:31','ارسم 3 دوائر: الموهبة، الشغف، حاجة الناس — اكتب ما يقع في وسطها.','Draw 3 circles: gift, passion, need — write what lies in their center.','هل تخدم بشغف أم بواجب فقط؟','Do you serve with passion or only duty?','article',300,1,3),
(1,'صوت الله في القرارات','God''s Voice in Decisions','الدعوة تتضح حين تتعلم سماع صوت الرب من خلال الكلمة والصلاة والمشورة.','Calling becomes clear when you learn to hear the Lord through the Word, prayer, and counsel.','«أنا أعلّمك وأرشدك الطريق التي تسلكها»','"I will instruct you and teach you in the way you should go"','مزمور 32:8','خصّص 15 دقيقة يومياً لقراءة الكلمة قبل أي قرار كبير.','Set aside 15 minutes daily in the Word before any big decision.','متى كانت آخر مرة سمعت فيها صوت الله بوضوح؟','When did you last hear God''s voice clearly?','article',360,1,4),
(1,'مقاومة دعوتك','Resisting Your Calling','يوسف لم يطلب أحلامه، والله لم يتركه يهرب منها. لا تخف من الدعوة الكبيرة.','Joseph did not ask for his dreams, and God did not let him escape them. Do not fear the big call.','«لأن مواهب الله ودعوته هي بلا ندامة»','"For God''s gifts and his call are irrevocable"','رومية 11:29','اكتب الخوف الأكبر الذي يبعدك عن دعوتك، وصلِّ من أجله.','Write the biggest fear keeping you from your calling, and pray about it.','ما الذي تهرب منه في دعوتك؟','What part of your calling are you running from?','article',420,1,5);

-- Section 2: word (work in God's word)
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(2,'العمل عبادة','Work as Worship','عملك اليومي حين يُقدَّم بإخلاص للرب يصبح عبادة حقيقية.','Your daily work, offered faithfully to the Lord, becomes true worship.','«كل ما فعلتم فاعملوا من القلب كما للرب»','"Whatever you do, work at it with all your heart, as for the Lord"','كولوسي 3:23','ابدأ كل يوم عمل بصلاة قصيرة: «يا رب، اقبل عملي اليوم كعبادة».','Begin each workday with a short prayer: "Lord, accept my work today as worship."','هل تفصل بين «وقت العبادة» و«وقت العمل»؟','Do you separate "worship time" from "work time"?','article',360,1,1),
(2,'الأمانة في القليل','Faithfulness in Little','من يؤتمن على القليل يؤتمن على الكثير. أمانتك اليوم تفتح أبواب الغد.','He who is faithful in little is faithful in much. Today''s faithfulness opens tomorrow''s doors.','«الأمين في القليل أمين أيضاً في الكثير»','"Whoever is faithful in little is also faithful in much"','لوقا 16:10','اختر مهمة صغيرة هذا الأسبوع وأنجزها بأقصى جودة.','Pick one small task this week and do it with excellence.','ما هي المهام الصغيرة التي تُهملها؟','What small tasks are you neglecting?','article',300,1,2),
(2,'النزاهة في السوق','Integrity in the Marketplace','الكلمة الصادقة والميزان العادل أثمن من ربح أكبر.','An honest word and a fair scale are worth more than larger profit.','«الميزان والموازين الحق للرب»','"Honest scales and balances belong to the Lord"','أمثال 16:11','راجع آخر صفقة لك: هل كان فيها أي خداع صغير؟ صحّحه.','Review your last deal: was there any small deception? Correct it.','هل خسرت صفقة بسبب الصدق هذا الشهر؟','Did you lose a deal this month because of honesty?','article',360,1,3),
(2,'عدم محبة المال','Not Loving Money','المال خادم جيد ولكنه سيد رديء. استخدمه ولا تَعبده.','Money is a good servant but a bad master. Use it; do not worship it.','«محبة المال أصل لكل الشرور»','"The love of money is the root of all evil"','1تيموثاوس 6:10','حدد نسبة عطاء ثابتة شهرياً قبل أي مصروف.','Set a fixed monthly giving percentage before any expense.','هل تتخذ قراراتك على أساس المال أولاً؟','Do you make decisions based on money first?','article',360,1,4),
(2,'سماع صوت الله في العمل','Hearing God''s Voice at Work','الرب يتكلم في الاجتماعات والقرارات والأزمات إن أصغيت.','The Lord speaks in meetings, decisions, and crises — if you listen.','«أذناك تسمعان كلمة خلفك قائلة هذه هي الطريق اسلكوا فيها»','"Your ears will hear a voice behind you, saying, this is the way; walk in it"','إشعياء 30:21','قبل قرار صعب، اصمت 10 دقائق واسأل: «يا رب، ماذا تريد؟»','Before a hard decision, sit 10 minutes silent and ask "Lord, what do you want?"','هل تستشير الرب في القرارات المهنية؟','Do you consult the Lord on work decisions?','article',420,1,5);

-- Section 3: project (build your project)
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(3,'اختر فكرتك','Choose Your Idea','الفكرة الجيدة تخدم حاجة حقيقية، ليست مجرد حماس مؤقت.','A good idea serves a real need — not just a passing excitement.','«من منكم وهو يريد أن يبني برجاً لا يجلس أولاً ويحسب النفقة»','"Who would build a tower without first sitting down to count the cost?"','لوقا 14:28','اكتب 3 أفكار وقيّمها بـ: الموهبة، السوق، الإمكانيات.','Write 3 ideas and rate each on: gift, market, resources.','ما الفكرة التي تفكر فيها منذ شهور ولم تبدأ؟','What idea have you been thinking about for months without starting?','article',360,1,1),
(3,'ادرس السوق','Study the Market','تحدث مع 10 عملاء محتملين قبل أن تستثمر جنيهاً.','Talk to 10 potential customers before investing a single pound.','«الحكمة عند المتواضعين»','"With humility is wisdom"','أمثال 11:2','جهّز 5 أسئلة واسأل بها 10 أشخاص هذا الأسبوع.','Prepare 5 questions and ask 10 people this week.','هل تعرف ماذا يحتاج عميلك فعلاً؟','Do you know what your customer actually needs?','article',360,1,2),
(3,'حدّد عميلك','Define Your Customer','عميل واحد محدد أفضل من جمهور غامض.','One specific customer is better than a vague audience.','«صرت للكل كل شيء لأخلّص على كل حال قوماً»','"I have become all things to all people so that by all means I might save some"','1كورنثوس 9:22','اكتب فقرة عن «عميلك المثالي»: عمره، مشكلته، أحلامه.','Write a paragraph about your "ideal customer": age, pain, dreams.','هل تستطيع وصف عميلك في جملة واحدة؟','Can you describe your customer in one sentence?','article',300,1,3),
(3,'السعر العادل','Fair Pricing','سعّر بحيث تربح ربحاً عادلاً، وتُكرم العميل.','Price for fair profit while honoring the customer.','«ميزان الغش مكرهة عند الرب»','"Dishonest scales are detestable to the Lord"','أمثال 11:1','احسب تكلفتك الحقيقية + ٣٠٪ ربح كنقطة بداية.','Calculate true cost + 30% margin as a starting point.','هل تسعّر من الخوف أم من القيمة؟','Do you price from fear or from value?','article',360,1,4),
(3,'الإطلاق الأول','First Launch','ابدأ بأبسط نسخة، وحسّن مع الوقت. الكمال عدو الإطلاق.','Start with the simplest version and improve over time. Perfection is the enemy of launch.','«من يرصد الريح لا يزرع»','"Whoever watches the wind will not plant"','جامعة 11:4','حدد تاريخ إطلاق خلال 30 يوماً والتزم به.','Set a launch date within 30 days and commit.','ما الذي يمنعك من الإطلاق؟','What is keeping you from launching?','article',360,1,5);

-- Section 4: kingdom
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(4,'مشروع برسالة','Project with a Mission','الفرق بين تجارة عادية ومشروع ملكوتي هو السؤال: «لماذا؟»','The difference between a regular business and a Kingdom project is the "why".','«ليكن نوركم يضيء قدام الناس»','"Let your light shine before others"','متى 5:16','اكتب جملة الرسالة لمشروعك في 12 كلمة.','Write your project mission in 12 words or fewer.','ما هي رسالة مشروعك خلف الربح؟','What is your project''s mission beyond profit?','article',360,1,1),
(4,'الربح يخدم الرسالة','Profit Serves Mission','الربح ليس عدواً للملكوت بل أداته. اربح بإخلاص واستخدم بحكمة.','Profit is not the enemy of the Kingdom but its tool. Earn with integrity and use with wisdom.','«من أمين في القليل أمين أيضاً في الكثير»','"Whoever is faithful in little is faithful in much"','لوقا 16:10','حدّد نسبة من الأرباح تخصصها لخدمة محددة.','Allocate a percentage of profits to a specific ministry.','أين تذهب أرباحك بعد المصاريف؟','Where do your profits go after expenses?','article',360,1,2),
(4,'فرص عمل بكرامة','Jobs with Dignity','كل فرصة عمل تخلقها هي عائلة تأكل بكرامة. هذا ملكوت.','Every job you create is a family eating with dignity. That is Kingdom work.','«الفاعل مستحق أجرته»','"The worker deserves his wages"','لوقا 10:7','حدّد كم فرصة عمل يمكن أن يخلق مشروعك في 3 سنوات.','Set how many jobs your project can create in 3 years.','هل توظف بكرامة وأجر عادل؟','Do you hire with dignity and fair wages?','article',300,1,3),
(4,'BAM — Business as Mission','BAM — Business as Mission','شركة ربحية مصممة منذ البداية لتحمل رسالة وتموّل خدمة.','A for-profit company designed from day one to carry a mission and fund ministry.','«وأما عمل كل واحد فالنار ستمتحنه»','"Each one''s work the fire will test"','1كورنثوس 3:13','ادرس نموذج BAM واحد وحلّل مكوناته.','Study one BAM model and analyze its components.','هل تصمم مشروعك للرسالة أم تضيفها لاحقاً؟','Do you design for mission or add it later?','article',420,1,4),
(4,'الاستدامة الملكوتية','Kingdom Sustainability','المشروع الملكوتي يدوم لأنه مدعوم بصلاة، حكمة، وحُسن إدارة.','A Kingdom project lasts because it is sustained by prayer, wisdom, and good management.','«اجعلني فطيناً لأحفظ شريعتك»','"Give me understanding that I may keep your law"','مزمور 119:34','ضع نظام مراجعة شهري للرسالة والأرقام.','Set a monthly review system for mission and numbers.','هل تراجع رسالتك بانتظام أم تنساها مع الانشغال؟','Do you review your mission regularly or forget it when busy?','article',360,1,5);

-- Section 5: mentor
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(5,'لماذا تحتاج مرشداً','Why You Need a Mentor','المرشد يختصر لك سنوات من الأخطاء التي مرّ بها.','A mentor saves you years of mistakes they already made.','«الحديد بالحديد يحدّد»','"As iron sharpens iron"','أمثال 27:17','حدّد 3 أشخاص تتمنى أن يكونوا مرشدين لك.','List 3 people you wish were your mentors.','هل لديك مرشد روحي ومرشد مهني؟','Do you have both a spiritual and a professional mentor?','article',300,1,1),
(5,'كيف تختار مرشدك','Choosing a Mentor','ابحث عن من يعيش الحياة التي تريد، لا من يتكلم عنها فقط.','Look for someone who lives the life you want — not just talks about it.','«المتجوّل مع الحكماء يصير حكيماً»','"Walk with the wise and become wise"','أمثال 13:20','ادرس حياة مرشدك المحتمل قبل أن تطلب رعايته.','Study a potential mentor''s life before asking for mentorship.','هل تختار مرشديك بالنتائج أم بالشهرة؟','Do you choose mentors by results or by fame?','article',360,1,2),
(5,'الاستفادة من جلسة','Making the Most of a Session','الجلسة الناجحة تبدأ بسؤال واضح وتنتهي بخطوة عملية.','A successful session starts with a clear question and ends with an action step.','«اطلبوا تجدوا»','"Ask and you will receive"','متى 7:7','اكتب 3 أسئلة محددة قبل كل جلسة.','Write 3 specific questions before each session.','هل تستثمر وقت مرشدك أم تستهلكه؟','Do you invest your mentor''s time or consume it?','article',300,1,3);

-- Section 6: community
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(6,'وحدك لن تصل','Alone You Won''t Get Far','الله صمّم الإنسان للجماعة. الرحلة طويلة تحتاج رفقاء.','God designed humans for community. The journey is too long for solo travel.','«اثنان خير من واحد»','"Two are better than one"','جامعة 4:9','انضم لمجموعة هذا الشهر وشارك مرة كل أسبوع.','Join a group this month and contribute once a week.','هل لديك 3 أشخاص يعرفون رحلتك حقاً؟','Do you have 3 people who truly know your journey?','article',300,1,1),
(6,'المحاسبة الأخوية','Brotherly Accountability','صديق يسأل «كيف حال صلاتك؟» أغلى من ألف معجب.','A friend who asks "how is your prayer life?" is worth more than a thousand fans.','«تعرّف أخاك بأخيه»','"Confess your sins to one another"','يعقوب 5:16','حدّد شخصاً يسألك كل أسبوع 3 أسئلة محددة.','Pick someone to ask you 3 specific questions weekly.','من يعرف أصعب نقطة تمر بها الآن؟','Who knows your hardest point right now?','article',360,1,2),
(6,'قواعد المجتمع الصحي','Healthy Community Rules','الاحترام، الصدق، السرية، وعدم الاستغلال.','Respect, honesty, confidentiality, and no exploitation.','«احملوا بعضكم أثقال بعض»','"Bear one another''s burdens"','غلاطية 6:2','تعهّد بألا تنقل ما يُقال في مجموعتك.','Pledge to not share what is said in your group.','هل أنت أمين على أسرار إخوتك؟','Are you faithful with your brothers'' secrets?','article',300,1,3);

-- Section 7: challenges
INSERT INTO lessons (section_id, title_ar, title_en, body_ar, body_en, verse_ar, verse_en, verse_reference, practical_application_ar, practical_application_en, accountability_question_ar, accountability_question_en, content_type, duration_seconds, is_published, order_index) VALUES
(7,'لماذا التحديات؟','Why Challenges?','التحدي القصير يبني عادة، والعادة تبني حياة.','A short challenge builds a habit, and habits build a life.','«تدرّب على التقوى»','"Train yourself for godliness"','1تيموثاوس 4:7','اختر تحدياً واحداً وابدأ غداً.','Pick one challenge and start tomorrow.','أيّ تحدّ تحتاجه أكثر هذا الشهر؟','Which challenge do you need most this month?','article',240,1,1),
(7,'المداومة','Consistency','يوم واحد جيد سهل، 30 يوماً جيدة تصنع رجلاً.','One good day is easy. Thirty good days make a man.','«من تصبّر فإلى المنتهى يخلص»','"The one who endures to the end will be saved"','متى 24:13','اختر مكافأة صغيرة لكل 7 أيام تكمّلها.','Set a small reward for every 7 days completed.','ما هي العادة التي بدأتها وتركتها؟','What habit did you start and abandon?','article',300,1,2);

-- ----------------------------------------------------------------------------
-- 4. Challenges + their day content (per spec §5.9)
-- ----------------------------------------------------------------------------
DELETE FROM challenge_days;
DELETE FROM challenges;
INSERT INTO challenges (id, title_ar, title_en, description_ar, description_en, duration_days, type, is_active, related_section_id) VALUES
(1,'7 أيام الأمانة','7-Day Faithfulness','أسبوع كامل من النزاهة في العمل: لا غش، لا تأخير، لا كلمة عابرة.','One week of integrity at work: no cheating, no lateness, no careless word.',7,'7day',1,2),
(2,'14 يوم اكتشف موهبتك','14-Day Skill Discovery','اكتشف موهبتك من خلال تجارب يومية صغيرة.','Discover your gift through small daily experiments.',14,'14day',1,1),
(3,'30 يوم لإطلاق مشروعك','30-Day Project Launch','من الفكرة للإطلاق في 30 يوماً.','From idea to launch in 30 days.',30,'30day',1,3),
(4,'21 يوم انضباط مالي','21-Day Financial Discipline','تتبّع كل مصروف وكل دخل.','Track every expense and every income.',21,'custom',1,3),
(5,'10 أيام تسويق بدون خوف','10-Day Marketing Without Fear','انشر، تواصل، اطلب — كل يوم خطوة.','Post, reach out, ask — one step a day.',10,'custom',1,3),
(6,'7 أيام عمل عبادة','7-Day Work as Worship','حوّل عملك اليومي لعبادة.','Turn your daily work into worship.',7,'7day',1,2);

-- Days for challenge 1 (7-day Faithfulness)
INSERT INTO challenge_days (challenge_id, day_number, task_ar, task_en, verse_ar, verse_en, reflection_question_ar, reflection_question_en, tip_ar, tip_en) VALUES
(1,1,'ابدأ يومك بـ15 دقيقة في الكلمة قبل أي عمل.','Start your day with 15 min in the Word before any work.','«للرب الأرض وملؤها»','"The earth is the Lord''s"','ماذا قال لك الرب في الكلمة اليوم؟','What did the Lord say in the Word today?','اكتب ملاحظتك في دفتر.','Jot it in a notebook.'),
(1,2,'كن صادقاً في كل كلمة اليوم، بدون مبالغة ولا مجاملة.','Be truthful in every word today — no exaggeration, no flattery.','«تكون كلمتكم نعم نعم لا لا»','"Let your yes be yes, your no be no"','هل بالغت في شيء؟','Did you exaggerate anything?','سجّل 3 لحظات صدق.','Log 3 honest moments.'),
(1,3,'اوصل كل التزاماتك في وقتها بالضبط.','Deliver every commitment exactly on time.','«وأما الكسلان فلا يأكل»','"The lazy will not eat"','أيّ التزام صعب اليوم؟','Which commitment was hard today?','حدّد المواعيد قبل قبولها.','Set times before agreeing.'),
(1,4,'لا تأخذ ما ليس لك (حتى ورقة من المكتب).','Take nothing that is not yours (not even a sheet of paper).','«لا تسرق»','"Do not steal"','هل اعتبرت شيئاً صغيراً «حقاً مكتسباً»؟','Did you take something small as "earned"?','راجع عاداتك الصغيرة.','Audit your small habits.'),
(1,5,'اعتذر اليوم عن خطأ قديم.','Apologize today for an old wrong.','«اعترفوا بزلاتكم بعضكم لبعض»','"Confess to one another"','ما الذي تأجل اعتذارك عنه؟','What apology have you delayed?','رسالة قصيرة تكفي.','A short message is enough.'),
(1,6,'أعطِ كرماً لشخص محتاج.','Give generously to someone in need.','«مغبوط هو العطاء أكثر من الأخذ»','"It is more blessed to give"','من رأيت اليوم محتاجاً؟','Whom did you see in need today?','عطاء سري أفضل.','Secret giving is best.'),
(1,7,'راجع الأسبوع. اشكر الله. خطط للأسبوع القادم.','Review the week. Thank God. Plan next week.','«اعرفوا الرب في كل طرقكم»','"In all your ways acknowledge him"','ماذا تعلّمت هذا الأسبوع؟','What did you learn this week?','اكتب 3 نعم و3 خطوات.','Write 3 thanks and 3 next steps.');

-- Days for challenge 6 (Work as Worship, 7 days) — reuse style
INSERT INTO challenge_days (challenge_id, day_number, task_ar, task_en, verse_ar, verse_en, reflection_question_ar, reflection_question_en, tip_ar, tip_en) VALUES
(6,1,'صلِّ قبل أول مهمة: «يا رب، اقبل عملي اليوم».','Pray before your first task: "Lord, accept my work today."','«اعملوا من القلب كما للرب»','"Work as for the Lord"','هل بدأت اليوم بالرب؟','Did you start the day with the Lord?','صلاة 60 ثانية تكفي.','A 60-second prayer is enough.'),
(6,2,'أنجز مهمة واحدة بأقصى جودة كأنها للرب.','Do one task with full excellence as if for the Lord.','«كل ما عملتم باسم الرب يسوع»','"Whatever you do in the name of the Lord Jesus"','ما المهمة التي تستهين بها؟','What task do you take lightly?','اختر الأصعب.','Pick the hardest.'),
(6,3,'لا تشتكِ اليوم من أي شيء في عملك.','Do not complain about anything at work today.','«افعلوا كل شيء بلا دمدمة»','"Do everything without grumbling"','كم مرة كدت تشتكي؟','How many times did you almost complain?','بدّل الشكوى بصلاة.','Swap a complaint for a prayer.'),
(6,4,'بارك زميلاً واحداً علناً اليوم.','Bless one colleague publicly today.','«باركوا ولا تلعنوا»','"Bless and do not curse"','من باركت؟','Whom did you bless?','رسالة قصيرة كافية.','A short message is enough.'),
(6,5,'تخلَّ عن «الاستحقاق»: اخدم بدون انتظار.','Drop "entitlement" — serve without expecting return.','«من أراد أن يكون فيكم أولاً يكون للجميع عبداً»','"Whoever wants to be first must be slave of all"','أين توقعت مقابلاً؟','Where did you expect a return?','اخدم سراً مرة واحدة.','Serve secretly once.'),
(6,6,'صلِّ في منتصف اليوم 5 دقائق.','Pray 5 min midday.','«صلوا بلا انقطاع»','"Pray without ceasing"','ماذا تغيّر بعد الصلاة؟','What changed after praying?','حدد منبهاً.','Set a reminder.'),
(6,7,'اكتب 3 طرق ستحوّل بها عملك لعبادة دائمة.','Write 3 ways you will turn work into ongoing worship.','«قدّموا أجسادكم ذبيحة حية»','"Offer your bodies as a living sacrifice"','ما خطوتك القادمة؟','What is your next step?','شارك مع صديق.','Share with a friend.');

-- Stub days for challenges 2-5 (just day 1 to verify shape; admin can complete via UI)
INSERT INTO challenge_days (challenge_id, day_number, task_ar, task_en, verse_ar, verse_en, reflection_question_ar, reflection_question_en, tip_ar, tip_en) VALUES
(2,1,'اكتب قائمة بـ20 شيئاً تستمتع به.','List 20 things you enjoy.','«اعطني فهماً فأحفظ شريعتك»','"Give me understanding"','ماذا تستمتع به فعلاً؟','What do you truly enjoy?','اكتب بسرعة بدون تفكير.','Write fast without overthinking.'),
(3,1,'اختر فكرتك الواحدة لـ30 يوماً.','Pick your one idea for 30 days.','«اعرفوا الرب في كل طرقكم»','"Acknowledge him in all your ways"','لماذا هذه الفكرة بالذات؟','Why this idea?','واحدة فقط — لا تتشتت.','Only one — no scattering.'),
(4,1,'سجّل كل مصروف اليوم — حتى الصغير.','Track every expense today — even tiny ones.','«من أمين في القليل»','"Faithful in little"','أين فاجأك مصروف؟','Where did a cost surprise you?','استخدم تطبيقاً أو دفتراً.','Use an app or notebook.'),
(5,1,'انشر منشوراً واحداً اليوم عن مشروعك.','Post once today about your project.','«لا تخف»','"Do not fear"','من تخاف رأيه؟','Whose opinion do you fear?','الكمال عدو النشر.','Perfection is the enemy of posting.');

-- ----------------------------------------------------------------------------
-- 5. Skill assessment questions (22 per spec §5.3) + options
-- ----------------------------------------------------------------------------
DELETE FROM skill_assessment_options;
DELETE FROM skill_assessment_questions;

-- Enjoyment (6 questions)
INSERT INTO skill_assessment_questions (id, question_ar, question_en, question_type, order_index, category) VALUES
(1,'في يوم إجازة، ماذا تختار؟','On a free day, what do you choose?','single',1,'enjoyment'),
(2,'ما الذي يجعلك تنسى الوقت؟','What makes you lose track of time?','single',2,'enjoyment'),
(3,'أي بيئة تنشط فيها أكثر؟','Where do you thrive most?','single',3,'enjoyment'),
(4,'ما الذي تتطلع لقراءته؟','What do you look forward to reading?','single',4,'enjoyment'),
(5,'كيف تشحن طاقتك؟','How do you recharge?','single',5,'enjoyment'),
(6,'ما الذي يجعلك حياً؟','What makes you feel alive?','single',6,'enjoyment');

INSERT INTO skill_assessment_options (question_id, option_ar, option_en, tags, weight_score) VALUES
(1,'ترتيب وتخطيط','Organizing and planning','["organizer","detail"]',1),
(1,'تعلم مهارة جديدة','Learning a new skill','["learner","growth"]',1),
(1,'مساعدة شخص ما','Helping someone','["servant","empathy"]',1),
(1,'صنع شيء بيدي','Making something with my hands','["creative","builder"]',1),
(2,'الكتابة أو التصميم','Writing or designing','["creative","visual"]',1),
(2,'حل مشكلة معقدة','Solving complex problems','["analytical","problem-solver"]',1),
(2,'محادثة عميقة','A deep conversation','["communicator","relational"]',1),
(2,'بناء أو تركيب','Building or assembling','["builder","practical"]',1),
(3,'أعمل بمفردي بتركيز','Alone with focus','["solo","deep-work"]',1),
(3,'في فريق صغير','In a small team','["team","collaborative"]',1),
(3,'أمام جمهور','In front of an audience','["communicator","leader"]',1),
(3,'في الميدان','In the field','["practical","active"]',1),
(4,'كتب تنمية مهنية','Career development books','["growth","practical"]',1),
(4,'كتب روحية','Spiritual books','["spiritual","deep"]',1),
(4,'قصص حقيقية','True stories','["empathy","relational"]',1),
(4,'كتب علمية','Scientific books','["analytical","learner"]',1),
(5,'صلاة وعبادة','Prayer and worship','["spiritual"]',1),
(5,'وقت مع الأصدقاء','Time with friends','["relational"]',1),
(5,'رياضة أو نشاط','Sports or activity','["active","practical"]',1),
(5,'كتاب وفنجان','A book and coffee','["learner","solo"]',1),
(6,'إنجاز هدف صعب','Achieving a hard goal','["driver","resilient"]',1),
(6,'لمس حياة إنسان','Touching a life','["servant","empathy"]',1),
(6,'إبداع شيء جديد','Creating something new','["creative","innovator"]',1),
(6,'تنظيم وقيادة','Organizing and leading','["leader","organizer"]',1);

-- Skills (6)
INSERT INTO skill_assessment_questions (id, question_ar, question_en, question_type, order_index, category) VALUES
(7,'ماذا يطلب الناس مساعدتك فيه؟','What do people ask your help with?','single',7,'skill'),
(8,'في أي شيء تتفوّق طبيعياً؟','What comes naturally to you?','single',8,'skill'),
(9,'كيف تحل المشكلات؟','How do you solve problems?','single',9,'skill'),
(10,'ما أكثر مهارة طوّرتها؟','What skill have you developed most?','single',10,'skill'),
(11,'كيف تتعلم بشكل أفضل؟','How do you learn best?','single',11,'skill'),
(12,'ما الذي تجيده دون تدريب؟','What are you good at without training?','single',12,'skill');

INSERT INTO skill_assessment_options (question_id, option_ar, option_en, tags, weight_score) VALUES
(7,'نصيحة مالية','Financial advice','["finance"]',1),
(7,'استشارة تقنية','Tech consultation','["tech"]',1),
(7,'دعم عاطفي','Emotional support','["empathy"]',1),
(7,'تنظيم حدث','Organizing an event','["organizer"]',1),
(8,'الإقناع والتواصل','Persuading and communicating','["sales","communicator"]',1),
(8,'الكتابة','Writing','["writer","creative"]',1),
(8,'حل المشكلات','Solving problems','["analytical"]',1),
(8,'القيادة','Leading','["leader"]',1),
(9,'بالتحليل والبيانات','By analysis and data','["analytical"]',1),
(9,'بالحدس والإبداع','By intuition and creativity','["creative"]',1),
(9,'بسؤال الناس','By asking people','["relational"]',1),
(9,'بالتجربة','By experimenting','["builder"]',1),
(10,'مهارة رقمية','A digital skill','["tech","digital"]',1),
(10,'مهارة لغوية','A language skill','["communicator"]',1),
(10,'مهارة يدوية','A manual skill','["practical","builder"]',1),
(10,'مهارة قيادية','A leadership skill','["leader"]',1),
(11,'بالقراءة','By reading','["learner"]',1),
(11,'بالممارسة','By doing','["practical"]',1),
(11,'بالمشاهدة','By watching','["visual"]',1),
(11,'بالمناقشة','By discussion','["communicator"]',1),
(12,'الفنون','Arts','["creative"]',1),
(12,'الأرقام','Numbers','["analytical"]',1),
(12,'الناس','People','["relational"]',1),
(12,'الأنظمة','Systems','["organizer"]',1);

-- Style (4)
INSERT INTO skill_assessment_questions (id, question_ar, question_en, question_type, order_index, category) VALUES
(13,'تفضّل البيع، الإدارة، الإبداع، أم التعليم؟','Sales, Management, Creativity, or Teaching?','single',13,'style'),
(14,'فردياً أم جماعياً؟','Individual or team?','single',14,'style'),
(15,'منظَّم أم مرن؟','Structured or flexible?','single',15,'style'),
(16,'سريع القرار أم متأنٍ؟','Fast decider or deliberate?','single',16,'style');

INSERT INTO skill_assessment_options (question_id, option_ar, option_en, tags, weight_score) VALUES
(13,'بيع وإقناع','Sales and persuasion','["sales"]',1),(13,'إدارة وتنسيق','Management and coordination','["manager"]',1),
(13,'إبداع وإنتاج','Creativity and production','["creative"]',1),(13,'تعليم وتوجيه','Teaching and guiding','["teacher"]',1),
(14,'فردي','Solo','["solo"]',1),(14,'جماعي','Team','["team"]',1),(14,'كلاهما حسب المهمة','Both, by task','["adaptable"]',1),
(15,'منظَّم بقواعد','Structured with rules','["organizer"]',1),(15,'مرن بدون قيود','Flexible, no constraints','["adaptable"]',1),(15,'مزيج','A mix','["balanced"]',1),
(16,'قرار سريع','Quick decision','["fast","driver"]',1),(16,'تحليل متأن','Slow analysis','["analytical"]',1),(16,'حسب الموقف','It depends','["adaptable"]',1);

-- Market (3)
INSERT INTO skill_assessment_questions (id, question_ar, question_en, question_type, order_index, category) VALUES
(17,'أي حاجة في مجتمعك تراها؟','What community need do you see?','single',17,'market'),
(18,'أي مشكلة تثيرك؟','What problem stirs you?','single',18,'market'),
(19,'هل تتابع الأسواق والاتجاهات؟','Do you follow markets and trends?','single',19,'market');

INSERT INTO skill_assessment_options (question_id, option_ar, option_en, tags, weight_score) VALUES
(17,'تعليم','Education','["education"]',1),(17,'صحة','Health','["health"]',1),(17,'فقر/عمل','Poverty/Jobs','["economic"]',1),(17,'إيمان وقيم','Faith and values','["spiritual"]',1),
(18,'بطالة الشباب','Youth unemployment','["economic"]',1),(18,'تعليم ضعيف','Weak education','["education"]',1),(18,'فجوة روحية','Spiritual gap','["spiritual"]',1),(18,'تفكك مجتمعي','Community fragmentation','["community"]',1),
(19,'باستمرار','Constantly','["market-aware"]',1),(19,'أحياناً','Sometimes','["balanced"]',1),(19,'نادراً','Rarely','["focused"]',1);

-- Teamwork (3)
INSERT INTO skill_assessment_questions (id, question_ar, question_en, question_type, order_index, category) VALUES
(20,'في الفريق، أنت أكثر:','In a team you are usually:','single',20,'teamwork'),
(21,'كيف تتعامل مع الخلاف؟','How do you handle conflict?','single',21,'teamwork'),
(22,'هل تثق بسهولة؟','Do you trust easily?','single',22,'teamwork');

INSERT INTO skill_assessment_options (question_id, option_ar, option_en, tags, weight_score) VALUES
(20,'القائد','The leader','["leader"]',1),(20,'المنفّذ','The doer','["doer"]',1),(20,'المُحفّز','The motivator','["motivator"]',1),(20,'المخطط','The planner','["planner"]',1),
(21,'بالمواجهة المباشرة','Directly','["direct"]',1),(21,'بالحوار','With dialogue','["communicator"]',1),(21,'بالانسحاب','By withdrawing','["reserved"]',1),
(22,'نعم','Yes','["open"]',1),(22,'بعد وقت','After time','["balanced"]',1),(22,'بصعوبة','Hardly','["guarded"]',1);

-- ----------------------------------------------------------------------------
-- 6. Community groups (5+)
-- ----------------------------------------------------------------------------
DELETE FROM community_groups;
INSERT INTO community_groups (id, name_ar, name_en, type, description_ar, description_en, icon, is_private, max_members) VALUES
(1,'تقنية ورقميات','Tech & Digital','field','رواد أعمال تقنيون وصُنّاع منتجات رقمية','Tech founders and digital product builders','laptop',0,500),
(2,'القاهرة','Cairo','city','مجموعة القاهرة لروّاد الأعمال المسيحيين','Cairo group for Christian entrepreneurs','geo-alt',0,500),
(3,'صناعة المحتوى','Content Creators','project_type','صانعو محتوى مرئي ومكتوب','Visual and written content makers','camera',0,500),
(4,'صلاة لرواد الأعمال','Prayer for Entrepreneurs','prayer','نُصلّي لبعضنا وللمشاريع كل أسبوع','We pray for each other and projects each week','heart',0,500),
(5,'محاسبة أسبوعية','Weekly Accountability','accountability','شركاء محاسبة أسبوعية صغار','Small weekly accountability partners','people-fill',1,50);

-- ----------------------------------------------------------------------------
-- 7. Mentor accounts + mentor records
-- ----------------------------------------------------------------------------
INSERT INTO users (id, name_ar, name_en, email, password_hash, primary_language, status)
VALUES
(101,'أبونا مرقس','Fr. Mark','mentor1@joseph.local',
 '$2y$10$abcdefghijklmnopqrstuv', 'en','active'),
(102,'إيرين شفيق','Erin Shafik','mentor2@joseph.local',
 '$2y$10$abcdefghijklmnopqrstuv', 'en','active')
ON DUPLICATE KEY UPDATE name_en=VALUES(name_en);

DELETE FROM mentors WHERE user_id IN (101,102);
INSERT INTO mentors (user_id, bio_ar, bio_en, expertise_tags, session_price, is_active, rating_avg, total_sessions) VALUES
(101,'مرشد روحي وكاهن، 20 سنة خبرة في إرشاد الشباب لاكتشاف دعوتهم.','Spiritual director and priest with 20 years of mentoring youth.','["calling","spiritual","faith-work"]',0,1,4.90,124),
(102,'رائدة أعمال رقمية، مؤسسة شركتين، خبيرة تسويق وتسعير.','Digital entrepreneur, founder of two companies, marketing and pricing expert.','["digital","marketing","pricing","launch"]',0,1,4.80,87);

-- ----------------------------------------------------------------------------
-- 8. Round update (make sure round 1 is OPEN for applications)
-- ----------------------------------------------------------------------------
UPDATE rounds SET status='open', name_en=COALESCE(NULLIF(name_en,''),'Round 1 — Spring 2026'),
  name_ar=COALESCE(NULLIF(name_ar,''),'دورة 1 — ربيع 2026'),
  description_en='Our inaugural cohort. Discover your calling, build your project, serve the Kingdom.',
  description_ar='دورتنا الافتتاحية. اكتشف دعوتك، ابنِ مشروعك، اخدم الملكوت.',
  registration_deadline=DATE_ADD(CURDATE(), INTERVAL 30 DAY),
  start_date=DATE_ADD(CURDATE(), INTERVAL 35 DAY),
  end_date=DATE_ADD(CURDATE(), INTERVAL 125 DAY),
  max_participants=100
WHERE id=1;

-- ----------------------------------------------------------------------------
-- 9. Sample notifications (system-wide)
-- ----------------------------------------------------------------------------
DELETE FROM notifications WHERE related_type='seed';
INSERT INTO notifications (user_id, title_ar, title_en, body_ar, body_en, type, related_type) VALUES
(NULL,'مرحباً بك في يوسف','Welcome to Joseph','رحلتك تبدأ هنا. اكتشف دعوتك واخدم الملكوت.','Your journey begins here. Discover your calling and serve the Kingdom.','system','seed'),
(NULL,'دورة جديدة مفتوحة للتسجيل','New Round Open for Applications','دورة الربيع 2026 مفتوحة الآن. سجّل قبل انتهاء المهلة.','Spring 2026 round is now open. Apply before the deadline.','round','seed'),
(NULL,'تحدي اليوم: 7 أيام الأمانة','Today''s Challenge: 7-Day Faithfulness','ابدأ تحديك الأسبوعي وكن أميناً في القليل.','Start your weekly challenge and be faithful in little.','challenge','seed');

SET FOREIGN_KEY_CHECKS = 1;
SELECT 'SEED COMPLETE' AS status,
  (SELECT COUNT(*) FROM lessons) AS lessons,
  (SELECT COUNT(*) FROM challenges) AS challenges,
  (SELECT COUNT(*) FROM challenge_days) AS challenge_days,
  (SELECT COUNT(*) FROM skill_assessment_questions) AS questions,
  (SELECT COUNT(*) FROM skill_assessment_options) AS options,
  (SELECT COUNT(*) FROM project_types) AS project_types,
  (SELECT COUNT(*) FROM kingdom_models) AS kingdom_models,
  (SELECT COUNT(*) FROM community_groups) AS community_groups,
  (SELECT COUNT(*) FROM mentors) AS mentors,
  (SELECT COUNT(*) FROM notifications) AS notifications;
