<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

/**
 * InPractice — Marketing Generic Cases [08/10]
 * Content & Social Media: MG-CS-04, MG-CS-05, MG-CS-06
 * Customer Acquisition & Retention: MG-CAR-01, MG-CAR-02
 *
 * Run: php artisan db:seed --class=MarketingGenericCaseSeeder_08
 */
class MarketingGenericCaseSeeder_08 extends Seeder
{
    public function run(): void
    {
        $this->command->info('📢 [08/10] Content & Social (4-6) + Customer Acquisition (1-2) ...');

        $hub   = DB::table('hubs')->where('slug', 'marketing')->first();
        $admin = DB::table('users')->where('role', 'admin')->first();

        if (! $hub || ! $admin) {
            $this->command->error('Hub or admin not found. Run HubSeeder and AdminSeeder first.');
            return;
        }

        $hubId   = $hub->id;
        $adminId = $admin->id;
        $now     = now();


        $cases = [

        // ── MG-CS-04 ──────────────────────────────────────────────────
    [
        'hub_id'        => $hubId,
        'created_by'    => $adminId,
        'topic_slug'    => 'content_social_media',
        'topic_name_en' => 'Content & Social Media',
        'topic_name_ar' => 'المحتوى ووسائل التواصل الاجتماعي',
        'layer'         => 'generic',
        'difficulty'    => 'intermediate',
        'status'        => 'published',
        'published_at'  => $now,
        'sort_order'    => 604,
        'read_time_minutes' => 12,

        'title_en'    => 'The LinkedIn Page Nobody Visits',
        'subtitle_en' => 'Building a B2B content strategy that generates real business leads',
        'situation_en' => "You are a marketing executive at **Horizon Engineering Consultants**, a Cairo-based firm providing structural engineering, project management, and technical advisory to real estate developers and construction companies.\n\nThe company has a LinkedIn page with 2,800 followers. It posts 2–3 times per week — mostly: project completion photos, 'Congratulations to our team on [project name]', and company anniversary posts.\n\nEngagement: near zero. Follower growth: 3–5 per week. New client enquiries from LinkedIn: zero in 12 months.\n\nThe MD's son (a recent MBA graduate hired as 'strategy advisor') says the company needs to 'go viral on LinkedIn.' The MD asks you for a realistic assessment and a strategy that actually generates leads for the business.",
        'challenge_questions_en' => json_encode([
            "Why do project completion photos and congratulatory posts get near-zero engagement — even though they are professionally presented?",
            "What does a B2B engineering firm's actual target audience on LinkedIn want to read — and how is that different from what Horizon is currently posting?",
            "Explain why 'going viral on LinkedIn' is the wrong objective for a B2B professional services firm, and what the right objective is.",
            "Design a 90-day LinkedIn content strategy for Horizon Engineering that is realistic to execute and directly connected to generating qualified leads.",
        ]),
        'solution_en' => "## LinkedIn for B2B Professional Services: The Right Game\n\n### Why Project Completions Get Zero Engagement\n\nProject completion posts communicate: *'Look what we did.'* The reader — a real estate developer or construction director — thinks: *'Good for them. Why does this help me?'*\n\nB2B LinkedIn content fails when it is about the company. It succeeds when it is about the reader's problems, decisions, and professional growth.\n\n### What Horizon's Target Audience Actually Wants\n\nA real estate developer or construction director on LinkedIn is thinking about:\n- How to avoid structural problems that delay projects\n- How to evaluate engineering firms before hiring one\n- Industry regulatory changes that affect their projects\n- How peers are solving problems they also face\n- Learning something that makes them look smart to their boss\n\nNone of Horizon's current content addresses any of these. It addresses Horizon's internal pride — which has zero value to the reader.\n\n### The Right Objective: Thought Leadership, Not Virality\n\nFor a B2B engineering firm, the LinkedIn goal is not likes or shares. It is:\n> *'When a real estate developer in Egypt needs an engineering consultant, Horizon Engineering should be the name that comes to mind first — because they have been consistently sharing insights I value.'*\n\nThis is called **top-of-mind positioning through consistent thought leadership**. It does not go viral. It builds trust, one informed post at a time, with the exact right audience.\n\n### 90-Day LinkedIn Content Strategy\n\n**Content Pillars (4 types, rotating):**\n\n**Pillar 1 — Educational insight (40% of posts)**\nShort explanatory posts about technical topics in plain language:\n- *'The 3 structural decisions developers get wrong in high-rise projects — and how to avoid them'*\n- *'What Egypt's updated building code means for projects starting in 2025'*\n- *'Why soil testing in New Cairo is different from traditional Cairo — and why it matters for your foundation cost'*\n\n**Pillar 2 — Case insight (25% of posts)**\nNot 'we completed X project.' Instead: 'On a recent project, we faced [problem]. Here is how we solved it and what developers can learn.'\n\n**Pillar 3 — Industry perspective (20% of posts)**\nOpinions on trends, regulations, and market conditions:\n- *'The Fourth Industrial Revolution will change structural engineering. Here is how we are preparing.'*\n- *'Why Egypt's construction boom needs more investment in project management, not just design.'*\n\n**Pillar 4 — Social proof and team (15% of posts)**\nProject completions — but reframed as 'what we learned' or 'what made this project complex and how we handled it.'\n\n**Execution (realistic for a busy firm):**\n- 3 posts per week: 2 educational + 1 case/perspective\n- Written by the MD or senior engineers — not an agency. Authenticity matters on LinkedIn.\n- Each post ends with a question or CTA: *'What has been your experience with foundation challenges in sandy soil?'*\n\n**Lead Generation Mechanism:**\nAdd a clear CTA in bio and in 20% of posts: *'If you are planning a project in Greater Cairo, download our free guide: 5 Questions to Ask Before Hiring a Structural Engineer.'* Gate it with an email form. Every download is a qualified lead.",

        'bigger_lesson_en' => "**On LinkedIn, the companies that win are the ones that make their audience smarter, not the ones that make themselves look bigger.**\n\nB2B purchasing decisions are made by people who trust the expertise of the firm they hire. The fastest way to build that trust at scale is to consistently demonstrate that expertise in public — not by showing off finished projects, but by teaching the people who need to hire you.",

        'skills_taught_en' => json_encode([
            'B2B LinkedIn content strategy',
            'Thought leadership vs. corporate updates',
            'Lead generation through content',
            'Professional services marketing',
            'Content pillar framework for B2B',
        ]),

        'title_ar'    => 'صفحة لينكدإن التي لا يزورها أحد',
        'subtitle_ar' => 'بناء استراتيجية محتوى B2B تولّد عملاء محتملين حقيقيين',
        'situation_ar' => "أنت مسؤول تسويق في **هورايزون للاستشارات الهندسية**، شركة قاهرية تقدم الهندسة الإنشائية وإدارة المشاريع للمطورين العقاريين وشركات الإنشاء.\n\nللشركة صفحة لينكدإن بـ2,800 متابع. تنشر 2-3 مرات أسبوعياً — معظمها: صور إتمام مشاريع، 'تهانينا لفريقنا على [اسم المشروع]'، منشورات الذكرى السنوية.\n\nالتفاعل: شبه صفر. استفسارات عملاء جديدة من لينكدإن: صفر في 12 شهراً.",
        'challenge_questions_ar' => json_encode([
            "لماذا تحصل صور إتمام المشاريع والمنشورات التهنيئية على تفاعل شبه صفري؟",
            "ماذا يريد جمهور شركة هندسة B2B الفعلي على لينكدإن أن يقرأ — وكيف يختلف عما تنشره هورايزون؟",
            "اشرح لماذا 'الانتشار على لينكدإن' هو الهدف الخاطئ لشركة خدمات مهنية B2B، وما الهدف الصحيح.",
            "صمم استراتيجية محتوى لينكدإن لـ90 يوماً لهورايزون واقعية التنفيذ ومرتبطة مباشرةً بتوليد عملاء محتملين.",
        ]),
        'solution_ar' => "## لينكدإن للخدمات المهنية B2B: اللعبة الصحيحة\n\n### لماذا منشورات إتمام المشاريع لا تُشرك أحداً\n\nمنشورات إتمام المشاريع تقول: *'انظروا ما فعلناه.'* القارئ — مطور عقاري — يفكر: *'جيد لهم. لكن كيف يفيدني هذا؟'*\n\nمحتوى B2B ينجح حين يتعلق بمشاكل القارئ وقراراته ونموه المهني.\n\n### أعمدة المحتوى الأربعة لهورايزون\n\n| العمود | % المحتوى | مثال |\n|---|---|---|\n| رؤية تعليمية | 40% | 'الأخطاء الثلاثة التي يقع فيها المطورون في مشاريع الأبراج' |\n| رؤية الحالات | 25% | 'في مشروع حديث واجهنا [مشكلة]. إليك كيف حللناها' |\n| منظور صناعي | 20% | آراء حول الاتجاهات والتشريعات |\n| إثبات اجتماعي وفريق | 15% | مشاريع مُعاد صياغتها كـ'ما تعلمناه' |\n\n**آلية توليد العملاء:**\nإضافة CTA واضحة: *'إذا كنت تخطط لمشروع في القاهرة الكبرى، حمّل دليلنا المجاني: 5 أسئلة تطرحها قبل توظيف مهندس إنشائي.'* البريد الإلكتروني مطلوب للتحميل — كل تحميل عميل محتمل مؤهَّل.",

        'bigger_lesson_ar' => "**على لينكدإن، الشركات الرابحة هي التي تجعل جمهورها أكثر ذكاءً، لا تلك التي تجعل نفسها تبدو أكبر.**\n\nقرارات الشراء B2B تتخذها أشخاص يثقون في خبرة الشركة التي يوظفونها. أسرع طريقة لبناء تلك الثقة على نطاق واسع هي إثبات تلك الخبرة علناً — لا بعرض المشاريع المنتهية، بل بتعليم الأشخاص الذين يحتاجون توظيفك.",

        'skills_taught_ar' => json_encode([
            'استراتيجية محتوى لينكدإن للـB2B',
            'قيادة الفكر مقابل التحديثات المؤسسية',
            'توليد العملاء من خلال المحتوى',
            'تسويق الخدمات المهنية',
            'إطار أعمدة المحتوى للـB2B',
        ]),
        'created_at' => $now,
        'updated_at' => $now,
    ],

        // ── MG-CS-05 ──────────────────────────────────────────────────
    [
        'hub_id'        => $hubId,
        'created_by'    => $adminId,
        'topic_slug'    => 'content_social_media',
        'topic_name_en' => 'Content & Social Media',
        'topic_name_ar' => 'المحتوى ووسائل التواصل الاجتماعي',
        'layer'         => 'generic',
        'difficulty'    => 'advanced',
        'status'        => 'published',
        'published_at'  => $now,
        'sort_order'    => 605,
        'read_time_minutes' => 14,

        'title_en'    => 'The Content Strategy That Could Not Scale',
        'subtitle_en' => 'Building a content production system that does not collapse under growth',
        'situation_en' => "You are the head of content at **FinanClear**, an Egyptian fintech company offering accounting software for SMEs. The company has 28,000 LinkedIn followers, 19,000 Instagram followers, and publishes a weekly email newsletter to 14,000 subscribers.\n\nFor the first two years, content was managed by one person — a talented content creator who wrote all posts, designed all visuals, and sent all emails. The results were excellent: 28% email open rate, consistent follower growth, strong engagement.\n\nThat person just resigned. You have been asked to rebuild the content function — and to build it in a way that does not collapse when individuals leave, scales as the company grows, and maintains the quality that drove the results.\n\nThe CEO also wants to add TikTok and YouTube to the mix in the next 6 months. The budget for content has tripled.",
        'challenge_questions_en' => json_encode([
            "What was the structural risk of having one person managing all content — and what specific problems will you face now that they have left?",
            "What is a 'content system' vs. a 'content person' — and what does a scalable content system look like for FinanClear?",
            "The CEO wants to add TikTok and YouTube. Before agreeing to expand, what questions must you answer about channel fit, audience overlap, and production capacity?",
            "Design a content team structure and production workflow that can sustain quality output across 4 channels with a tripled budget but changing personnel.",
        ]),
        'solution_en' => "## Content at Scale: Systems Over Superstars\n\n### The Single-Person Risk\n\nWhen one talented person runs all content, three things happen:\n1. **Quality depends on one brain** — their voice, their taste, their understanding of the brand becomes the brand. When they leave, the voice goes with them.\n2. **No documentation exists** — their process lives in their head. The brand guidelines, content calendar logic, and audience insights are institutional knowledge no one else has.\n3. **No redundancy** — one sick day = no content. One resignation = content collapse.\n\n### Content System vs. Content Person\n\n| Content Person | Content System |\n|---|---|\n| Knowledge in one person's head | Knowledge in documented systems |\n| Quality varies by mood/bandwidth | Quality consistent by process |\n| Exits and takes everything | Exits and the system runs |\n| Scales with their energy | Scales with budget and team |\n\nA **content system** has four components: Strategy (what we say and why), Brand Voice Guide (how we say it), Production Workflow (who does what by when), and a Content Library (templates, approved visuals, topic bank).\n\n### Channel Expansion: Questions Before Yes\n\nBefore adding TikTok and YouTube:\n\n**1. Is the target audience there?**\nFinanClear targets SME owners and accountants. LinkedIn and Email work because that audience is professional and active there. TikTok's primary Egyptian audience is 16–25 with entertainment intent. Are SME owners on TikTok in Egypt — in a work mindset?\n\n**2. What content format does each channel require?**\n- TikTok: short-form video (15–60 sec), entertainment-first, trend-responsive\n- YouTube: long-form video (8–20 min), educational, high production value\nBoth require video production capability FinanClear does not currently have. Budget tripling alone does not create video expertise.\n\n**3. What is the opportunity cost?**\nEvery pound spent on TikTok is a pound not optimising LinkedIn and Email — which are already working. Adding two channels without scaling existing channels risks degrading everything.\n\n**Recommendation:** Add YouTube first (long-form educational content for accountants — high fit, leverages existing written content expertise). TikTok in Month 9–12 after the team is stable.\n\n### Content Team Structure and Workflow\n\n**Recommended team (with tripled budget):**\n\n| Role | Responsibility | Type |\n|---|---|---|\n| Content Strategist (you) | Strategy, calendar, quality review | Full-time |\n| Senior Content Writer | Long-form posts, newsletter, LinkedIn | Full-time |\n| Visual Designer | Templates, infographics, video thumbnails | Full-time |\n| Video Producer | YouTube, eventually TikTok | Full-time or agency |\n| Freelance Proofreader | Arabic language quality | Per-project |\n\n**Production Workflow (monthly cycle):**\n\nWeek 1: Strategy meeting — agree monthly themes, key messages, promotional calendar\nWeek 2–3: Production — writer drafts, designer creates visuals, review cycle\nWeek 4: Scheduled publishing for following month — 100% of content approved before month begins\n\n**The Brand Voice Document (most important deliverable this month):**\nBefore doing anything else, interview the departing team member for 4 hours. Document: the tone of voice, the writing principles, the topics that resonated, the content that did not work. This is the institutional knowledge — capture it before it walks out the door.",

        'bigger_lesson_en' => "**The best content teams are systems that talented people plug into — not talented people who are the system.**\n\nA documented brand voice, a structured production workflow, and a content library turn individual talent into institutional capability. Great content managers spend most of their time building systems, not producing content.",

        'skills_taught_en' => json_encode([
            'Content system design and documentation',
            'Content team structure and scaling',
            'Channel expansion decision framework',
            'Brand voice documentation',
            'Content production workflow management',
        ]),

        'title_ar'    => 'استراتيجية المحتوى التي لم تستطع التوسع',
        'subtitle_ar' => 'بناء نظام إنتاج محتوى لا ينهار تحت النمو',
        'situation_ar' => "أنت رئيس المحتوى في **فيناكلير**، شركة فينتك مصرية تقدم برنامج محاسبة للشركات الصغيرة. للشركة 28,000 متابع على لينكدإن و14,000 مشترك في النشرة الأسبوعية.\n\nلعامين كان المحتوى يُدار من شخص واحد — مبدع موهوب كتب كل المنشورات وصمم كل المرئيات وأرسل كل الرسائل. النتائج كانت ممتازة: 28% معدل فتح للبريد.\n\nهذا الشخص استقال للتو. طُلب منك إعادة بناء وظيفة المحتوى بطريقة لا تنهار حين يغادر الأفراد وتتوسع مع نمو الشركة.",
        'challenge_questions_ar' => json_encode([
            "ما الخطر الهيكلي لإسناد كل المحتوى لشخص واحد — وما المشاكل المحددة التي ستواجهها الآن؟",
            "ما الفرق بين 'نظام محتوى' و'شخص محتوى' — وكيف يبدو نظام محتوى قابل للتوسع؟",
            "الرئيس التنفيذي يريد إضافة تيك توك ويوتيوب. قبل الموافقة، ما الأسئلة التي يجب الإجابة عليها؟",
            "صمم هيكل فريق محتوى وسير عمل إنتاج يحافظ على جودة الإخراج عبر 4 قنوات.",
        ]),
        'solution_ar' => "## المحتوى على نطاق واسع: الأنظمة فوق النجوم\n\n### نظام المحتوى مقابل شخص المحتوى\n\n**نظام المحتوى** له أربعة مكونات: الاستراتيجية، دليل صوت العلامة، سير عمل الإنتاج، ومكتبة المحتوى.\n\n### التوسع في القنوات: أسئلة قبل الموافقة\n\n- هل الجمهور المستهدف موجود هناك؟ (أصحاب الشركات الصغيرة ومحاسبون = لينكدإن ✓، تيك توك؟)\n- ما صيغة المحتوى المطلوبة وهل لدينا القدرة؟\n- ما تكلفة الفرصة البديلة؟\n\n**توصية:** ابدأ بيوتيوب (محتوى تعليمي طويل). تيك توك في الشهر 9-12.\n\n### هيكل الفريق\n\n| الدور | المسؤولية |\n|---|---|\n| استراتيجي المحتوى | الاستراتيجية والتقويم والمراجعة |\n| كاتب محتوى أول | المنشورات الطويلة، النشرة، لينكدإن |\n| مصمم بصري | القوالب والإنفوغرافيك |\n| منتج فيديو | يوتيوب وتيك توك |",

        'bigger_lesson_ar' => "**أفضل فرق المحتوى أنظمة يتدخل فيها المواهب — لا مواهب هم الأنظمة.**\n\ndليل صوت العلامة الموثَّق وسير عمل الإنتاج المنظَّم ومكتبة المحتوى تحوّل المواهب الفردية إلى قدرة مؤسسية.",

        'skills_taught_ar' => json_encode([
            'تصميم نظام المحتوى وتوثيقه',
            'هيكل فريق المحتوى وتوسيعه',
            'إطار قرار توسع القنوات',
            'توثيق صوت العلامة',
            'إدارة سير عمل إنتاج المحتوى',
        ]),
        'created_at' => $now,
        'updated_at' => $now,
    ],

        // ── MG-CS-06 ──────────────────────────────────────────────────
    [
        'hub_id'        => $hubId,
        'created_by'    => $adminId,
        'topic_slug'    => 'content_social_media',
        'topic_name_en' => 'Content & Social Media',
        'topic_name_ar' => 'المحتوى ووسائل التواصل الاجتماعي',
        'layer'         => 'generic',
        'difficulty'    => 'advanced',
        'status'        => 'published',
        'published_at'  => $now,
        'sort_order'    => 606,
        'read_time_minutes' => 13,

        'title_en'    => 'The Arabic Content Problem',
        'subtitle_en' => 'Why translating English content into Arabic is not a bilingual strategy',
        'situation_en' => "You are the head of marketing at **Nexus HR Solutions**, an Egyptian HR tech company offering payroll, HR management, and employee benefits platforms. The company operates in Egypt and has recently expanded to Saudi Arabia and the UAE.\n\nThe company has been running bilingual content: English content is produced first by a specialist writer, then translated into Arabic by a translator. The Arabic content is posted on separate social media accounts and in a separate Arabic newsletter.\n\nArabic social metrics are consistently weaker than English:\n\n| Metric | English | Arabic |\n|---|---|---|\n| LinkedIn followers | 8,400 | 2,100 |\n| Email open rate | 31% | 14% |\n| Post engagement rate | 4.2% | 1.1% |\n| Lead generation (attributed) | 67% of leads | 33% of leads |\n\nYet 70% of the GCC market communicates primarily in Arabic, and Egypt's mid-market HR buyers overwhelmingly prefer Arabic-language communications.\n\nThe CEO says the Arabic content is 'underperforming' and asks what is wrong.",
        'challenge_questions_en' => json_encode([
            "Translation vs. native writing — what is the fundamental difference in quality and what does a non-Arabic speaker fail to notice about translated content?",
            "A 31% English open rate vs. 14% Arabic open rate for the same company. List four specific reasons the Arabic content may be structurally weaker.",
            "The GCC B2B market has distinct Arabic communication norms — formal vs. colloquial, Modern Standard Arabic vs. Gulf dialect vs. Egyptian Arabic. How should Nexus navigate this complexity?",
            "Design a native Arabic content strategy for Nexus that treats Arabic content as a first-class product — not a translated afterthought.",
        ]),
        'solution_en' => "## The Translation Trap: Why Arabic Content Deserves Its Own Strategy\n\n### Translation vs. Native Writing\n\nTranslation takes an idea written for one language and renders it in another. Native writing starts with the language, the culture, and the audience — and creates the idea in that context from the beginning.\n\nThe quality difference is audible to any native Arabic speaker:\n- Translated business content often has awkward word order (following English sentence structure)\n- Idioms translated literally become nonsensical or cold\n- The register (formal/informal, familiar/respectful) is often wrong\n- Cultural references and examples are foreign — the English content references UK or US market examples; the Arabic translation uses the same examples, which feel distant to a Saudi or Egyptian reader\n\n**A non-Arabic speaker reviewing translated Arabic content cannot detect these problems.** The CEO sees Arabic words and assumes it is good Arabic. Native readers know within two sentences.\n\n### Why the Arabic Metrics Are Weaker (Structural Reasons)\n\n1. **Translated subject lines** — Email subject lines in Arabic need to use the rhythm and hook patterns of Arabic, not translated English. 'Discover how to manage your payroll more efficiently' translates awkwardly; a native Arabic writer would write: 'كيف توفر 3 ساعات أسبوعياً في الرواتب' (How to save 3 hours a week on payroll).\n\n2. **Wrong register for the market** — Saudi and UAE B2B communications typically use formal Modern Standard Arabic. Egyptian market is more comfortable with a blend of MSA and approachable language. A single translated Arabic newsletter serves both markets poorly.\n\n3. **Foreign examples and context** — HR content that references 'UK employment law changes' or 'Silicon Valley startup culture' does not resonate with an HR manager in Riyadh or Cairo. Native content references KSA labour regulations, Egyptian social insurance, GCC-specific challenges.\n\n4. **Posting time and format** — If Arabic posts are scheduled at the same time as English posts, they may miss the peak engagement windows for GCC audiences (which differ from Egyptian and international norms).\n\n### A Native Arabic Content Strategy for Nexus\n\n**Step 1 — Hire native Arabic content professionals (not translators)**\nThe distinction is critical. Nexus needs an Arabic HR content writer who understands the subject matter, the regional business culture, and the language. This person creates Arabic content independently — not as a translation output.\n\n**Step 2 — Market-specific voices**\n- Egypt: Arabic content with Egyptian professional tone — relatable, practical, uses Egyptian business examples\n- KSA/UAE: Formal MSA, references Saudi/UAE labour law, uses Gulf examples\nThis may require separate writers or very skilled bilingual HR specialists.\n\n**Step 3 — Content topics native to the Arabic market**\nNot: translate the English topic list.\nInstead: what are the unique HR challenges in Egypt's labour market? What does the Saudi Vision 2030 mean for HR managers? What are the most common social insurance mistakes Egyptian companies make?\n\n**Step 4 — Native Arabic SEO**\nArabic search terms are not translations of English search terms. 'HR software Egypt' in Arabic is not how Egyptian HR managers search. A native Arabic SEO strategy identifies the actual search terms used in Arabic.\n\n**Step 5 — Measure Arabic separately, not by comparison to English**\nArabic LinkedIn is a less mature professional content market than English LinkedIn. Benchmarking Arabic against English metrics is unfair. Use Arabic-specific industry benchmarks.",

        'bigger_lesson_en' => "**Bilingual marketing is not translating English into Arabic. It is telling your story twice — in two languages, for two cultures, with the same quality commitment in both.**\n\nArabic-speaking professionals can tell within the first sentence whether content was written for them or written in English and translated for them. The former builds trust. The latter signals that the Arabic market is an afterthought.",

        'skills_taught_en' => json_encode([
            'Native vs. translated content strategy',
            'Bilingual marketing for GCC and Egypt',
            'Arabic B2B content production',
            'Market-specific content localisation',
            'Multilingual content performance analysis',
        ]),

        'title_ar'    => 'مشكلة المحتوى العربي',
        'subtitle_ar' => 'لماذا ترجمة المحتوى الإنجليزي للعربية ليست استراتيجية ثنائية اللغة',
        'situation_ar' => "أنت رئيس التسويق في **نكسس لحلول الموارد البشرية**، شركة مصرية لتقنية HR تقدم رواتب وإدارة موارد بشرية. تعمل في مصر وتوسعت مؤخراً للسعودية والإمارات.\n\nالشركة تنتج المحتوى الإنجليزي أولاً ثم يُترجَم للعربية. المقاييس العربية أضعف باستمرار:\n\n| المقياس | الإنجليزية | العربية |\n|---|---|---|\n| معدل فتح البريد | 31% | 14% |\n| معدل تفاعل المنشورات | 4.2% | 1.1% |\n| توليد العملاء المحتملين | 67% | 33% |\n\nمع أن 70% من سوق دول الخليج يتواصل بشكل أساسي بالعربية.",
        'challenge_questions_ar' => json_encode([
            "الترجمة مقابل الكتابة الأصلية — ما الفرق الجوهري في الجودة وما الذي يفشل غير الناطق بالعربية في ملاحظته في المحتوى المترجم؟",
            "معدل فتح 31% بالإنجليزية مقابل 14% بالعربية لنفس الشركة. أدرج أربعة أسباب محددة قد يكون فيها المحتوى العربي هيكلياً أضعف.",
            "سوق B2B الخليجي له أعراف تواصل عربية مميزة. كيف تتعامل نكسس مع هذا التعقيد؟",
            "صمم استراتيجية محتوى عربي أصلي لنكسس تعامل المحتوى العربي كمنتج درجة أولى لا كترجمة لاحقة.",
        ]),
        'solution_ar' => "## فخ الترجمة: لماذا يستحق المحتوى العربي استراتيجيته الخاصة\n\n### الترجمة مقابل الكتابة الأصلية\n\nالمحتوى التجاري المترجَم غالباً ما يكون:\n- ترتيب كلمات محرج (يتبع تركيب الجملة الإنجليزية)\n- تعابير اصطلاحية مترجمة حرفياً تصبح بلا معنى\n- لهجة رسمية/غير رسمية خاطئة\n- أمثلة وسياق أجنبي — المحتوى الإنجليزي يستشهد بأمثلة أمريكية/بريطانية؛ الترجمة تستخدم نفس الأمثلة التي تبدو بعيدة للقارئ السعودي أو المصري\n\n### استراتيجية المحتوى العربي الأصلي لنكسس\n\n1. **توظيف كتّاب محتوى عربي أصليين** (لا مترجمين)\n2. **أصوات خاصة بكل سوق** — مصر: لهجة مهنية مصرية؛ السعودية/الإمارات: فصحى رسمية\n3. **موضوعات أصلية للسوق العربي** — تحديات سوق العمل المصري، رؤية السعودية 2030 للـHR\n4. **SEO عربي أصلي** — مصطلحات البحث العربية ليست ترجمة للإنجليزية\n5. **قياس العربية بمعايير عربية** — ليس مقارنةً بالإنجليزية",

        'bigger_lesson_ar' => "**التسويق ثنائي اللغة ليس ترجمة الإنجليزية للعربية. بل رواية قصتك مرتين — بلغتين، لثقافتين، بنفس الالتزام بالجودة في كلتيهما.**\n\nالمهنيون الناطقون بالعربية يعرفون من الجملة الأولى إذا كان المحتوى كُتب لهم أو كُتب بالإنجليزية وتُرجم لهم. الأول يبني ثقة. الثاني يُشير إلى أن السوق العربي فكرة لاحقة.",

        'skills_taught_ar' => json_encode([
            'استراتيجية المحتوى الأصلي مقابل المترجَم',
            'التسويق ثنائي اللغة لدول الخليج ومصر',
            'إنتاج محتوى B2B بالعربية',
            'توطين المحتوى للأسواق المختلفة',
            'تحليل أداء المحتوى متعدد اللغات',
        ]),
        'created_at' => $now,
        'updated_at' => $now,
    ],

    // ══════════════════════════════════════════════════════════════
    //  TOPIC 7 — CUSTOMER ACQUISITION & RETENTION (MG-CAR-01 to 06)
    // ══════════════════════════════════════════════════════════════,

        // ── MG-CAR-01 ─────────────────────────────────────────────────
    [
        'hub_id'        => $hubId,
        'created_by'    => $adminId,
        'topic_slug'    => 'customer_acquisition_retention',
        'topic_name_en' => 'Customer Acquisition & Retention',
        'topic_name_ar' => 'استقطاب العملاء والاحتفاظ بهم',
        'layer'         => 'generic',
        'difficulty'    => 'beginner',
        'status'        => 'published',
        'published_at'  => $now,
        'sort_order'    => 701,
        'read_time_minutes' => 10,

        'title_en'    => 'The Loyalty Programme Nobody Uses',
        'subtitle_en' => 'Why most loyalty programmes fail — and what separates the ones that work',
        'situation_en' => "You are a marketing executive at **Delta Pharmacies**, a chain of 34 pharmacies across Cairo and Giza. Two years ago, the company launched a loyalty card programme: customers earn 1 point per EGP 10 spent, and can redeem 100 points for a EGP 5 discount.\n\nTwo years in:\n- 89,000 loyalty cards issued\n- Active users (used in last 90 days): 7,400 (8.3% of card holders)\n- Average redemption: EGP 12 per customer per year\n- Incremental revenue attributed to the programme: unclear\n- Programme cost (cards, system, staff time): EGP 340,000/year\n\nThe operations director wants to kill the programme. The marketing director wants to revamp it. You have been asked to diagnose why it failed and whether it is worth saving.",
        'challenge_questions_en' => json_encode([
            "8.3% active usage on 89,000 issued cards. What are the most likely reasons 91.7% of cardholders never use the programme?",
            "The earn rate is 1 point per EGP 10, redeemable at 100 points for EGP 5. Walk through the customer experience of this reward and explain why it may feel unattractive.",
            "What is the difference between a loyalty programme that changes behaviour and one that rewards behaviour that would have happened anyway?",
            "Design a revised loyalty programme that drives incremental purchase frequency and basket size — with specific earn mechanics, reward types, and a measurement approach.",
        ]),
        'solution_en' => "## Loyalty Programme Failure: The Usual Suspects\n\n### Why 91.7% Never Use the Programme\n\n**Reason 1 — The reward is too small and too slow**\nEarn 1 point per EGP 10. To earn EGP 5 off, spend EGP 1,000. The average pharmacy basket in Egypt is EGP 150–250. A customer spending EGP 200/visit needs 5 visits to earn EGP 5 — a reward worth 0.5% of their spend. This is not motivating.\n\n**Reason 2 — The programme is invisible between visits**\nThere is no reminder that the customer has points, no nudge to return, no notification when they are close to a reward. The card sits unused in a wallet.\n\n**Reason 3 — Redemption is friction-heavy**\nTelling a cashier 'I want to use my points,' the cashier checking a system, the customer not knowing their balance — every step is a minor inconvenience that accumulates into 'it's not worth the hassle.'\n\n**Reason 4 — No emotional connection**\nA 0.5% discount is a financial transaction. It does not build loyalty — it builds a mild preference that evaporates the moment a closer pharmacy opens.\n\n### Changing Behaviour vs. Rewarding Existing Behaviour\n\nA loyalty programme that **rewards existing behaviour** gives discounts to customers who were already going to buy. This is a cost with no incremental benefit.\n\nA loyalty programme that **changes behaviour** gives rewards structured to:\n- Increase visit frequency (come more often)\n- Increase basket size (buy more per visit)\n- Reduce switching (come here instead of anywhere else)\n\nDelta's programme currently does none of these — the earn rate is too slow to influence the next purchase decision.\n\n### Revised Programme Design\n\n**Earn mechanic (simpler and faster):**\n- 10 points per EGP spent (not per EGP 10) → at EGP 200 average basket, earn 2,000 points per visit\n- 500 points = EGP 5 reward → achievable in 1–2 visits\n- Bonus points for behaviour change: +200 points for a second visit within 2 weeks; +500 for filling a prescription\n\n**Reward types (beyond discounts):**\n- Points redeemable for health products (vitamins, supplements) — higher perceived value than cash discount\n- Tier rewards: 'Gold Member' at 10,000 points → free home delivery, pharmacist consultation priority\n- Birthday reward: double points in birthday month\n\n**Invisible programme becomes visible:**\n- WhatsApp integration: balance update after every visit\n- Points-to-reward progress bar on every receipt\n- Notification when 1 visit away from next reward\n\n**Measurement:**\n- Primary metric: visit frequency of active members vs. non-members\n- Secondary metric: average basket size members vs. non-members\n- Cost per incremental visit (not cost per card issued)",

        'bigger_lesson_en' => "**A loyalty programme is not a discount scheme. It is a behaviour change engine.**\n\nThe question is never 'how much do we give away?' — it is 'what behaviour do we need customers to change, and what reward makes that change feel worth it?' Every dirham spent on the wrong reward structure is money funding behaviour that was going to happen anyway.",

        'skills_taught_en' => json_encode([
            'Loyalty programme design principles',
            'Earn and redeem mechanics',
            'Behavioural incentive design',
            'Loyalty programme measurement',
            'Customer engagement through rewards',
        ]),

        'title_ar'    => 'برنامج الولاء الذي لا يستخدمه أحد',
        'subtitle_ar' => 'لماذا تفشل معظم برامج الولاء — وما الذي يميز الناجحة منها',
        'situation_ar' => "أنت مسؤول تسويق في **صيدليات دلتا**، سلسلة 34 صيدلية في القاهرة والجيزة. قبل عامين أطلقت الشركة برنامج بطاقة ولاء: 1 نقطة لكل 10 جنيهات، 100 نقطة = خصم 5 جنيهات.\n\nبعد عامين:\n- 89,000 بطاقة ولاء موزَّعة\n- المستخدمون الفعالون (آخر 90 يوماً): 7,400 (8.3%)\n- متوسط الاسترداد: 12 جنيهاً لكل عميل سنوياً\n- تكلفة البرنامج: 340,000 جنيه/سنة\n\nمدير العمليات يريد إلغاء البرنامج. مدير التسويق يريد تجديده. طُلب منك التشخيص.",
        'challenge_questions_ar' => json_encode([
            "استخدام 8.3% على 89,000 بطاقة. ما الأسباب الأكثر احتمالاً لعدم استخدام 91.7% من حاملي البطاقات للبرنامج؟",
            "معدل الكسب 1 نقطة لكل 10 جنيهات، 100 نقطة = 5 جنيهات. سِر عبر تجربة هذه المكافأة من منظور العميل واشرح لماذا قد تبدو غير جذابة.",
            "ما الفرق بين برنامج ولاء يُغيّر السلوك وآخر يكافئ السلوك الذي كان سيحدث على أي حال؟",
            "صمم برنامج ولاء معدَّلاً يدفع تكرار الشراء وحجم السلة.",
        ]),
        'solution_ar' => "## فشل برنامج الولاء: المشتبه بهم المعتادون\n\n### لماذا 91.7% لا يستخدمون البرنامج\n\n1. **المكافأة صغيرة جداً وبطيئة جداً** — إنفاق 1,000 جنيه للحصول على 5 جنيهات = 0.5% من الإنفاق\n2. **البرنامج غير مرئي بين الزيارات** — لا تذكير، لا إشعار، البطاقة في المحفظة\n3. **الاسترداد مُعقَّد** — إخبار الصراف، التحقق من النظام، عدم معرفة الرصيد\n4. **لا ارتباط عاطفي** — خصم 0.5% معاملة مالية لا ولاء\n\n### تصميم البرنامج المعدَّل\n\n**آلية الكسب (أسرع):**\n- 10 نقاط لكل جنيه ← بمتوسط سلة 200 جنيه: 2,000 نقطة/زيارة\n- 500 نقطة = مكافأة 5 جنيهات ← تحقق في 1-2 زيارة\n- نقاط مضاعفة لتغيير السلوك: +200 لزيارة ثانية خلال أسبوعين\n\n**جعل البرنامج مرئياً:**\n- تكامل واتساب: تحديث الرصيد بعد كل زيارة\n- شريط تقدم نقاط على كل إيصال",

        'bigger_lesson_ar' => "**برنامج الولاء ليس خطة خصم. إنه محرك تغيير سلوك.**\n\nالسؤال ليس أبداً 'كم نُعطي؟' — بل 'ما السلوك الذي نحتاج العملاء لتغييره، وما المكافأة التي تجعل هذا التغيير يستحق العناء؟'",

        'skills_taught_ar' => json_encode([
            'مبادئ تصميم برامج الولاء',
            'آليات الكسب والاسترداد',
            'تصميم الحوافز السلوكية',
            'قياس برامج الولاء',
            'إشراك العملاء من خلال المكافآت',
        ]),
        'created_at' => $now,
        'updated_at' => $now,
    ],

        // ── MG-CAR-02 ─────────────────────────────────────────────────
    [
        'hub_id'        => $hubId,
        'created_by'    => $adminId,
        'topic_slug'    => 'customer_acquisition_retention',
        'topic_name_en' => 'Customer Acquisition & Retention',
        'topic_name_ar' => 'استقطاب العملاء والاحتفاظ بهم',
        'layer'         => 'generic',
        'difficulty'    => 'beginner',
        'status'        => 'published',
        'published_at'  => $now,
        'sort_order'    => 702,
        'read_time_minutes' => 10,

        'title_en'    => 'The Customer Who Left Without Warning',
        'subtitle_en' => 'How to identify churn signals before the customer is already gone',
        'situation_en' => "You are a CRM manager at **Quantum Cloud**, an Egyptian B2B SaaS company providing cloud storage and backup solutions to mid-market companies. The company has 340 active subscriptions at an average of EGP 4,800/month per client.\n\nThis quarter, 28 clients cancelled their subscriptions — a monthly churn rate of 2.7%, significantly above the 1.2% industry benchmark.\n\nPost-cancellation interviews with 12 of the 28 churned clients reveal:\n- 8 said they had considered leaving for 3–6 months but received no outreach\n- 3 said a competitor offered them a better deal and they expected Quantum to respond when they brought it up\n- 1 said their usage dropped because a key employee left — and no one noticed or followed up\n\nThe CEO says: *'These cancellations should not have been surprises. There must have been signals.'*",
        'challenge_questions_en' => json_encode([
            "What behavioural signals in the data would have indicated that these clients were at churn risk — before they cancelled?",
            "Build a simple churn risk scoring model for Quantum Cloud using 5 behavioural and account health indicators.",
            "8 of 12 churned clients had been considering leaving for 3–6 months. Design an intervention workflow that triggers when a client enters high-risk status.",
            "What is the difference between reactive retention (saving clients who say they're leaving) and proactive retention (preventing clients from reaching that point)?",
        ]),
        'solution_en' => "## Churn Prevention: The Signals Were Always There\n\n### Behavioural Signals That Predict Churn\n\nFor a cloud SaaS product, churn is almost always preceded by detachment — the customer gradually uses the product less, contacts support less, and mentally moves on before they formally cancel.\n\n| Signal | Churn Risk Indicator |\n|---|---|\n| Login frequency drops >40% vs. 3-month average | High |\n| Storage utilisation drops (less data being added) | Medium-High |\n| Number of active users on account drops | High |\n| Support tickets not raised for 60+ days (previously active) | Medium |\n| Invoice paid late (first time after being on-time) | Medium |\n| No response to last 3 email communications | High |\n| Key contact (primary user) changes | High — often preceding cancellation |\n\n### A 5-Indicator Churn Risk Score\n\nAssign each indicator a risk score (1–3). Sum the scores. Clients scoring 7+ are high-risk.\n\n| Indicator | Weight |\n|---|---|\n| Login frequency -40% or more | 3 |\n| Active users dropped | 3 |\n| Key contact changed | 3 |\n| Late payment (first time) | 2 |\n| Email non-response (3+ in a row) | 2 |\n| Storage utilisation declining | 1 |\n| Support not contacted in 60 days | 1 |\n\n**Risk tiers:**\n- 0–3: Healthy. Regular check-in every 60 days.\n- 4–6: Watch. Proactive account manager touch in 2 weeks.\n- 7+: High risk. Immediate escalation. Intervention within 48 hours.\n\n### Intervention Workflow for High-Risk Clients\n\n**Trigger:** Client scores 7+ on risk model.\n\n**Day 1:** Account manager receives automated alert with full account health summary — usage data, contact history, last invoice date.\n\n**Day 2:** Account manager calls the primary contact. Not a check-in call. A value delivery call: *'I was reviewing your account and I want to make sure you're getting everything from our platform. Can we spend 20 minutes walking through how you're using [specific feature] — I think we may be able to save you some hours each week.'*\n\n**If usage issue identified:** Schedule a 45-minute training session with the client's team. Free of charge. Demonstrating value is the most powerful retention tool.\n\n**If competitor offer is involved:** The account manager escalates to the retention team, who are authorised to offer: a 3-month pricing concession, an upgraded plan, or an extended contract discount.\n\n**Day 14:** If no response to Day 2 outreach, send a personalised email from the CEO: *'[Client name], I want to make sure Quantum is working for your business. Personally interested in your feedback — 15 minutes of your time?'*\n\n### Reactive vs. Proactive Retention\n\n| Reactive | Proactive |\n|---|---|\n| Triggered by cancellation notice | Triggered by risk signals |\n| Client is already decided | Client is still persuadable |\n| Requires significant concession | Requires value demonstration |\n| Win rate: 15–25% | Win rate: 55–70% |\n| Costly (discounts, concessions) | Cheaper (time investment) |\n\n**The most expensive retention is the last-minute kind.** By the time a client calls to cancel, they have mentally processed the decision for months. The account manager is fighting a decided mind with a discount. Proactive retention is cheaper and more effective at every level.",

        'bigger_lesson_en' => "**Every churned customer sent warning signals that nobody read.**\n\nChurn is not random. It is a gradual process of detachment that leaves clear behavioural footprints in usage data, communication patterns, and account health metrics. The companies that win at retention are not the ones with the best cancellation save tactics — they are the ones that never let clients reach the cancellation conversation.",

        'skills_taught_en' => json_encode([
            'Churn signal identification',
            'Customer health scoring models',
            'Proactive vs. reactive retention',
            'Account manager intervention workflows',
            'SaaS retention metrics and benchmarks',
        ]),

        'title_ar'    => 'العميل الذي غادر دون سابق إنذار',
        'subtitle_ar' => 'كيف تحدد إشارات الرحيل قبل أن يكون العميل قد غادر فعلاً',
        'situation_ar' => "أنت مدير CRM في **كوانتم كلاود**، شركة مصرية SaaS تقدم تخزين وإخاء سحابياً لشركات السوق المتوسط. للشركة 340 اشتراكاً نشطاً بمتوسط 4,800 جنيه/شهر لكل عميل.\n\nهذا الربع، ألغى 28 عميلاً اشتراكاتهم — معدل رحيل شهري 2.7%، أعلى بكثير من المعيار الصناعي 1.2%.\n\nمقابلات ما بعد الإلغاء مع 12 من الـ28:\n- 8 قالوا إنهم فكروا في المغادرة 3-6 أشهر دون أن يتلقوا أي تواصل\n- 3 قالوا إن منافساً عرض عليهم صفقة أفضل وكانوا يتوقعون من كوانتم الاستجابة\n- 1 قال إن استخدامه انخفض لأن موظفاً رئيسياً غادر ولم يلاحظ أحد",
        'challenge_questions_ar' => json_encode([
            "ما الإشارات السلوكية في البيانات التي كانت ستشير إلى أن هؤلاء العملاء في خطر الرحيل — قبل الإلغاء؟",
            "ابنِ نموذج بسيط لتسجيل مخاطر الرحيل باستخدام 5 مؤشرات سلوكية وصحية للحساب.",
            "8 من 12 عملاء رحلوا كانوا يفكرون في المغادرة 3-6 أشهر. صمم سير عمل تدخل يُطلَق حين يدخل عميل حالة الخطر العالي.",
            "ما الفرق بين الاحتفاظ التفاعلي (إنقاذ العملاء القائلين إنهم يغادرون) والاحتفاظ الاستباقي؟",
        ]),
        'solution_ar' => "## منع الرحيل: الإشارات كانت دائماً موجودة\n\n### نموذج تسجيل مخاطر الرحيل (5 مؤشرات)\n\n| المؤشر | الوزن |\n|---|---|\n| انخفاض تكرار تسجيل الدخول -40%+ | 3 |\n| انخفاض عدد المستخدمين النشطين | 3 |\n| تغيير جهة الاتصال الرئيسية | 3 |\n| تأخر الدفع (أول مرة) | 2 |\n| عدم الاستجابة للبريد (3+ متتالية) | 2 |\n\n**مستويات الخطر:**\n- 0-3: بصحة جيدة\n- 4-6: مراقبة — تواصل مدير الحساب خلال أسبوعين\n- 7+: خطر عالٍ — تصعيد فوري، تدخل خلال 48 ساعة\n\n### الاحتفاظ التفاعلي مقابل الاستباقي\n\n| التفاعلي | الاستباقي |\n|---|---|\n| يُطلَق بإشعار الإلغاء | يُطلَق بإشارات الخطر |\n| العميل قرر بالفعل | العميل لا يزال قابلاً للإقناع |\n| معدل النجاح: 15-25% | معدل النجاح: 55-70% |",

        'bigger_lesson_ar' => "**كل عميل راحل أرسل إشارات تحذيرية لم يقرأها أحد.**\n\nالرحيل ليس عشوائياً. إنه عملية تدريجية من الانفصال تترك بصمات سلوكية واضحة في بيانات الاستخدام. الشركات الرابحة في الاحتفاظ لا تملك أفضل أساليب إنقاذ الإلغاء — بل لا تسمح للعملاء بالوصول لمحادثة الإلغاء أبداً.",

        'skills_taught_ar' => json_encode([
            'تحديد إشارات الرحيل',
            'نماذج تسجيل صحة العملاء',
            'الاحتفاظ الاستباقي مقابل التفاعلي',
            'سير عمل تدخل مدير الحساب',
            'مقاييس احتفاظ SaaS ومعاييرها',
        ]),
        'created_at' => $now,
        'updated_at' => $now,
    ],

        ]; // end file 08

        DB::table('cases')->insert($cases);
        $this->command->info('  ✅ 5 cases inserted (MG-CS-04 to MG-CS-06, MG-CAR-01, MG-CAR-02)');
    }
}
