// data.jsx — seed content + localStorage-backed store
// Editable (admin) content lives under window.useStore(); static reference data is exported directly.

const SEED = {
  hero: {
    headline: { ar: "حوّل فكرتك إلى واقع في صحة المجتمع", en: "Turn your idea into reality in community health" },
    sub: {
      ar: "منصة الابتكار لإدارة تجربة الموظف — قدّم فكرة، سجّل في دورة، وثّق اختراعاً، وارفع وعيك بالذكاء الاصطناعي. كل ذلك في مكان واحد.",
      en: "The innovation platform of Employee Experience — submit an idea, join a course, register an invention, and grow your AI literacy. All in one place."
    },
    note: { ar: "يُحدَّث المحتوى أسبوعياً", en: "Content refreshed weekly" }
  },
  stats: { ideas: 7, courses: 0, patents: 0, employees: 100 },
  contact: {
    email: "khulooddaghariri@gmail.com",
    phone: "1024",
    office: { ar: "مبنى الإدارة — الدور الثالث، إدارة تجربة الموظف", en: "HQ Building — 3rd floor, Employee Experience Dept." },
    hours: { ar: "الأحد–الخميس · ٨ص–٤م", en: "Sun–Thu · 8am–4pm" },
    whatsapp: "00966530489803",
    ownerEmail: "drmedahmed@gmail.com",
    lead: { ar: "قائدة الابتكار · خلود دغريري", en: "Innovation Lead · Khulood Daghariri" },
    ambassador: { ar: "سفير ابتكار · د. عمرو كامل", en: "Innovation Ambassador · Dr. Amr Kamel" },
    ambassadorPhone: "00966597310032",
    ambassador2: { ar: "سفيرة ابتكار · أمل جريد", en: "Innovation Ambassador · Amal Jareed" },
    ambassador2Phone: ""
  },
  // ===== courses — like "الحقيبة". term: 'upcoming' (announced/open) | 'past' (archive)
  // Empty by design — the team registers every course from the Courses page (+).
  courses: [],
  // ===== course registrations + attendance (drives PDF sheets, reminders, certificates)
  enrollments: [],
  // ===== الحقيبة / Vault — submissions land here (visible to owners in Admin)
  submissions: { ideas: [], patents: [] },
  vault: {},
  vaultLog: [],
};

const COURSE_CATS = [
  { id: "all", label: { ar: "الكل", en: "All" } },
  { id: "innovation", label: { ar: "ابتكار", en: "Innovation" } },
  { id: "ai", label: { ar: "ذكاء اصطناعي", en: "AI" } },
  { id: "patent", label: { ar: "براءات", en: "Patents" } },
];

const IDEA_CATS = [
  { ar: "تجربة الموظف", en: "Employee experience" },
  { ar: "تجربة المستفيد", en: "Patient experience" },
  { ar: "كفاءة العمليات", en: "Operational efficiency" },
  { ar: "الصحة الرقمية", en: "Digital health" },
  { ar: "الاستدامة", en: "Sustainability" },
];

const PATENT_STAGES = [
  { ar: "فكرة على ورق", en: "Concept on paper" },
  { ar: "نموذج أولي", en: "Working prototype" },
  { ar: "مُجرّب ميدانياً", en: "Field-tested" },
  { ar: "جاهز للإيداع", en: "Ready to file" },
];

// gallery of past innovations
const GALLERY = [
  { id: "g1", title: { ar: "مسار الطوارئ الذكي", en: "Smart Triage Pathway" },
    dept: { ar: "الطوارئ", en: "Emergency" }, status: "adopted",
    desc: { ar: "خفض زمن الانتظار ٣٤٪ عبر إعادة تصميم مسار الفرز.", en: "Cut waiting time 34% by redesigning the triage flow." }, accent: "mint" },
  { id: "g2", title: { ar: "مساعد التوثيق بالذكاء الاصطناعي", en: "AI Documentation Assistant" },
    dept: { ar: "الرعاية الأولية", en: "Primary care" }, status: "pilot",
    desc: { ar: "تفريغ الملاحظات السريرية صوتياً لتوفير وقت الأطباء.", en: "Voice-to-note clinical drafting to give clinicians time back." }, accent: "purple" },
  { id: "g3", title: { ar: "بوابة رفاهية الموظف", en: "Employee Wellbeing Portal" },
    dept: { ar: "تجربة الموظف", en: "Employee experience" }, status: "adopted",
    desc: { ar: "نقطة واحدة لخدمات الدعم النفسي والمزايا والإجازات.", en: "One stop for support, benefits and leave services." }, accent: "mint" },
  { id: "g4", title: { ar: "تنبؤ مخزون الأدوية", en: "Pharmacy Stock Forecasting" },
    dept: { ar: "الصيدلية", en: "Pharmacy" }, status: "review",
    desc: { ar: "نموذج يتوقع النقص قبل حدوثه بأسبوعين.", en: "A model that flags shortages two weeks ahead." }, accent: "gold" },
  { id: "g5", title: { ar: "عيادة افتراضية للمتابعة", en: "Virtual Follow-up Clinic" },
    dept: { ar: "العيادات الخارجية", en: "Outpatient" }, status: "pilot",
    desc: { ar: "متابعة المرضى المزمنين عن بُعد لتقليل المراجعات.", en: "Remote chronic-care follow-up to reduce visits." }, accent: "purple" },
  { id: "g6", title: { ar: "خرائط حرارية لازدحام الممرات", en: "Corridor Crowding Heatmaps" },
    dept: { ar: "إدارة المرافق", en: "Facilities" }, status: "adopted",
    desc: { ar: "إعادة توزيع الحركة بالاعتماد على بيانات الاستشعار.", en: "Reroute foot traffic using sensor data." }, accent: "mint" },
];

// AI literacy tracks
const AI_TRACKS = [
  { id: "a1", title: { ar: "ما هو الذكاء الاصطناعي؟", en: "What is AI?" },
    desc: { ar: "أساسيات مبسّطة بلا أي خلفية تقنية.", en: "Plain-language basics, no tech background needed." },
    mins: 15, level: { ar: "مبتدئ", en: "Beginner" }, accent: "mint" },
  { id: "a2", title: { ar: "الذكاء الاصطناعي في الرعاية الصحية", en: "AI in Healthcare" },
    desc: { ar: "أمثلة واقعية: التشخيص، الجدولة، دعم القرار.", en: "Real cases: diagnosis, scheduling, decision support." },
    mins: 20, level: { ar: "مبتدئ", en: "Beginner" }, accent: "purple" },
  { id: "a3", title: { ar: "استخدام مسؤول وأخلاقي", en: "Responsible & Ethical Use" },
    desc: { ar: "الخصوصية، التحيّز، وحدود الاعتماد على الأدوات.", en: "Privacy, bias, and the limits of these tools." },
    mins: 18, level: { ar: "متوسط", en: "Intermediate" }, accent: "gold" },
  { id: "a4", title: { ar: "اكتب أوامر أفضل", en: "Write Better Prompts" },
    desc: { ar: "كيف تطلب من المساعد الذكي بدقة ووضوح.", en: "How to ask an AI assistant clearly and precisely." },
    mins: 25, level: { ar: "متوسط", en: "Intermediate" }, accent: "purple" },
];

const AI_GLOSSARY = [
  { term: { ar: "نموذج لغوي كبير (LLM)", en: "Large Language Model (LLM)" }, def: { ar: "نظام يتنبّأ بالكلمة التالية ليولّد نصاً يشبه الإنسان.", en: "A system that predicts the next word to generate human-like text." } },
  { term: { ar: "الأمر (Prompt)", en: "Prompt" }, def: { ar: "التعليمات التي تكتبها للنموذج ليفهم ما تريد.", en: "The instruction you give the model so it knows what you want." } },
  { term: { ar: "الهلوسة (Hallucination)", en: "Hallucination" }, def: { ar: "حين يقدّم النموذج معلومة تبدو صحيحة لكنها غير دقيقة.", en: "When a model gives a confident but inaccurate answer." } },
  { term: { ar: "البيانات الوصفية", en: "Training data" }, def: { ar: "المحتوى الذي تعلّم منه النموذج أنماطه.", en: "The content a model learned its patterns from." } },
];

const AI_TIP = {
  ar: "قبل أن تثق بمخرجات الذكاء الاصطناعي في قرار سريري أو إداري، تحقّق من المصدر. الأداة مساعد لا بديل عن حكمك المهني.",
  en: "Before trusting AI output in a clinical or admin decision, verify the source. The tool assists — it doesn't replace your professional judgement."
};

const AI_QUIZ = [
  { q: { ar: "هل يمكن للذكاء الاصطناعي أن يخطئ بثقة؟", en: "Can AI be confidently wrong?" },
    a: { ar: "نعم — تُسمّى الهلوسة، لذا تحقّق دائماً.", en: "Yes — it's called hallucination, so always verify." } },
  { q: { ar: "هل أشارك بيانات مريض حقيقية في أداة عامة؟", en: "Should I paste real patient data into a public tool?" },
    a: { ar: "لا — استخدم الأدوات المعتمدة فقط حفاظاً على الخصوصية.", en: "No — use approved tools only to protect privacy." } },
];

// ===== global innovation inspiration: leaders' public remarks (short excerpts) =====
const LEADER_QUOTES = [
  { who: { ar: "إيلون ماسك", en: "Elon Musk" }, role: { ar: "تسلا · سبيس إكس", en: "Tesla · SpaceX" },
    text: { ar: "عندما يكون الأمر مهماً بما يكفي، تفعله حتى لو لم تكن الاحتمالات في صالحك.", en: "When something is important enough, you do it even if the odds are not in your favor." }, accent: "mint" },
  { who: { ar: "جِنسن هوانغ", en: "Jensen Huang" }, role: { ar: "مؤسس إنفيديا", en: "Founder, NVIDIA" },
    text: { ar: "البرمجيات تأكل العالم، والذكاء الاصطناعي سيأكل البرمجيات.", en: "Software is eating the world, but AI is going to eat software." }, accent: "purple" },
  { who: { ar: "لاري بيدج", en: "Larry Page" }, role: { ar: "مؤسس جوجل", en: "Co-founder, Google" },
    text: { ar: "إن كنت تُغيّر العالم، فأنت تعمل على أمور مهمة.", en: "If you're changing the world, you're working on important things." }, accent: "gold" },
  { who: { ar: "سام ألتمان", en: "Sam Altman" }, role: { ar: "أوبن إيه آي", en: "OpenAI" },
    text: { ar: "أنجح من عرفتهم يؤمنون بأنفسهم إلى درجة تقترب من المبالغة.", en: "The most successful people I know believe in themselves almost to the point of delusion." }, accent: "mint" },
  { who: { ar: "داريو أمودي", en: "Dario Amodei" }, role: { ar: "مؤسس Anthropic", en: "Co-founder, Anthropic" },
    text: { ar: "يرى أن بناء ذكاء اصطناعي موثوق وآمن ونافع للإنسان هو الأساس الذي يجب أن يُبنى عليه كل تقدّم.", en: "Holds that building AI that is reliable, safe and beneficial to people is the foundation all progress must rest on." }, accent: "purple", paraphrase: true },
];

// short, original reflections for employees
const INNOVATION_ARTICLES = [
  { title: { ar: "الابتكار يبدأ من إزعاج صغير", en: "Innovation starts with a small annoyance" },
    body: { ar: "أعظم التحسينات في المستشفيات لم تأتِ من مؤتمرات، بل من موظف لاحظ خطوة زائدة تُكرَّر مئة مرة يومياً. دوّن ما يُزعجك في عملك أسبوعاً كاملاً — ستجد بين يديك قائمة مشاريع ابتكار.", en: "The biggest hospital improvements didn't come from conferences, but from a staff member noticing one redundant step repeated a hundred times a day. Log what annoys you for a week — you'll be holding a list of innovation projects." },
    mins: 3, accent: "mint" },
  { title: { ar: "لماذا تُوثّق فكرتك قبل أن تكتمل؟", en: "Why document your idea before it's finished" },
    body: { ar: "الأفكار لا تُسجَّل بالكمال بل بالتاريخ. توثيق فكرتك مبكراً يثبت أسبقيتك، ويمنحك فريقاً يساعدك على تطويرها، ويحوّل الخاطرة العابرة إلى أصل مؤسسي يُبنى عليه.", en: "Ideas aren't registered by perfection, but by date. Documenting early proves your priority, brings you a team to develop it, and turns a passing thought into an institutional asset." },
    mins: 2, accent: "gold" },
  { title: { ar: "الذكاء الاصطناعي مساعد لا بديل", en: "AI is an assistant, not a replacement" },
    body: { ar: "أفضل استخدام للذكاء الاصطناعي في القطاع الصحي هو تحرير وقت الممارس من العمل الورقي ليعطيه للمريض. الأداة تُسرّع، وأنت من يقرّر — والمسؤولية المهنية تبقى بين يديك دائماً.", en: "The best use of AI in healthcare is freeing a clinician's time from paperwork and giving it back to the patient. The tool accelerates; you decide — professional responsibility always stays with you." },
    mins: 3, accent: "purple" },
];

// curated global innovation sources
const GLOBAL_SOURCES = [
  { name: { ar: "المنظمة العالمية للملكية الفكرية (WIPO)", en: "WIPO" }, desc: { ar: "مؤشر الابتكار العالمي وقواعد براءات الاختراع.", en: "Global Innovation Index and patent databases." }, url: "https://www.wipo.int", accent: "gold" },
  { name: { ar: "MIT Technology Review", en: "MIT Technology Review" }, desc: { ar: "أحدث التقنيات المُخترقة سنوياً وتحليلاتها.", en: "Annual breakthrough technologies and analysis." }, url: "https://www.technologyreview.com", accent: "mint" },
  { name: { ar: "منظمة الصحة العالمية — الابتكار", en: "WHO Innovation" }, desc: { ar: "ابتكارات الصحة العامة والحلول المعتمدة عالمياً.", en: "Public-health innovations and globally endorsed solutions." }, url: "https://www.who.int", accent: "purple" },
  { name: { ar: "Nature — الطب والابتكار", en: "Nature Medicine" }, desc: { ar: "أبحاث محكّمة في الطب والتقنيات الحيوية.", en: "Peer-reviewed research in medicine and biotech." }, url: "https://www.nature.com", accent: "mint" },
];

// ===== free global learning platforms & certificates =====
const LEARN_PLATFORMS = [
  { name: "Coursera", ar: "كورسيرا", desc: { ar: "شهادات من جامعات عالمية وجوجل — تدقيق مجاني للمحتوى.", en: "Certificates from world universities and Google — free audit access." }, url: "https://www.coursera.org", tag: { ar: "شهادات", en: "Certificates" }, accent: "mint" },
  { name: "edX", ar: "إي دي إكس", desc: { ar: "مقررات هارفارد وMIT مجاناً بصيغة التدقيق.", en: "Harvard and MIT courses free in audit mode." }, url: "https://www.edx.org", tag: { ar: "جامعات", en: "Universities" }, accent: "purple" },
  { name: "WIPO Academy", ar: "أكاديمية الملكية الفكرية", desc: { ar: "دورات مجانية في براءات الاختراع والملكية الفكرية.", en: "Free courses in patents and intellectual property." }, url: "https://welc.wipo.int", tag: { ar: "براءات", en: "Patents" }, accent: "gold" },
  { name: "Microsoft Learn", ar: "مايكروسوفت ليرن", desc: { ar: "مسارات مجانية بالكامل في الذكاء الاصطناعي والبيانات.", en: "Fully free paths in AI and data." }, url: "https://learn.microsoft.com", tag: { ar: "مجاني", en: "Free" }, accent: "mint" },
  { name: "Doroob · دروب", desc: { ar: "منصة سعودية وطنية للتدريب المجاني مع شهادات معتمدة.", en: "Saudi national platform for free training with accredited certificates." }, url: "https://www.doroob.sa", tag: { ar: "سعودي", en: "Saudi" }, accent: "gold" },
  { name: "freeCodeCamp", desc: { ar: "شهادات برمجة وتحليل بيانات مجانية بالكامل.", en: "Entirely free coding and data-analysis certifications." }, url: "https://www.freecodecamp.org", tag: { ar: "مجاني", en: "Free" }, accent: "purple" },
];

// ===== best channels to follow =====
const LEARN_CHANNELS = [
  { name: "TED", desc: { ar: "أفكار تستحق النشر — محاضرات ملهمة قصيرة.", en: "Ideas worth spreading — short inspiring talks." }, url: "https://www.youtube.com/@TED", accent: "rose" },
  { name: "DeepLearning.AI", desc: { ar: "الذكاء الاصطناعي مبسّطاً من أندرو نج.", en: "AI made approachable, by Andrew Ng." }, url: "https://www.youtube.com/@Deeplearningai", accent: "mint" },
  { name: "Y Combinator", desc: { ar: "كيف تبنى الشركات والأفكار من الصفر.", en: "How startups and ideas get built from zero." }, url: "https://www.youtube.com/@ycombinator", accent: "gold" },
  { name: "Two Minute Papers", desc: { ar: "أحدث أبحاث الذكاء الاصطناعي في دقيقتين.", en: "The latest AI research in two minutes." }, url: "https://www.youtube.com/@TwoMinutePapers", accent: "purple" },
];

// ===== innovation & IP terminology (EN ⇄ AR) =====
const INNOVATION_TERMS = [
  { en: "Innovation", ar: "الابتكار", def: { ar: "تحويل فكرة جديدة إلى قيمة عملية قابلة للتطبيق والقياس.", en: "Turning a new idea into applicable, measurable value." }, group: "core" },
  { en: "Invention", ar: "الاختراع", def: { ar: "حل تقني جديد لمشكلة قائمة، قابل للحماية القانونية.", en: "A novel technical solution to a problem, legally protectable." }, group: "core" },
  { en: "Patent", ar: "براءة اختراع", def: { ar: "حق حصري يمنحه القانون للمخترع لفترة محددة (٢٠ سنة عادةً).", en: "An exclusive legal right granted to an inventor for a fixed term (usually 20 years)." }, group: "ip" },
  { en: "WIPO", ar: "المنظمة العالمية للملكية الفكرية", def: { ar: "وكالة أممية ترعى أنظمة حماية الملكية الفكرية عالمياً.", en: "The UN agency stewarding global IP protection systems." }, group: "ip" },
  { en: "IP · Intellectual Property", ar: "الملكية الفكرية", def: { ar: "الحقوق على نتاج العقل: اختراعات، علامات، تصاميم، مؤلفات.", en: "Rights over creations of the mind: inventions, marks, designs, works." }, group: "ip" },
  { en: "PCT", ar: "معاهدة التعاون بشأن البراءات", def: { ar: "مسار يتيح إيداع طلب براءة واحد نافذ في أكثر من ١٥٠ دولة.", en: "A route to file one patent application effective in over 150 countries." }, group: "ip" },
  { en: "Prior Art", ar: "حالة التقنية الصناعية السابقة", def: { ar: "كل ما نُشر قبل تاريخك ويؤثر على جدّة اختراعك.", en: "Everything published before your date that affects your invention's novelty." }, group: "ip" },
  { en: "Trademark", ar: "العلامة التجارية", def: { ar: "علامة مميّزة تحمي هوية الخدمة أو المنتج.", en: "A distinctive sign protecting a product or service identity." }, group: "ip" },
  { en: "API", ar: "واجهة برمجة التطبيقات", def: { ar: "بوابة تسمح لنظامين بتبادل البيانات والخدمات آلياً.", en: "A gateway letting two systems exchange data and services automatically." }, group: "tech" },
  { en: "MVP · Minimum Viable Product", ar: "أدنى منتج قابل للتطبيق", def: { ar: "أبسط نسخة تُختبر بها الفكرة مع مستخدمين حقيقيين.", en: "The simplest version that tests the idea with real users." }, group: "tech" },
  { en: "Prototype", ar: "النموذج الأولي", def: { ar: "نموذج تجريبي يُجسّد الفكرة قبل التنفيذ الكامل.", en: "A trial model embodying the idea before full build." }, group: "tech" },
  { en: "Proof of Concept", ar: "إثبات المفهوم", def: { ar: "تجربة محدودة تُثبت أن الفكرة قابلة للتحقق فعلاً.", en: "A limited trial proving the idea can actually work." }, group: "tech" },
  { en: "Design Thinking", ar: "التفكير التصميمي", def: { ar: "منهجية تبدأ من التعاطف مع المستخدم وتنتهي بالاختبار.", en: "A method starting with user empathy and ending in testing." }, group: "method" },
  { en: "Pilot", ar: "التجربة الميدانية", def: { ar: "تطبيق محدود النطاق لقياس الأثر قبل التعميم.", en: "A limited-scope rollout measuring impact before scaling." }, group: "method" },
  { en: "Scalability", ar: "القابلية للتوسّع", def: { ar: "قدرة الحل على النمو دون انخفاض في الجودة أو الكفاءة.", en: "The solution's ability to grow without losing quality or efficiency." }, group: "method" },
  { en: "Open Innovation", ar: "الابتكار المفتوح", def: { ar: "الاستفادة من أفكار وشراكات خارج حدود المؤسسة.", en: "Drawing on ideas and partnerships beyond the organization's walls." }, group: "method" },
  { en: "Disruptive Innovation", ar: "الابتكار الجذري", def: { ar: "ابتكار يعيد تشكيل السوق ويزيح الحلول التقليدية.", en: "Innovation that reshapes a market and displaces incumbents." }, group: "method" },
  { en: "Incubator / Accelerator", ar: "حاضنة / مسرّعة أعمال", def: { ar: "برامج ترعى الأفكار الناشئة بالتمويل والإرشاد.", en: "Programs nurturing early ideas with funding and mentorship." }, group: "core" },
  { en: "TRL · Technology Readiness Level", ar: "مستوى جاهزية التقنية", def: { ar: "مقياس من ١ إلى ٩ يحدد مدى نضج التقنية.", en: "A 1-to-9 scale rating how mature a technology is." }, group: "tech" },
  { en: "Licensing / Royalty", ar: "الترخيص / العائد", def: { ar: "منح غيرك حق استغلال اختراعك مقابل عائد مالي.", en: "Granting others the right to exploit your invention for a fee." }, group: "ip" },
];

const TERM_GROUPS = [
  { id: 'all', label: { ar: 'الكل', en: 'All' } },
  { id: 'ip', label: { ar: 'الملكية الفكرية', en: 'IP & Patents' } },
  { id: 'tech', label: { ar: 'تقني', en: 'Technical' } },
  { id: 'method', label: { ar: 'منهجيات', en: 'Methods' } },
  { id: 'core', label: { ar: 'أساسيات', en: 'Core' } },
];

// ===== أكاديمية المبتكرين — innovator graduation path =====
const ACADEMY_LEVELS = [
  { lvl: 1, code: "EXPLORER", name: { ar: "مستكشف", en: "Explorer" },
    goal: { ar: "يتعرّف على الابتكار ويكتشف تحدياً حقيقياً في عمله.", en: "Learns what innovation is and spots a real challenge in their work." },
    reqs: { ar: "٣ دورات أساسية · تقديم فكرة واحدة", en: "3 core courses · submit 1 idea" },
    weeks: 4, accent: "mint", icon: "spark" },
  { lvl: 2, code: "BUILDER", name: { ar: "صانع", en: "Builder" },
    goal: { ar: "يحوّل فكرته إلى نموذج أولي قابل للاختبار.", en: "Turns the idea into a testable prototype." },
    reqs: { ar: "ورشة تفكير تصميمي · نموذج أولي معروض", en: "Design-thinking workshop · a presented prototype" },
    weeks: 6, accent: "purple", icon: "flask" },
  { lvl: 3, code: "INVENTOR", name: { ar: "مخترع", en: "Inventor" },
    goal: { ar: "يوثّق اختراعه ويجتاز بحث حالة التقنية السابقة.", en: "Documents the invention and clears a prior-art search." },
    reqs: { ar: "كشف اختراع مقبول · تجربة ميدانية مصغّرة", en: "Accepted disclosure · a mini field pilot" },
    weeks: 8, accent: "gold", icon: "award" },
  { lvl: 4, code: "AMBASSADOR", name: { ar: "سفير ابتكار", en: "Innovation Ambassador" },
    goal: { ar: "يقود فريقاً، ويرشد مبتكرين جدداً، ويمثّل المنصة.", en: "Leads a team, mentors new innovators, represents the platform." },
    reqs: { ar: "إرشاد ٣ مبتكرين · تقديم دورة واحدة", en: "Mentor 3 innovators · deliver 1 course" },
    weeks: 12, accent: "rose", icon: "shield" },
];

const ACADEMY_PILLARS = [
  { icon: "book", title: { ar: "منهج معتمد", en: "Structured curriculum" },
    desc: { ar: "مسار تدريبي متدرّج من الوعي إلى قيادة الابتكار، مبني على منهجيات عالمية.", en: "A tiered path from awareness to leading innovation, built on global methodologies." }, accent: "mint" },
  { icon: "users", title: { ar: "إرشاد فردي", en: "One-to-one mentoring" },
    desc: { ar: "لكل مبتكر مرشد من فريق الابتكار يتابع فكرته حتى تصل للتطبيق.", en: "Each innovator gets a mentor from the innovation team, following the idea to delivery." }, accent: "purple" },
  { icon: "shield", title: { ar: "حماية الملكية الفكرية", en: "IP protection" },
    desc: { ar: "مرافقة قانونية من الكشف حتى الإيداع، مع الحفاظ على سرّية الاختراع.", en: "Legal accompaniment from disclosure to filing, keeping the invention confidential." }, accent: "gold" },
  { icon: "award", title: { ar: "شهادة وتكريم", en: "Certification & recognition" },
    desc: { ar: "شهادة لكل مستوى، وتكريم المتخرّجين في ملتقى الابتكار السنوي.", en: "A certificate per level, with graduates honored at the annual innovation forum." }, accent: "rose" },
];

// ===== academy programs (tracks) =====
const ACADEMY_PROGRAMS = [
  { id: 'ie', icon: 'target', accent: 'gold',
    name: { ar: "مسار هندسة الابتكار", en: "Innovation Engineering Track" },
    desc: { ar: "التخصص الأساسي للأكاديمية: تحويل الابتكار من إلهام فردي إلى هندسة لها مدخلات ومعايير وأدوات قياس ومخرجات موثّقة قابلة للتكرار.", en: "The Academy's core discipline: turning innovation from individual inspiration into an engineering practice with inputs, standards, measurement and documented repeatable outputs." },
    hours: 48, level: { ar: "مسار كامل · ٣ مستويات", en: "Full curriculum · 3 levels" },
    topics: [
      { ar: "تفكيك التحدي وهندسة المشكلة", en: "Problem decomposition & engineering" },
      { ar: "التوليف المنهجي وتوليد البدائل (TRIZ)", en: "Systematic synthesis & TRIZ" },
      { ar: "قياس الابتكار قبل التنفيذ", en: "Measuring innovation before execution" },
      { ar: "توثيق الأسبقية والبصمة الرقمية", en: "Priority documentation & digital sealing" },
      { ar: "هندسة التبنّي والتوسّع", en: "Adoption & scale engineering" },
    ] },
  { id: 'ai', icon: 'cpu', accent: 'purple',
    name: { ar: "مسار الذكاء الاصطناعي التطبيقي", en: "Applied AI Track" },
    desc: { ar: "من أساسيات الذكاء الاصطناعي إلى بناء حلول عملية في الرعاية الصحية، مع التركيز على الاستخدام الآمن والمسؤول.", en: "From AI fundamentals to building practical healthcare solutions, with a focus on safe and responsible use." },
    hours: 40, level: { ar: "مبتدئ ← متقدم", en: "Beginner → Advanced" },
    topics: [
      { ar: "أساسيات الذكاء الاصطناعي والتعلّم الآلي", en: "AI & machine-learning foundations" },
      { ar: "هندسة الأوامر للممارس الصحي", en: "Prompt engineering for clinicians" },
      { ar: "أخلاقيات وخصوصية البيانات الصحية", en: "Ethics & health-data privacy" },
      { ar: "تحليل البيانات ولوحات المعلومات", en: "Data analysis & dashboards" },
    ] },
  { id: 'innovation', icon: 'bulb', accent: 'mint',
    name: { ar: "مسار الابتكار وتصميم الحلول", en: "Innovation & Solution Design" },
    desc: { ar: "منهجية التفكير التصميمي والابتكار الرشيق لتحويل تحديات العمل اليومية إلى حلول مُختبرة.", en: "Design thinking and lean innovation to turn daily work challenges into tested solutions." },
    hours: 36, level: { ar: "جميع المستويات", en: "All levels" },
    topics: [
      { ar: "التفكير التصميمي والتعاطف مع المستخدم", en: "Design thinking & user empathy" },
      { ar: "بناء النماذج الأولية السريعة", en: "Rapid prototyping" },
      { ar: "قياس الأثر ومؤشرات النجاح", en: "Impact measurement & KPIs" },
      { ar: "الابتكار الرشيق وحلقات التعلّم", en: "Lean innovation & learning loops" },
    ] },
  { id: 'ip', icon: 'award', accent: 'gold',
    name: { ar: "مسار الملكية الفكرية وبراءات الاختراع", en: "IP & Patents Track" },
    desc: { ar: "كتابة كشف الاختراع، بحث حالة التقنية السابقة، ومسار الإيداع المحلي والدولي عبر معاهدة PCT.", en: "Writing disclosures, prior-art search, and the local and international filing route via the PCT." },
    hours: 32, level: { ar: "متوسط", en: "Intermediate" },
    topics: [
      { ar: "شروط قابلية الحماية والجدّة", en: "Patentability & novelty criteria" },
      { ar: "صياغة كشف الاختراع والمطالبات", en: "Drafting disclosures & claims" },
      { ar: "بحث حالة التقنية في قواعد WIPO", en: "Prior-art search in WIPO databases" },
      { ar: "الترخيص والاستثمار في الاختراع", en: "Licensing & commercializing inventions" },
    ] },
  { id: 'lang', icon: 'globe', accent: 'rose',
    name: { ar: "مسار اللغة الإنجليزية للابتكار", en: "English for Innovation" },
    desc: { ar: "الإنجليزية المهنية اللازمة لكتابة البراءات والأوراق العلمية وتقديم الأفكار في المحافل الدولية.", en: "The professional English needed to write patents and papers, and pitch ideas internationally." },
    hours: 30, level: { ar: "مبتدئ ← متوسط", en: "Beginner → Intermediate" },
    topics: [
      { ar: "المصطلحات التقنية والقانونية", en: "Technical & legal terminology" },
      { ar: "الكتابة العلمية والتقارير", en: "Scientific writing & reports" },
      { ar: "تقديم العروض بالإنجليزية", en: "Pitching & presenting in English" },
      { ar: "مراسلة الجهات والمجلات الدولية", en: "Corresponding with global bodies & journals" },
    ] },
  { id: 'leadership', icon: 'rocket', accent: 'mint',
    name: { ar: "مسار قيادة فرق الابتكار", en: "Innovation Leadership" },
    desc: { ar: "تأسيس ثقافة ابتكار داخل الفريق، وإرشاد المبتكرين الجدد، وإدارة محفظة الأفكار.", en: "Building an innovation culture, mentoring new innovators, and managing an idea portfolio." },
    hours: 28, level: { ar: "متقدم", en: "Advanced" },
    topics: [
      { ar: "بناء ثقافة الابتكار المؤسسي", en: "Building institutional innovation culture" },
      { ar: "الإرشاد والتوجيه الفعّال", en: "Effective mentoring & coaching" },
      { ar: "إدارة محفظة الأفكار والأولويات", en: "Idea portfolio & prioritization" },
      { ar: "عرض الأفكار على القيادة", en: "Pitching to leadership" },
    ] },
  { id: 'digital', icon: 'layers', accent: 'purple',
    name: { ar: "مسار الصحة الرقمية", en: "Digital Health Track" },
    desc: { ar: "التحوّل الرقمي في الخدمات الصحية: الأنظمة، التشغيل البيني، وتجربة المستفيد الرقمية.", en: "Digital transformation in health services: systems, interoperability, and digital patient experience." },
    hours: 34, level: { ar: "متوسط", en: "Intermediate" },
    topics: [
      { ar: "الأنظمة الصحية والتشغيل البيني", en: "Health systems & interoperability" },
      { ar: "الصحة الرقمية والرعاية عن بُعد", en: "Digital health & telecare" },
      { ar: "أمن المعلومات الصحية", en: "Health information security" },
      { ar: "تجربة المستفيد الرقمية", en: "Digital patient experience" },
    ] },
];

// ===== هندسة الابتكار — the Academy's flagship discipline =====
const IE_PRINCIPLES = [
  { icon: 'layers', accent: 'gold', title: { ar: "المشكلة تُهندَس لا تُوصَف", en: "Problems are engineered, not described" },
    desc: { ar: "نفكّك التحدي إلى وظائف وقيود وتناقضات قبل التفكير في أي حل، فيصبح الحل نتيجة تحليل لا نتيجة حدس.", en: "We break a challenge into functions, constraints and contradictions before any solution, so the answer follows analysis rather than intuition." } },
  { icon: 'spark', accent: 'mint', title: { ar: "التوليف بدل العصف", en: "Synthesis over brainstorming" },
    desc: { ar: "توليد البدائل بأدوات منهجية (TRIZ، الأنماط، التفكير الإبداعي المنظّم) يعطي حلولاً أعلى جودة من الجلسات المفتوحة.", en: "Generating options with systematic tools (TRIZ, patterns, structured creative thinking) beats open sessions in quality." } },
  { icon: 'chart', accent: 'purple', title: { ar: "القياس قبل الحكم", en: "Measure before you judge" },
    desc: { ar: "لكل فكرة مؤشرات: الجدة، الأثر، مقاومة النظام، وقابلية التوسّع — تُقاس رقمياً قبل صرف أي مورد.", en: "Every idea carries metrics — novelty, impact, system friction, scalability — quantified before any resource is spent." } },
  { icon: 'lock', accent: 'rose', title: { ar: "الأسبقية تُوثَّق لحظة الولادة", en: "Priority is sealed at birth" },
    desc: { ar: "كل مخرَج فكري يُختم ببصمة رقمية وختم زمني موثّق، فتُحفظ ملكية المبتكر قبل أي عرض أو نشر.", en: "Every intellectual output is sealed with a digital fingerprint and trusted timestamp, protecting ownership before any disclosure." } },
];

const IE_MODULES = [
  { code: 'IE-101', hours: 6, accent: 'gold',
    name: { ar: "أسس هندسة الابتكار", en: "Foundations of Innovation Engineering" },
    desc: { ar: "لماذا يفشل الابتكار العشوائي، وكيف تحوّله المنهجية إلى عملية قابلة للإدارة والتكرار داخل منظومة صحية.", en: "Why random innovation fails, and how method turns it into a manageable, repeatable process inside a health system." },
    outcomes: [
      { ar: "تمييز الابتكار عن التحسين والاختراع", en: "Distinguish innovation, improvement and invention" },
      { ar: "قراءة منظومة الابتكار في تجمّعك", en: "Read the innovation system in your cluster" },
      { ar: "بناء دفتر ابتكار شخصي", en: "Build a personal innovation logbook" },
    ] },
  { code: 'IE-201', hours: 8, accent: 'mint',
    name: { ar: "هندسة المشكلة وتفكيك التحدي", en: "Problem Engineering" },
    desc: { ar: "من الشكوى إلى بيان مشكلة قابل للحل: الوظائف، القيود، التناقض الجوهري، وخريطة أصحاب المصلحة.", en: "From a complaint to a solvable problem statement: functions, constraints, the core contradiction and the stakeholder map." },
    outcomes: [
      { ar: "صياغة بيان مشكلة هندسي", en: "Write an engineered problem statement" },
      { ar: "تحديد التناقض الجوهري", en: "Identify the core contradiction" },
      { ar: "تحليل السبب الجذري بالبيانات", en: "Data-driven root-cause analysis" },
    ] },
  { code: 'IE-202', hours: 10, accent: 'purple',
    name: { ar: "التوليف المنهجي وتوليد البدائل", en: "Systematic Synthesis & Ideation" },
    desc: { ar: "أدوات توليد الحلول المنظّمة: مبادئ TRIZ الأربعون، الأنماط الخمسة للتفكير الإبداعي المنظّم، ونقل الحلول بين المجالات.", en: "Structured solution generation: the forty TRIZ principles, the five SIT patterns, and cross-domain solution transfer." },
    outcomes: [
      { ar: "تطبيق مبادئ TRIZ على تحدٍّ صحي", en: "Apply TRIZ principles to a health challenge" },
      { ar: "توليد ٢٠ بديلاً مصنّفاً لكل تحدٍّ", en: "Generate 20 classified options per challenge" },
      { ar: "اختيار البديل الأمثل بمعايير معلنة", en: "Select the best option against stated criteria" },
    ] },
  { code: 'IE-301', hours: 8, accent: 'rose',
    name: { ar: "قياس الابتكار ومؤشرات القرار", en: "Innovation Measurement" },
    desc: { ar: "تحويل الفكرة إلى أرقام: الجدة البنيوية، سرعة التبنّي، مقاومة النظام والتكلفة، وأُس التوسّع — ثم بناء لوحة قرار.", en: "Turning an idea into numbers: structural novelty, adoption velocity, system friction and scale exponent — then a decision board." },
    outcomes: [
      { ar: "احتساب مؤشر توليف موحّد للفكرة", en: "Compute a unified synthesis index" },
      { ar: "تقدير الأثر السريري والتشغيلي", en: "Estimate clinical and operational impact" },
      { ar: "عرض الفكرة على القيادة بلغة الأرقام", en: "Pitch to leadership in the language of numbers" },
    ] },
  { code: 'IE-302', hours: 8, accent: 'gold',
    name: { ar: "هندسة الحماية والملكية الفكرية", en: "Protection & IP Engineering" },
    desc: { ar: "صياغة كشف الاختراع، بحث حالة التقنية، البصمة الرقمية والختم الزمني، ومسار الإيداع لدى الهيئة السعودية للملكية الفكرية.", en: "Drafting disclosures, prior-art search, digital sealing and timestamping, and the SAIP filing route." },
    outcomes: [
      { ar: "كتابة كشف اختراع كامل", en: "Write a complete disclosure" },
      { ar: "استخراج بصمة رقمية وإشعار أسبقية", en: "Produce a fingerprint and priority receipt" },
      { ar: "تجهيز ملف الإيداع", en: "Prepare the filing package" },
    ] },
  { code: 'IE-401', hours: 8, accent: 'mint',
    name: { ar: "هندسة التبنّي والتوسّع", en: "Adoption & Scale Engineering" },
    desc: { ar: "لماذا تموت الحلول الجيدة عند التطبيق؟ تصميم التجربة التشغيلية، إدارة المقاومة، والانتقال من مركز واحد إلى التجمّع.", en: "Why good solutions die at rollout: designing the operational pilot, managing resistance, and scaling from one site to the cluster." },
    outcomes: [
      { ar: "تصميم تجربة تشغيلية محدودة", en: "Design a bounded operational pilot" },
      { ar: "خطة إدارة تغيير للفريق", en: "A change-management plan for the team" },
      { ar: "بناء حالة توسّع للقيادة", en: "Build a scale case for leadership" },
    ] },
];

const IE_WORKSHOPS = [
  { icon: 'flask', accent: 'mint', dur: { ar: "٥ أيام", en: "5 days" },
    title: { ar: "ورشة سبرنت هندسة الابتكار", en: "Innovation Engineering Sprint" },
    desc: { ar: "من تحدٍّ حقيقي إلى نموذج أولي مُختبَر مع مستفيدين حقيقيين في خمسة أيام.", en: "From a real challenge to a prototype tested with real users in five days." } },
  { icon: 'target', accent: 'gold', dur: { ar: "يوم واحد", en: "1 day" },
    title: { ar: "ورشة TRIZ التطبيقية", en: "Applied TRIZ Workshop" },
    desc: { ar: "حل التناقضات الهندسية في مسارات الرعاية باستخدام مبادئ TRIZ ومصفوفة التناقض.", en: "Resolving engineering contradictions in care pathways with TRIZ principles and the contradiction matrix." } },
  { icon: 'chart', accent: 'purple', dur: { ar: "نصف يوم", en: "Half day" },
    title: { ar: "ورشة قياس الفكرة", en: "Idea Measurement Lab" },
    desc: { ar: "تمرين عملي على تحويل ثلاث أفكار من فريقك إلى مؤشرات قرار قابلة للمقارنة.", en: "Hands-on conversion of three team ideas into comparable decision metrics." } },
  { icon: 'lock', accent: 'rose', dur: { ar: "نصف يوم", en: "Half day" },
    title: { ar: "ورشة كشف الاختراع", en: "Disclosure Writing Clinic" },
    desc: { ar: "كتابة كشف اختراعك بمرافقة مختص، وختمه رقمياً في خزنة الابتكار قبل مغادرة القاعة.", en: "Write your disclosure with a specialist and seal it digitally in the Innovation Vault before you leave." } },
  { icon: 'users', accent: 'gold', dur: { ar: "٤٨ ساعة", en: "48 hours" },
    title: { ar: "هاكاثون هندسة الابتكار", en: "Innovation Engineering Hackathon" },
    desc: { ar: "فرق متعددة التخصصات تتنافس على تحدٍّ معلن بمنهجية موحّدة ومعايير تحكيم رقمية.", en: "Cross-disciplinary teams compete on a published challenge with one method and numeric judging criteria." } },
  { icon: 'book', accent: 'mint', dur: { ar: "شهرياً", en: "Monthly" },
    title: { ar: "مرصد هندسة الابتكار", en: "Innovation Engineering Review" },
    desc: { ar: "جلسة شهرية لمراجعة ورقة علمية أو براءة اختراع حديثة وتفكيك منهجيتها.", en: "A monthly session dissecting the method behind a recent paper or patent." } },
];

const IE_BOOKS = [
  { id: 'ie1', accent: 'gold', year: 2018,
    title: { ar: "قيادة الإلهام: حل المشكلات بنظام هندسة الابتكار", en: "Driving Eureka!" }, en: "Driving Eureka!: Problem Solving with Data-Driven Methods & the Innovation Engineering System",
    author: { ar: "دوج هول", en: "Doug Hall" },
    why: { ar: "المرجع المؤسّس لمصطلح «هندسة الابتكار»: نظام كامل يجعل الابتكار عملية قابلة للتعلّم والقياس داخل المؤسسات.", en: "The founding reference for the term: a complete system making innovation a learnable, measurable organisational process." } },
  { id: 'ie2', accent: 'purple', year: 1996,
    title: { ar: "وفجأة ظهر المخترع — نظرية الحل الابتكاري للمشكلات", en: "And Suddenly the Inventor Appeared" }, en: "And Suddenly the Inventor Appeared: TRIZ, the Theory of Inventive Problem Solving",
    author: { ar: "جينريك ألتشولر", en: "Genrich Altshuller" },
    why: { ar: "الأصل الروسي لمنهجية TRIZ: أن الاختراع نمط متكرّر يمكن استخراجه من ملايين البراءات وتعليمه.", en: "The Russian origin of TRIZ: invention is a recurring pattern extractable from millions of patents — and teachable." } },
  { id: 'ie3', accent: 'mint', year: 2013,
    title: { ar: "داخل الصندوق", en: "Inside the Box" }, en: "Inside the Box: A Proven System of Creativity for Breakthrough Results",
    author: { ar: "درو بويد وجاكوب جولدنبرج", en: "Drew Boyd & Jacob Goldenberg" },
    why: { ar: "الأنماط الخمسة للتفكير الإبداعي المنظّم — أقرب أداة عملية لتوليد الحلول داخل قيود بيئة العمل الصحية.", en: "The five patterns of Systematic Inventive Thinking — the most practical tool for ideating within real clinical constraints." } },
  { id: 'ie4', accent: 'rose', year: 2014,
    title: { ar: "طريقة المبتكر", en: "The Innovator's Method" }, en: "The Innovator's Method: Bringing the Lean Startup into Your Organization",
    author: { ar: "ناثان فور وجيف داير", en: "Nathan Furr & Jeff Dyer" },
    why: { ar: "كيف تُدار الفكرة في ظل عدم اليقين داخل مؤسسة قائمة — الجسر بين المنهجية والواقع المؤسسي.", en: "How to manage an idea under uncertainty inside an established institution — the bridge between method and reality." } },
];

const IE_STAGES = [
  { code: 'IE-A', hours: 14, accent: 'mint', name: { ar: "ممارس هندسة ابتكار", en: "IE Practitioner" },
    req: { ar: "إتمام IE-101 و IE-201 + تحدٍّ مُهندَس واحد", en: "Complete IE-101 & IE-201 + one engineered challenge" } },
  { code: 'IE-B', hours: 18, accent: 'gold', name: { ar: "مهندس ابتكار معتمد", en: "Certified Innovation Engineer" },
    req: { ar: "إتمام IE-202 و IE-301 + فكرة مقيسة ومختومة رقمياً", en: "Complete IE-202 & IE-301 + one measured, digitally sealed idea" } },
  { code: 'IE-C', hours: 16, accent: 'purple', name: { ar: "قائد هندسة ابتكار", en: "IE Lead" },
    req: { ar: "إتمام IE-302 و IE-401 + كشف اختراع مُودَع أو تجربة تشغيلية موسّعة", en: "Complete IE-302 & IE-401 + a filed disclosure or a scaled pilot" } },
];

// academy activities beyond courses
const ACADEMY_ACTIVITIES = [
  { icon: 'flask', accent: 'mint', title: { ar: "معامل الابتكار", en: "Innovation Labs" },
    desc: { ar: "ورش عملية أسبوعية تبني فيها نموذجك الأولي بمرافقة مرشد.", en: "Weekly hands-on workshops where you build your prototype with a mentor." } },
  { icon: 'target', accent: 'gold', title: { ar: "هاكاثون صحة المجتمع", en: "Community Health Hackathon" },
    desc: { ar: "تحدٍّ مكثّف تتنافس فيه الفرق على حل تحدٍّ حقيقي في ٤٨ ساعة.", en: "An intensive challenge where teams compete to solve a real problem in 48 hours." } },
  { icon: 'users', accent: 'purple', title: { ar: "مجالس المبتكرين", en: "Innovator Circles" },
    desc: { ar: "لقاءات دورية لتبادل الأفكار والتغذية الراجعة بين المبتكرين.", en: "Regular meetups to exchange ideas and peer feedback among innovators." } },
  { icon: 'play', accent: 'rose', title: { ar: "ملتقى المتحدثين", en: "Speaker Series" },
    desc: { ar: "استضافة خبراء ومخترعين من داخل التجمع وخارجه.", en: "Hosting experts and inventors from inside and outside the cluster." } },
  { icon: 'shield', accent: 'gold', title: { ar: "عيادة الملكية الفكرية", en: "IP Clinic" },
    desc: { ar: "جلسات فردية سرّية لمراجعة اختراعك مع مختص قبل الإيداع.", en: "Confidential one-to-one sessions to review your invention with a specialist before filing." } },
  { icon: 'award', accent: 'mint', title: { ar: "حفل التخرّج السنوي", en: "Annual Graduation" },
    desc: { ar: "تكريم المبتكرين المتخرّجين وعرض أفضل الاختراعات.", en: "Honoring graduating innovators and showcasing the best inventions." } },
];

// ===== academy member benefits =====
const ACADEMY_PERKS = [
  { id: 'books', icon: 'book', accent: 'mint',
    title: { ar: "مكتبة كتب الابتكار", en: "Innovation book library" },
    desc: { ar: "مراجع علمية مختارة في الابتكار والتفكير التصميمي، مع ملخصات عربية يوزّعها الفريق.", en: "A curated shelf of innovation and design-thinking references with Arabic summaries shared by the team." },
    items: [
      { ar: "قائمة قراءة متدرّجة لكل مستوى", en: "A graded reading list per level" },
      { ar: "ملخّص عربي لكل كتاب في صفحة واحدة", en: "One-page Arabic summary per book" },
      { ar: "حلقة نقاش شهرية حول كتاب", en: "A monthly book discussion circle" },
    ],
    cta: { label: { ar: "استعرض المكتبة", en: "Browse the shelf" }, hash: 'acad-books' } },
  { id: 'courses', icon: 'layers', accent: 'purple',
    title: { ar: "دورات ومسارات مستمرة", en: "Continuous courses & tracks" },
    desc: { ar: "دورات داخلية أسبوعية ومسارات تدريبية متكاملة، إضافة إلى منصات عالمية مجانية موصى بها.", en: "Weekly in-house courses and full training tracks, plus recommended free global platforms." },
    items: [
      { ar: "دورات حضورية وافتراضية كل أسبوع", en: "Weekly onsite and virtual courses" },
      { ar: "أربعة مسارات تدريبية متخصصة", en: "Four specialised training tracks" },
      { ar: "ورش عملية ومعامل ابتكار", en: "Hands-on workshops and innovation labs" },
    ],
    cta: { label: { ar: "الدورات", en: "Courses" }, page: 'courses' } },
  { id: 'certs', icon: 'award', accent: 'gold',
    title: { ar: "شهادات حضور وتخرّج", en: "Attendance & graduation certificates" },
    desc: { ar: "شهادة حضور تُصدر تلقائياً بعد تسجيل الحضور، وشهادة تخرّج لكل مستوى تُعتمد بختم الأكاديمية.", en: "An attendance certificate issued automatically after check-in, and a graduation certificate per level stamped by the Academy." },
    items: [
      { ar: "شهادة PDF فورية بختم الأكاديمية", en: "Instant PDF certificate with the Academy seal" },
      { ar: "رقم شهادة فريد لكل مشارك", en: "A unique certificate number per participant" },
      { ar: "شهادة لكل مستوى في مسار التخرّج", en: "A certificate for every level on the path" },
    ] },
  { id: 'team', icon: 'users', accent: 'rose',
    title: { ar: "فريق واحد لتبادل الخبرات", en: "One team for exchanging expertise" },
    desc: { ar: "مجتمع مبتكرين من كل الإدارات: تشارك تحدياتك، تجد شريك عمل، وتتعلّم من تجارب غيرك.", en: "A community of innovators from every department: share challenges, find a partner, learn from others' experience." },
    items: [
      { ar: "مجموعة تواصل مباشرة مع الفريق", en: "A direct group chat with the team" },
      { ar: "مرشد مرافق لكل مبتكر", en: "A mentor alongside every innovator" },
      { ar: "عرض تجربتك أمام المبتكرين", en: "Present your experience to peers" },
    ],
    cta: { label: { ar: "انضم للفريق", en: "Join the team" }, hash: 'acad-team' } },
  { id: 'library', icon: 'play', accent: 'mint',
    title: { ar: "منصة مستمرة ٢٤ ساعة", en: "An always-on 24/7 platform" },
    desc: { ar: "كل دورة تُسجَّل وتُرفع مع ملفاتها لتشاهدها في أي وقت — لا تفوتك دورة بسبب الدوام.", en: "Every course is recorded and published with its files so you can watch anytime — no course missed because of a shift." },
    items: [
      { ar: "تسجيلات فيديو لكل دورة", en: "Video recordings for every course" },
      { ar: "ملفات PDF وعروض قابلة للتحميل", en: "Downloadable PDFs and decks" },
      { ar: "متاح من الجوال في أي وقت", en: "Available on mobile at any time" },
    ],
    cta: { label: { ar: "المنصة المستمرة", en: "Open the library" }, page: 'ondemand' } },
  { id: 'ip', icon: 'shield', accent: 'gold',
    title: { ar: "مرافقة في الملكية الفكرية", en: "IP guidance" },
    desc: { ar: "عيادة سرّية لمراجعة اختراعك، ومرافقة كاملة من الكشف حتى الإيداع وتسجيل البراءة.", en: "A confidential clinic to review your invention, with support from disclosure to filing." },
    items: [
      { ar: "جلسة فردية سرّية مع مختص", en: "A confidential one-to-one session" },
      { ar: "بحث حالة تقنية قبل الإيداع", en: "Prior-art search before filing" },
      { ar: "متابعة الطلب حتى المنح", en: "Application follow-up until grant" },
    ],
    cta: { label: { ar: "براءات الاختراع", en: "Patents" }, page: 'patents' } },
];

// curated science / innovation reading shelf
const INNOVATION_BOOKS = [
  { id: 'b1', group: 'core', accent: 'mint', year: 1997,
    title: { ar: "مأزق المبتكر", en: "The Innovator's Dilemma" }, en: "The Innovator's Dilemma",
    author: { ar: "كلايتون كريستنسن", en: "Clayton M. Christensen" },
    why: { ar: "يفسّر كيف تسقط المؤسسات الناجحة أمام الابتكار الهادم — مرجع أساسي لفهم لماذا يجب أن نبتكر ونحن في أفضل حال.", en: "Explains how successful organisations fall to disruptive innovation — essential for why we must innovate while we are strong." } },
  { id: 'b2', group: 'core', accent: 'purple', year: 2011,
    title: { ar: "الحمض النووي للمبتكر", en: "The Innovator's DNA" }, en: "The Innovator's DNA",
    author: { ar: "دايَر · جريجرسن · كريستنسن", en: "Dyer, Gregersen & Christensen" },
    why: { ar: "خمس مهارات قابلة للتعلّم يمارسها المبتكرون: التساؤل، الملاحظة، التشبيك، التجريب، والربط.", en: "Five learnable skills innovators practise: questioning, observing, networking, experimenting and associating." } },
  { id: 'b3', group: 'method', accent: 'gold', year: 2013,
    title: { ar: "عشرة أنماط للابتكار", en: "Ten Types of Innovation" }, en: "Ten Types of Innovation",
    author: { ar: "لاري كيلي وفريق دوبلن", en: "Larry Keeley et al." },
    why: { ar: "يوسّع مفهوم الابتكار خارج التقنية: النموذج الربحي، العملية، الشبكة، التجربة — إطار عملي لتقييم أفكارنا.", en: "Widens innovation beyond technology: profit model, process, network, experience — a practical framework to assess ideas." } },
  { id: 'b4', group: 'method', accent: 'purple', year: 2016,
    title: { ar: "سبرنت: حلّ التحديات في خمسة أيام", en: "Sprint" }, en: "Sprint: How to Solve Big Problems and Test New Ideas in Just Five Days",
    author: { ar: "جيك نَاب وزملاؤه — Google Ventures", en: "Jake Knapp et al. — Google Ventures" },
    why: { ar: "وصفة تشغيلية لورشة خمسة أيام تنتقل من التحدي إلى نموذج مُختبَر — نستخدمها في معامل الابتكار.", en: "An operational recipe for a five-day workshop from challenge to tested prototype — used in our innovation labs." } },
  { id: 'b5', group: 'method', accent: 'mint', year: 2013,
    title: { ar: "الثقة الإبداعية", en: "Creative Confidence" }, en: "Creative Confidence",
    author: { ar: "توم وديفيد كيلي — IDEO", en: "Tom & David Kelley — IDEO" },
    why: { ar: "يعالج أكبر عائق أمام المشاركة: الاعتقاد بأن الإبداع موهبة لا مهارة. مناسب لمن يقدّم فكرته الأولى.", en: "Tackles the biggest barrier to participation: believing creativity is a talent, not a skill. Ideal for a first idea." } },
  { id: 'b6', group: 'core', accent: 'rose', year: 2011,
    title: { ar: "الشركة الناشئة الرشيقة", en: "The Lean Startup" }, en: "The Lean Startup",
    author: { ar: "إريك ريس", en: "Eric Ries" },
    why: { ar: "منهجية بناء–قياس–تعلّم لاختبار الفكرة بأقل تكلفة قبل التوسّع — أساس مرحلة النموذج الأولي عندنا.", en: "Build–measure–learn for testing an idea cheaply before scaling — the basis of our prototype stage." } },
  { id: 'b7', group: 'core', accent: 'gold', year: 2005,
    title: { ar: "استراتيجية المحيط الأزرق", en: "Blue Ocean Strategy" }, en: "Blue Ocean Strategy",
    author: { ar: "كيم وموبورن", en: "W. Chan Kim & Renée Mauborgne" },
    why: { ar: "كيف تُخلق قيمة جديدة بدل المنافسة على نفس المساحة — أداة تفكير لتصميم خدمات صحية مختلفة.", en: "How to create new value instead of competing in the same space — a thinking tool for differentiated health services." } },
  { id: 'b8', group: 'health', accent: 'purple', year: 2009,
    title: { ar: "وصفة الرعاية الصحية المبتكرة", en: "The Innovator's Prescription" }, en: "The Innovator's Prescription: A Disruptive Solution for Health Care",
    author: { ar: "كريستنسن · جروسمان · هوانج", en: "Christensen, Grossman & Hwang" },
    why: { ar: "تطبيق نظرية الابتكار الهادم على القطاع الصحي تحديداً: نماذج التشغيل، التكلفة، ومسارات الرعاية.", en: "Applies disruptive-innovation theory to health care: operating models, cost, and care pathways." } },
  { id: 'b9', group: 'health', accent: 'mint', year: 2009,
    title: { ar: "دليل قائمة التحقق", en: "The Checklist Manifesto" }, en: "The Checklist Manifesto",
    author: { ar: "أتول جواندي", en: "Atul Gawande" },
    why: { ar: "كيف يحقّق تحسين بسيط أثراً هائلاً في سلامة المرضى — دليل أن الابتكار لا يشترط التقنية.", en: "How a simple improvement creates huge patient-safety impact — proof innovation needn't be technological." } },
];

// rituals of the innovators team (exchange of expertise)
const TEAM_RITUALS = [
  { icon: 'users', title: { ar: "مجلس المبتكرين — كل أسبوعين", en: "Innovator circle — biweekly" },
    desc: { ar: "جلسة مفتوحة يعرض فيها عضوان تجربتهما ويستقبلان التغذية الراجعة.", en: "An open session where two members present their experience and receive feedback." } },
  { icon: 'target', title: { ar: "بنك التحديات المشترك", en: "Shared challenge bank" },
    desc: { ar: "تحديات الإدارات معروضة للفريق ليتبنّاها من يملك الحل.", en: "Department challenges posted for whoever holds the solution to adopt." } },
  { icon: 'spark', title: { ar: "شريك ابتكار", en: "Innovation buddy" },
    desc: { ar: "نربط كل مبتكر جديد بمبتكر متمرّس من إدارة أخرى.", en: "Every new innovator is paired with an experienced one from another department." } },
  { icon: 'play', title: { ar: "مكتبة خبرات مسجّلة", en: "Recorded experience library" },
    desc: { ar: "كل عرض ودورة تُسجَّل وتبقى متاحة للفريق في أي وقت.", en: "Every talk and course is recorded and stays available to the team anytime." } },
];

// ----- store: editable content persisted in localStorage -----
const STORE_KEY = 'ibtikar_store_v6';

// site owners — only these two can open the control panel
const OWNERS = [
  { id: 'amro',   name: { ar: 'د. عمرو كامل', en: 'Dr. Amr Kamel' },       user: 'drmedahmed@gmail.com',        pass: 'Missnanci2004#' },
  { id: 'kholoud', name: { ar: 'خلود دغريري', en: 'Khulood Daghariri' }, user: 'khulooddaghariri@gmail.com', pass: 'Missnanci2004#' },
];

function loadStore() {
  try {
    const raw = localStorage.getItem(STORE_KEY);
    if (raw) {
      const saved = JSON.parse(raw);
      const merged = { ...structuredClone(SEED), ...saved };
      // ensure vault always has the right shape
      merged.submissions = { ideas: [], patents: [], ...(saved.submissions || {}) };
      merged.vault = saved.vault || {};
      merged.vaultLog = saved.vaultLog || [];
      merged.enrollments = saved.enrollments || [];
      // legacy: courses saved as 'current' are now simply upcoming
      merged.courses = (merged.courses || []).map(c => ((c.term || 'upcoming') === 'current' ? { ...c, term: 'upcoming' } : c));
      return merged;
    }
  } catch (e) {}
  return structuredClone(SEED);
}

function useStore() {
  const [data, setData] = React.useState(loadStore);
  const save = React.useCallback((next) => {
    setData(next);
    try { localStorage.setItem(STORE_KEY, JSON.stringify(next)); } catch (e) {}
  }, []);
  const reset = React.useCallback(() => {
    // keep the sealed innovation vault — resetting content must never destroy IP records
    let keep = { vault: {}, vaultLog: [] };
    try { const raw = JSON.parse(localStorage.getItem(STORE_KEY) || '{}'); keep = { vault: raw.vault || {}, vaultLog: raw.vaultLog || [] }; } catch (e) {}
    const fresh = { ...structuredClone(SEED), ...keep };
    try { localStorage.setItem(STORE_KEY, JSON.stringify(fresh)); } catch (e) {}
    setData(fresh);
  }, []);
  // store / update a vault seal for a disclosure ref
  const putSeal = React.useCallback((ref, seal) => {
    setData((cur) => {
      const next = structuredClone(cur);
      next.vault = { ...(next.vault || {}) };
      next.vault[ref] = seal;
      try { localStorage.setItem(STORE_KEY, JSON.stringify(next)); } catch (e) {}
      return next;
    });
  }, []);
  // append a submission to the vault (ideas | patents) — returns the saved record
  const addSubmission = React.useCallback((kind, record) => {
    let saved = null;
    setData((cur) => {
      const next = structuredClone(cur);
      if (!next.submissions) next.submissions = { ideas: [], patents: [] };
      if (!next.submissions[kind]) next.submissions[kind] = [];
      saved = { ...record, id: record.ref, savedAt: Date.now() };
      next.submissions[kind].unshift(saved);
      try { localStorage.setItem(STORE_KEY, JSON.stringify(next)); } catch (e) {}
      return next;
    });
    // best-effort cloud sync (Supabase) — never blocks the UI
    try { if (window.cloudInsert && window.cloudReady && window.cloudReady()) window.cloudInsert(saved); } catch (e) {}
    return saved;
  }, []);
  // append a course registration (and best-effort cloud sync)
  const addEnrollment = React.useCallback((rec) => {
    setData((cur) => {
      const next = structuredClone(cur);
      if (!next.enrollments) next.enrollments = [];
      next.enrollments.unshift(rec);
      try { localStorage.setItem(STORE_KEY, JSON.stringify(next)); } catch (e) {}
      return next;
    });
    try { if (window.cloudInsert && window.cloudReady && window.cloudReady()) window.cloudInsert({ ...rec, kind: 'enrollment', ref: rec.id, title: (rec.courseTitle && rec.courseTitle.ar) || '' }); } catch (e) {}
    return rec;
  }, []);
  return { data, save, reset, addSubmission, addEnrollment, putSeal };
}

Object.assign(window, {
  SEED, OWNERS, COURSE_CATS, IDEA_CATS, PATENT_STAGES, GALLERY,
  AI_TRACKS, AI_GLOSSARY, AI_TIP, AI_QUIZ, useStore,
  LEADER_QUOTES, INNOVATION_ARTICLES, GLOBAL_SOURCES,
  LEARN_PLATFORMS, LEARN_CHANNELS, INNOVATION_TERMS, TERM_GROUPS,
  ACADEMY_LEVELS, ACADEMY_PILLARS, ACADEMY_PROGRAMS, ACADEMY_ACTIVITIES,
  IE_PRINCIPLES, IE_MODULES, IE_WORKSHOPS, IE_BOOKS, IE_STAGES,
  ACADEMY_PERKS, INNOVATION_BOOKS, TEAM_RITUALS,
});
