<?php

namespace Database\Seeders;

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

/**
 * InPractice — Marketing Generic Cases [07/10]
 * Pricing & Consumer Psychology: MG-PC-05, MG-PC-06
 * Content & Social Media: MG-CS-01, MG-CS-02, MG-CS-03
 *
 * Run: php artisan db:seed --class=MarketingGenericCaseSeeder_07
 */
class MarketingGenericCaseSeeder_07 extends Seeder
{
    public function run(): void
    {
        $this->command->info('📢 [07/10] Pricing (5-6) + Content & Social Media (1-3) ...');

        $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 = [

        [
        'topic_slug'    => 'pricing_psychology',
        'topic_name_en' => 'Pricing & Consumer Psychology',
        'topic_name_ar' => 'التسعير وسيكولوجية المستهلك',
        'difficulty'    => 'beginner',
        'sort_order'    => 505,
        'read_time_minutes' => 10,
        'title_en'    => 'The Free Trial That Converted Nobody',
        'subtitle_en' => 'Why free is not a pricing strategy — and how to design trials that convert',
        'situation_en' => "You are a product marketing manager at **TaskMaster Egypt**, a SaaS project management tool for Egyptian SMEs. The company launched a 30-day free trial 6 months ago.\n\nResults:\n- 2,340 trial sign-ups\n- 127 converted to paid (5.4% conversion)\n- Industry benchmark for SaaS free trials: 15–25%\n\nThe founding team's response: 'We need more free trial sign-ups.' You think the problem is not the number of trials — it is what happens during the trial.",
        'challenge_questions_en' => json_encode([
            "Why is 5.4% trial-to-paid conversion significantly below benchmark — and what are the most likely causes for a B2B SaaS product?",
            "What is the difference between a 'feature trial' and a 'value trial' — and which one is TaskMaster running?",
            "Design an activation sequence for the 30-day free trial that dramatically improves the probability of conversion — without shortening the trial period.",
            "Should TaskMaster offer a freemium model instead of a time-limited trial? Evaluate the trade-offs.",
        ]),
        'solution_en' => "## Trial Design: The Difference Between Trying and Experiencing Value\n\n### Why 5.4% Is Below Benchmark\n\nMost B2B SaaS trials fail at the same point: the user signs up, pokes around for 20 minutes, doesn't immediately see value, and forgets about the product. The trial expires. No conversion.\n\nThe problem is almost never the product. It is the activation experience — did the user reach the 'aha moment' where the product's value becomes undeniable?\n\n### Feature Trial vs. Value Trial\n\n| Feature Trial | Value Trial |\n|---|---|\n| User explores the product on their own | User is guided to complete specific high-value actions |\n| All features available immediately | Curated experience based on user's specific use case |\n| Success = days of usage | Success = specific outcome achieved |\n| Conversion driven by habit | Conversion driven by perceived value |\n\nTaskMaster is running a feature trial. Users get 30 days of full access and are left to discover value themselves.\n\n### Activation Sequence for 30-Day Trial\n\n**Day 0 (sign-up):** Onboarding survey — 3 questions: team size, industry, biggest project management challenge. This data personalises the entire trial experience.\n\n**Day 1:** Welcome email + one task: 'Create your first project. It takes 3 minutes.' Include a video. The first task must be simple and produce a visible result.\n\n**Day 3:** Check-in email with benchmark: 'Teams like yours typically create 4 projects in their first week. You have created [X]. Here's how to get more from TaskMaster.'\n\n**Day 7:** 'Your first week in numbers' — a personalised dashboard showing what they've done, tasks completed, team members added. Make progress visible.\n\n**Day 14:** Case study email — 'How [similar Egyptian company] saved 6 hours/week with TaskMaster.' Real social proof from the same context.\n\n**Day 21:** Feature discovery — 'You haven't tried [highest-value feature] yet. Here's why it matters for [their stated challenge].'\n\n**Day 25:** Conversion offer — 'Your trial ends in 5 days. Subscribe before Day 30 and get 2 months at 50% off your first year.' Urgency + reward for acting before expiry.\n\n**Day 29:** Last-chance email — simple, direct: 'Tomorrow your trial ends. Keep your data and team access — subscribe today.'\n\n### Freemium vs. Time-Limited Trial\n\n| Time-Limited Trial (current) | Freemium |\n|---|---|\n| Creates urgency to convert | No urgency — users stay free forever |\n| Full access, then cut off | Limited access, upgrade for more |\n| Better for high-touch B2B | Better for viral B2C/prosumer tools |\n| Conversion driven by deadline | Conversion driven by hitting limits |\n\nFor a B2B SaaS tool like TaskMaster, a time-limited trial with a strong activation sequence will outperform freemium. Freemium works when product virality does the acquisition work (Slack, Notion) — TaskMaster doesn't have that viral mechanic.",

        'bigger_lesson_en' => "**A free trial is not a gift — it is a structured sales process.**\n\nThe goal of a trial is not to let users 'try' the product — it is to guarantee that every user reaches the moment where the product's value is undeniable, within the trial window. That journey must be designed, not left to chance.",

        'skills_taught_en' => json_encode([
            'SaaS trial conversion optimisation',
            'User activation sequence design',
            'Freemium vs. time-limited trial strategy',
            'B2B onboarding experience design',
            'Trial-to-paid conversion benchmarks',
        ]),

        'title_ar'    => 'التجربة المجانية التي لم تحوّل أحداً',
        'subtitle_ar' => 'لماذا المجاني ليس استراتيجية تسعير — وكيف تصمم تجارب تُحوّل',
        'situation_ar' => "أنت مدير تسويق المنتج في **تاسك ماستر إيجيبت**، أداة SaaS لإدارة المشاريع للشركات الصغيرة والمتوسطة. أطلقت الشركة تجربة مجانية 30 يوماً قبل 6 أشهر.\n\nالنتائج: 2,340 تسجيل تجريبي، 127 تحولوا للمدفوع (5.4%). متوسط الصناعة: 15-25%.\n\nرد الفريق التأسيسي: 'نحتاج المزيد من التسجيلات التجريبية.' أنت تعتقد المشكلة ليست عدد التجارب — بل ما يحدث أثناءها.",
        'challenge_questions_ar' => json_encode([
            "لماذا تحويل 5.4% أقل بكثير من المتوسط — وما الأسباب الأكثر احتمالاً لمنتج SaaS للشركات؟",
            "ما الفرق بين 'تجربة الميزات' و'تجربة القيمة' — وأيهما تُجري تاسك ماستر؟",
            "صمم تسلسل تفعيل للتجربة المجانية لـ30 يوماً يحسن احتمال التحويل بشكل كبير.",
            "هل يجب أن تقدم تاسك ماستر نموذج freemium بدل تجربة محدودة الوقت؟ قيّم المقايضات.",
        ]),
        'solution_ar' => "## تصميم التجربة: الفرق بين المحاولة وتجربة القيمة\n\n### تسلسل التفعيل لـ30 يوماً\n\n**اليوم 0:** استطلاع تأهيل — حجم الفريق، الصناعة، أكبر تحدي في إدارة المشاريع\n**اليوم 1:** مهمة واحدة: 'أنشئ مشروعك الأول في 3 دقائق'\n**اليوم 7:** 'أسبوعك الأول بالأرقام' — لوحة مخصصة تُظهر التقدم\n**اليوم 14:** دراسة حالة — شركة مصرية مماثلة وفّرت 6 ساعات/أسبوع\n**اليوم 25:** عرض تحويل — 'اشترك قبل اليوم 30 واحصل على شهرين بـ50%'\n**اليوم 29:** بريد فرصة أخيرة — مباشر وبسيط",

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

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

        [
        'topic_slug'    => 'pricing_psychology',
        'topic_name_en' => 'Pricing & Consumer Psychology',
        'topic_name_ar' => 'التسعير وسيكولوجية المستهلك',
        'difficulty'    => 'advanced',
        'sort_order'    => 506,
        'read_time_minutes' => 13,
        'title_en'    => 'The Price War You Should Not Have Entered',
        'subtitle_en' => 'Strategic alternatives to competing on price in commoditised markets',
        'situation_en' => "You are the CMO of **BlueSky Internet**, a regional ISP operating in three Egyptian governorates outside Cairo — Mansoura, Tanta, and Zagazig. You serve 28,000 residential subscribers at an average of EGP 320/month.\n\nA national ISP (NatConnect) has entered your three markets simultaneously, undercutting your prices by 30% (EGP 224/month for a comparable package). In 4 months you have lost 3,200 subscribers (11.4% of base).\n\nYour board wants to match NatConnect's price. Your finance team shows that EGP 224/month puts you below your cost-to-serve threshold (EGP 248/month including infrastructure). Matching the price means losing money on every subscriber.",
        'challenge_questions_en' => json_encode([
            "The board wants to match NatConnect's price. Your finance team says this loses money per subscriber. Map out the exact scenario where matching the price is strategically justified — and the scenario where it is not.",
            "What are the three strategic alternatives to price-matching that are available to a regional ISP with local presence advantages?",
            "BlueSky's advantage is local presence. Design 5 specific ways to turn 'we're local' into a premium that customers will pay for — in measurable, tangible terms.",
            "Design a 12-month competitive defence strategy for BlueSky that does not require matching NatConnect's price and aims to stop the subscriber loss at 15% maximum.",
        ]),
        'solution_en' => "## Competitive Defence Without a Price War\n\n### When Price-Matching Is Justified (and When It's Not)\n\n**Justified when:**\n- The price difference is temporary (competitor is buying market share with funding, not sustainable unit economics)\n- You can match selectively (only in highest-churn risk segments)\n- Matching returns you to profitability within 12 months as volumes recover\n\n**Not justified when (BlueSky's situation):**\n- Matching puts every existing subscriber into loss-making territory\n- The competitor (national ISP) has lower structural costs and can sustain the price longer\n- You have local advantages that cannot be replicated by a national player\n\nMatching NatConnect's price is not a strategy — it is slow liquidation.\n\n### Three Strategic Alternatives\n\n**Alternative 1 — Segment defence**\nDo not defend all 28,000 subscribers equally. Identify the 8,000–10,000 high-value, long-tenure subscribers who are least price-sensitive and most loyal. Protect them with a retention programme. Let the most price-sensitive 20% go to NatConnect — they were always the least profitable.\n\n**Alternative 2 — Premium repositioning**\nIncrease the value perception of the BlueSky package so the price gap is justified in the customer's mind. Add services that NatConnect cannot immediately match as a new entrant.\n\n**Alternative 3 — Community lock-in**\nBuild switching costs that have nothing to do with price. Once a customer has 4 devices registered, their kids' homework on the network, a home security camera running through BlueSky — switching feels like a project, not a simple SIM swap.\n\n### Five Ways to Monetise Local Presence\n\n1. **Same-day technician visits** — NatConnect is national. Their technician is 3–4 hours away. BlueSky is in Mansoura. 'Technical issue? We'll be there today' is a genuine premium.\n\n2. **Local customer service number** — A local number that rings a team based in Mansoura, staffed by people who speak in the local dialect and know local neighbourhoods. NatConnect's call centre is in Cairo.\n\n3. **Community bundles** — Partner with local businesses: 'BlueSky subscribers get discounts at 40 local restaurants, pharmacies, and gyms in Mansoura.' This is a loyalty programme that national ISPs structurally cannot match.\n\n4. **School and educational priority** — Offer guaranteed bandwidth priority during exam seasons for students. This speaks directly to the Egyptian family's primary anxiety.\n\n5. **Hardware exchange programme** — 'Bring us any router from any provider and get a BlueSky premium router installed free.' This is a switching-incentive that does not require a price cut.\n\n### 12-Month Competitive Defence Strategy\n\n| Quarter | Action | Goal |\n|---|---|---|\n| Q1 | Retention calls to all 28,000 subscribers — identify at-risk segment | Stop churn at 15% maximum |\n| Q1 | Launch 'BlueSky Local Pledge' — same-day service, local team | Differentiate on service |\n| Q2 | Community bundle partnerships (40+ local businesses) | Create switching cost |\n| Q2 | Launch 'BlueSky Family' package — priority bandwidth for students | Win family segment |\n| Q3 | Premium tier launch: EGP 420/month with 2× speed + priority support | Move willing subscribers up |\n| Q4 | Annual contract loyalty discount: 10% off annual commitment | Lock in long-term subscribers |",

        'bigger_lesson_en' => "**Regional incumbents with genuine local advantages should never enter a price war with a national player who has a lower cost base.**\n\nThe right question is not 'how do we match their price?' but 'how do we make our local advantage so valuable that price becomes a secondary consideration?' The ISPs that survive national competition are those that become genuinely embedded in their local community — not those that race to the bottom on price.",

        'skills_taught_en' => json_encode([
            'Competitive defence strategy without price-matching',
            'Segment defence and subscriber retention',
            'Local advantage monetisation',
            'Switching cost creation',
            'Regional vs national competitive dynamics',
        ]),

        'title_ar'    => 'حرب الأسعار التي لم يكن يجب دخولها',
        'subtitle_ar' => 'بدائل استراتيجية للتنافس على السعر في الأسواق الممعيرة',
        'situation_ar' => "أنت CMO لـ**بلو سكاي للإنترنت**، مزود إنترنت إقليمي يعمل في ثلاث محافظات مصرية خارج القاهرة. 28,000 مشترك بمتوسط 320 جنيه/شهر.\n\nدخل مزود وطني (ناتكونكت) أسواقك الثلاثة في آنٍ واحد بأسعار أقل 30% (224 جنيه/شهر لباقة مماثلة). في 4 أشهر خسرت 3,200 مشترك.\n\nمجلسك يريد مجاراة سعر ناتكونكت. فريقك المالي يُظهر أن 224 جنيه أقل من تكلفة الخدمة (248 جنيه بما يشمل البنية التحتية). المجاراة تعني الخسارة في كل مشترك.",
        'challenge_questions_ar' => json_encode([
            "المجلس يريد مجاراة السعر. الفريق المالي يقول إن ذلك خسارة لكل مشترك. رسم خريطة السيناريو الذي تكون فيه المجاراة مبررة استراتيجياً — والسيناريو الذي لا تكون فيه.",
            "ما البدائل الاستراتيجية الثلاثة لمجاراة السعر المتاحة لمزود إنترنت إقليمي بمزايا الحضور المحلي؟",
            "ميزة بلو سكاي الحضور المحلي. صمم 5 طرق محددة لتحويل 'نحن محليون' إلى قسط سعري يدفعه العملاء.",
            "صمم استراتيجية دفاع تنافسي لـ12 شهراً لا تتطلب مجاراة سعر ناتكونكت وتهدف لوقف خسارة المشتركين عند 15% كحد أقصى.",
        ]),
        'solution_ar' => "## الدفاع التنافسي بلا حرب أسعار\n\n### خمس طرق لتحقيق عائد من الحضور المحلي\n\n1. **زيارات فنية في نفس اليوم** — ناتكونكت مزود وطني، فنيوه على بعد 3-4 ساعات\n2. **رقم خدمة عملاء محلي** — فريق في المنصورة يتكلم باللهجة المحلية\n3. **باقات مجتمعية** — شراكة مع 40+ محل محلي (مطاعم، صيدليات، نوادٍ)\n4. **أولوية النطاق لموسم الامتحانات** — يخاطب قلق العائلة المصرية الأول\n5. **برنامج تبادل الأجهزة** — 'أحضر أي راوتر واحصل على راوتر بلو سكاي مجاناً'\n\n### استراتيجية دفاع 12 شهراً\n\n| الربع | الإجراء | الهدف |\n|---|---|---|\n| الربع 1 | اتصالات استبقاء + 'تعهد بلو سكاي المحلي' | وقف التراجع عند 15% |\n| الربع 2 | شراكات مجتمعية + باقة 'بلو سكاي عائلي' | خلق تكلفة التحويل |\n| الربع 3 | إطلاق طبقة مميزة: 420 جنيه/شهر بسرعة ضعفين | ترفيع المشتركين الراغبين |\n| الربع 4 | خصم ولاء العقد السنوي: 10% | قفل المشتركين طويل الأمد |",

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

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

        [
        'topic_slug'    => 'content_social_media',
        'topic_name_en' => 'Content & Social Media',
        'topic_name_ar' => 'المحتوى ووسائل التواصل الاجتماعي',
        'difficulty'    => 'beginner',
        'sort_order'    => 601,
        'read_time_minutes' => 10,
        'title_en'    => 'The Content Calendar That Nobody Followed',
        'subtitle_en' => 'Building a sustainable social media system, not a wishful plan',
        'situation_en' => "You are the social media coordinator at **Safina Seafood**, a premium seafood restaurant chain with 3 branches in Alexandria. Six months ago, a digital agency delivered a '90-day content calendar' — 7 posts per week across Instagram and Facebook, with themes, copy, and image guidelines.\n\nReality 6 months later:\n- Average actual posts: 2.3/week\n- 34 of 90 planned posts were published\n- Photography for most posts was never done\n- The agency's calendar assumed a dedicated photographer, videographer, and copywriter — none of which Safina has in-house\n- Engagement on actual posts: high (4.8% average)\n- Comments are not being responded to\n\nThe owner asks: 'The agency took EGP 45,000 to build a plan we couldn't execute. What do we actually need?'",
        'challenge_questions_en' => json_encode([
            "What is the fundamental error in how the agency built this content plan — and what question should they have asked before designing the calendar?",
            "What is the minimum viable social media operation for a 3-branch restaurant with no dedicated social media staff — that can be sustained without an agency?",
            "Unanswered comments on a restaurant's social media are a business problem, not just a social media problem. Explain why — and design a 15-minute/day comment management routine.",
            "Rebuild the content strategy for Safina Seafood: specific content types, realistic frequency, production process, and who does what — using only in-house resources.",
        ]),
        'solution_en' => "## Sustainable Social Media: The System That Gets Done, Not the Plan That Looks Good\n\n### The Fundamental Agency Error\n\nThe agency designed for a hypothetical Safina — one with a full creative team, a production budget, and a dedicated social media manager. They never asked: 'Who will actually execute this every day?'\n\nA 90-day calendar that assumes resources that don't exist is not a content strategy — it is a creative portfolio piece for the agency.\n\n**The question the agency should have asked first:** 'Who at Safina will be responsible for social media daily — and how many hours per day can they realistically spend on it?'\n\n### Minimum Viable Social Media for a 3-Branch Restaurant\n\nA restaurant can sustain a social media presence with the following:\n\n| Resource | What's Needed | What Safina Has |\n|---|---|---|\n| Content creator | 1 person, 30 min/day | Possible with existing staff training |\n| Photography | iPhone 13+, good lighting | Any manager's phone |\n| Copy | Short, conversational | Any manager can write |\n| Frequency | 3–4 posts/week | Achievable |\n| Engagement | 15 min/day responding to comments | Schedulable |\n\n### Why Unanswered Comments Are a Business Problem\n\nFor a restaurant, unanswered social media comments are equivalent to a waiter walking away while a customer is mid-sentence. The business impact:\n\n- Every unanswered question ('Do you take reservations?' 'Is parking available?') is a potential customer who did not come\n- Every unanswered complaint festers publicly — visible to thousands of potential customers\n- Every unanswered compliment is a missed loyalty reinforcement\n- Algorithm impact: Instagram and Facebook reward accounts where comments are replied to — unanswered comments reduce reach\n\n**15-Minute Daily Comment Routine:**\n- Morning (5 min): Check overnight comments. Reply to all questions with specific answers.\n- Afternoon (5 min): Check midday comments. Thank all compliments with one personalised line.\n- Evening (5 min): Check dinner rush comments. Respond to any complaints within 2 hours with: acknowledge + apologise + offer to resolve offline.\n\n### Rebuilt Content Strategy for Safina Seafood\n\n**Frequency: 4 posts/week (sustainable, not aspirational)**\n\n| Day | Content Type | Production | Who |\n|---|---|---|---|\n| Monday | 'Fresh Catch' — what arrived at market today, photo of the fish | iPhone photo, 3 lines of copy | Branch manager |\n| Wednesday | Behind the scenes — chef preparing a dish, or a supplier visit | Short video (30 sec), no editing needed | Any staff member |\n| Friday | Weekend special or new dish | One styled photo, 5 lines copy | Trained staff |\n| Sunday | Customer photo repost or 'Most Ordered This Week' | Screenshot + caption | Social coordinator |\n\n**Content creation training (one session):**\nTrain 2 managers per branch in: iPhone food photography (lighting, angles), writing 3-line captions, using Instagram's built-in editing tools. Total investment: 1 half-day session. Outcome: 6 trained content creators across 3 branches.",

        'bigger_lesson_en' => "**The best content strategy is the one that gets executed — not the one that looks most impressive in a pitch deck.**\n\nSustainable social media is built on realistic systems, not aspirational schedules. A restaurant that posts 3 authentic, human photos per week with answered comments will outperform one that posts 7 professional photos per week with zero engagement management — every time.",

        'skills_taught_en' => json_encode([
            'Sustainable content calendar design',
            'In-house social media systems for SMEs',
            'Comment management as customer service',
            'Restaurant social media strategy',
            'Content production without agencies',
        ]),

        'title_ar'    => 'تقويم المحتوى الذي لم يتبعه أحد',
        'subtitle_ar' => 'بناء نظام وسائل تواصل اجتماعي مستدام لا خطة أمنية',
        'situation_ar' => "أنت منسق وسائل التواصل الاجتماعي في **سفينة للمأكولات البحرية**، سلسلة مطاعم مأكولات بحرية راقية بـ3 فروع في الإسكندرية. قبل 6 أشهر، سلّمت وكالة رقمية 'تقويم محتوى 90 يوماً' — 7 منشورات/أسبوع عبر إنستغرام وفيسبوك.\n\nالواقع بعد 6 أشهر:\n- المنشورات الفعلية: 2.3/أسبوع\n- 34 من 90 منشوراً مخططاً نُشر\n- التصوير لمعظم المنشورات لم يتم\n- التعليقات لا يُرد عليها\n- التفاعل على المنشورات الفعلية: مرتفع (4.8% متوسطاً)\n\nالمالك يسأل: 'الوكالة أخذت 45,000 جنيه لبناء خطة لم نستطع تنفيذها. ما الذي نحتاجه فعلاً؟'",
        'challenge_questions_ar' => json_encode([
            "ما الخطأ الجوهري في طريقة بناء الوكالة لهذه الخطة — وما السؤال الذي كان يجب طرحه أولاً؟",
            "ما الحد الأدنى لعمليات وسائل التواصل لمطعم بـ3 فروع بلا موظف مخصص — يمكن الحفاظ عليه بلا وكالة؟",
            "التعليقات غير المجابة على وسائل التواصل لمطعم مشكلة عمل لا مجرد مشكلة سوشيال. اشرح لماذا وصمم روتين 15 دقيقة/يوم لإدارة التعليقات.",
            "أعد بناء استراتيجية المحتوى لسفينة: أنواع محتوى محددة وتكرار واقعي وعملية إنتاج — باستخدام الموارد الداخلية فقط.",
        ]),
        'solution_ar' => "## وسائل التواصل المستدامة: النظام الذي يُنجز لا الخطة التي تبدو جيدة\n\n### استراتيجية المحتوى المعاد بناؤها لسفينة\n\n**التكرار: 4 منشورات/أسبوع (مستدام لا تطلعي)**\n\n| اليوم | نوع المحتوى | من |\n|---|---|---|\n| الاثنين | 'الصيد الطازج' — ما وصل السوق اليوم | مدير الفرع |\n| الأربعاء | كواليس — الشيف يحضر طبقاً | أي موظف |\n| الجمعة | عرض نهاية الأسبوع | موظف مدرّب |\n| الأحد | صورة عميل معاد نشرها أو 'الأكثر طلباً هذا الأسبوع' | المنسق |\n\n**روتين التعليقات اليومي 15 دقيقة:**\nصباح (5 دقائق): أجب على كل الأسئلة\nبعد الظهر (5 دقائق): اشكر كل الإطراء\nمساء (5 دقائق): أجب على أي شكاوى خلال ساعتين",

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

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

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

        'title_en'    => 'The Viral Post That Hurt the Brand',
        'subtitle_en' => 'Why chasing virality without brand alignment is a liability, not an asset',
        'situation_en' => "You are the social media executive at **Mirage Bottled Water**, a premium Egyptian water brand. A junior team member posted a meme on the brand's Instagram account — a trending format making fun of how expensive everything has become in Egypt. The caption: *'Us watching our budget disappear 😭 — at least our water is worth it.'*\n\nThe post went viral — 280,000 views, 14,000 shares, 4,200 comments. Most comments were positive reactions to the relatable humour. The team was excited.\n\nBut then:\n- Three premium hotel clients called to ask why Mirage is 'joking about inflation when they charge EGP 45 for a bottle'\n- A competitor screenshotted the post and quoted it: 'Even Mirage admits their water is overpriced'\n- The brand director called an emergency meeting\n\nThe marketing director asks: *'Was this a win or a mistake — and what is our framework for social content going forward?'*",
        'challenge_questions_en' => json_encode([
            "The post got 280,000 views. By reach alone, is this a success? What other dimensions must you evaluate?",
            "What is 'brand voice' and how did this post violate Mirage's brand positioning even though it was funny?",
            "The competitor's screenshot turned a viral moment into a brand liability. How could this risk have been anticipated?",
            "Design a social media content framework for a premium B2B brand that allows personality and engagement without creating brand risk.",
        ]),
        'solution_en' => "## Virality Without Alignment: When Reach Becomes Risk\n\n### Evaluating the Post Beyond Reach\n\n| Dimension | Assessment |\n|---|---|\n| Reach | 280,000 — excellent |\n| Engagement | 14,000 shares — strong |\n| Brand alignment | Poor — contradicts premium positioning |\n| B2B client perception | Damaged — hotel clients concerned |\n| Competitor ammunition | Provided — exploited immediately |\n| Brand voice consistency | Broken |\n\nOn reach alone: win. On brand health: loss. The post traded long-term brand equity for short-term engagement — a bad deal for a premium brand.\n\n### Brand Voice and Positioning Violation\n\nMirage's positioning is premium. The brand's visual identity, packaging, hotel partnerships, and price point all communicate: *'This water is worth more because it represents quality and refinement.'*\n\nThe inflation meme communicated: *'We know we're expensive. We find it funny too.'* This is the exact opposite of premium confidence. Premium brands do not joke about their own price. They justify it.\n\nThe post was funny — but funny for a youth-oriented FMCG brand, not for a premium water brand serving five-star hotels.\n\n### Anticipating the Competitor Risk\n\nBefore posting any content that touches on price, value, or brand positioning, ask: *'What is the worst possible way a competitor or critic could use this against us?'*\n\nThe meme screamed: 'quote me, screenshot me, use me to say Mirage admits its price isn't worth it.' A 30-second adversarial review would have caught this.\n\n### Social Content Framework for Premium B2B Brands\n\n**The Brand Voice Filter (3 questions before every post):**\n1. Does this reinforce WHY our brand is worth what we charge?\n2. Would our best client (the Nile Ritz, Four Seasons Cairo) be comfortable seeing this?\n3. Could this be taken out of context and used against us?\n\n**Four Content Pillars for Mirage:**\n\n| Pillar | % of Content | Examples |\n|---|---|---|\n| Product Story | 30% | Source, purification process, quality certifications |\n| Partnership Pride | 25% | 'Now served at [Hotel Name]', chef partnerships |\n| Lifestyle & Refinement | 30% | Aspirational settings, food pairings, premium moments |\n| Behind the Brand | 15% | Team, sustainability, Egyptian heritage |\n\n**What Personality Looks Like for Premium:**\nPersonality does not require memes. It means: wit in captions, warmth in responses, storytelling in video. 'Our spring has been flowing since 1974' is personality. An inflation meme is not.",

        'bigger_lesson_en' => "**Virality is a tactic. Brand positioning is a strategy. Never sacrifice the strategy for the tactic.**\n\nA post that gets 1,000 engaged views from the right audience is worth more than a post that gets 1,000,000 views from the wrong one — especially when the wrong views include your best clients wondering if they made a mistake.",

        'skills_taught_en' => json_encode([
            'Brand voice definition and enforcement',
            'Social media content risk assessment',
            'Premium brand social strategy',
            'Virality vs. brand alignment trade-offs',
            'B2B social media content frameworks',
        ]),

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

        'bigger_lesson_ar' => "**الانتشار تكتيك. تموضع العلامة استراتيجية. لا تضحِّي بالاستراتيجية من أجل التكتيك.**\n\nمنشور يحصل على 1,000 مشاهدة متفاعلة من الجمهور الصحيح يستحق أكثر من منشور يحصل على مليون مشاهدة من الجمهور الخاطئ.",

        'skills_taught_ar' => json_encode([
            'تعريف صوت العلامة وتطبيقه',
            'تقييم مخاطر محتوى وسائل التواصل',
            'استراتيجية التواصل الاجتماعي للعلامات الراقية',
            'المقايضات بين الانتشار وتوافق العلامة',
            'أطر محتوى التواصل الاجتماعي للـB2B',
        ]),
        'created_at' => $now,
        'updated_at' => $now,
    ],

        // ── MG-CS-03 ──────────────────────────────────────────────────
    [
        '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'    => 603,
        'read_time_minutes' => 12,

        'title_en'    => 'The Comment Section Nobody Was Watching',
        'subtitle_en' => 'Community management is not a junior task — it is brand reputation in real time',
        'situation_en' => "You are the marketing manager at **Cairo Kids Academy**, a chain of nurseries and early childhood centres across Cairo. The brand has 41,000 Instagram followers and posts regularly about child development, activities, and events.\n\nA parent posted a public comment on your last Instagram post: *'My daughter attended Cairo Kids for 2 years. They lost her in the outdoor play area for 45 minutes last April and never properly apologised. I'm sharing this so other parents know before enrolling.'*\n\nThe comment has 847 likes and 312 replies — including parents sharing their own negative experiences, and parents defending the academy. The post itself was about a Mother's Day event.\n\nYour social media executive was on a day off. By the time the comment was noticed, it had been live for 11 hours with no response from the brand.\n\nParents have begun tagging the account directly in stories asking for a response. A local parenting blog has screenshotted the thread and is preparing an article.",
        'challenge_questions_en' => json_encode([
            "You have been notified 11 hours after the comment was posted. What is your immediate priority in the next 60 minutes — and why does response speed matter?",
            "Draft the brand's first public response to the comment. What must it include — and what must it absolutely not say?",
            "The original post was about Mother's Day. Should you delete it, leave it up, or take another action? Explain the brand implications of each choice.",
            "Design a community management protocol for Cairo Kids Academy that prevents this situation from happening again — covering monitoring, escalation, response authority, and tone guidelines.",
        ]),
        'solution_en' => "## Crisis Community Management: The Rules That Apply When It Gets Serious\n\n### The First 60 Minutes\n\nImmediate priority: **Acknowledge before you have answers.**\n\nThe worst outcome is continued silence. Every hour without a brand response signals either indifference or guilt. Even if you do not have a full response ready — even if leadership needs to be involved — the brand must appear in that comment thread within the hour.\n\nFirst action: Post a holding response (see below). Second action: Call leadership and legal/compliance. Third action: Do not delete anything.\n\n### Drafting the First Response\n\n**What it must include:**\n- Direct acknowledgment of the parent's experience — by name if possible\n- Genuine concern, not corporate deflection\n- A private channel for follow-up (DM or email)\n- No defensiveness, no 'our records show differently'\n\n**Draft response:**\n> *'[Parent name], we are deeply sorry to read this. The safety of every child in our care is our absolute first responsibility, and we take your account seriously. We understand that a public response cannot do justice to this conversation — please DM us directly or email [care@cairokids.eg] so we can speak privately and address this properly. We will respond within 2 hours.'*\n\n**What it must not say:**\n- 'We have investigated and found no record of this incident' — you have not investigated in 60 minutes\n- 'This is one person's perspective' — dismissing the parent publicly will trigger a pile-on\n- 'Please contact us privately' without also acknowledging publicly — the public audience needs to see the brand show up\n\n### The Post Decision\n\n| Option | Risk | Signal |\n|---|---|---|\n| Delete the post | Extremely high — screenshots exist, deletion proves guilt in public perception | 'We are hiding something' |\n| Archive/hide the post | Moderate — comment thread disappears but deleting the post mid-crisis looks evasive | 'We are managing optics not the issue' |\n| Leave it up | Low-moderate | 'We are not hiding from this' |\n\n**Leave the post up.** The screenshots already exist. Deleting now creates a second story: 'Cairo Kids deleted the evidence.' The comment thread, with your response visible, actually demonstrates accountability.\n\n### Community Management Protocol\n\n**Monitoring (daily):**\n- Every brand mention monitored — on-page comments AND off-page tags/mentions\n- Monitoring tools: native Instagram alerts + Google Alerts for the brand name\n- No post goes unmonitored for more than 4 hours during business hours; 12 hours maximum overnight\n\n**Escalation tiers:**\n| Tier | Trigger | Who Responds | Timeline |\n|---|---|---|---|\n| Tier 1 | Routine questions, compliments | Social media executive | Within 2 hours |\n| Tier 2 | Complaints, negative feedback | Marketing manager | Within 1 hour |\n| Tier 3 | Child safety, legal risk, media involvement | CEO + legal | Within 30 minutes |\n\n**Response authority:**\nOnly trained team members may respond. All Tier 3 responses must be approved by two people before posting.\n\n**Tone guidelines:**\n- Lead with empathy, follow with facts\n- Never argue publicly with a parent\n- Every negative comment gets a response — ignoring a complaint publicly is never neutral",

        'bigger_lesson_en' => "**Social media comments are not marketing — they are customer service in public.**\n\nEvery unresponded complaint on a brand's page is a permanent, public record that the brand did not care enough to respond. In sensitive categories like childcare, healthcare, or education, community management is a trust-critical function that should never be treated as a junior or low-priority task.",

        'skills_taught_en' => json_encode([
            'Crisis community management',
            'Social media response protocols',
            'Escalation frameworks for brand crises',
            'Public complaint handling',
            'Brand trust in sensitive service categories',
        ]),

        'title_ar'    => 'خانة التعليقات التي لم يراقبها أحد',
        'subtitle_ar' => 'إدارة المجتمع ليست مهمة مبتدئ — إنها سمعة العلامة في الوقت الفعلي',
        'situation_ar' => "أنت مدير تسويق في **أكاديمية كايرو كيدز**، سلسلة حضانات ومراكز طفولة مبكرة. للعلامة 41,000 متابع على إنستغرام.\n\nأحد الآباء نشر تعليقاً عاماً على آخر منشور: *'ابنتي كانت في كايرو كيدز سنتين. في أبريل الماضي فقدوها في منطقة اللعب الخارجية 45 دقيقة ولم يعتذروا كما يجب. أشارك هذا لكي يعرف الآباء الآخرون قبل التسجيل.'*\n\nالتعليق حصل على 847 إعجاباً و312 رداً. كان مسؤول التواصل الاجتماعي في إجازة. حين لوحظ التعليق كان قائماً 11 ساعة بلا رد.",
        'challenge_questions_ar' => json_encode([
            "تم إخطارك بعد 11 ساعة من نشر التعليق. ما أولويتك الفورية في الـ60 دقيقة القادمة — ولماذا تهم سرعة الاستجابة؟",
            "صغ أول رد عام للعلامة على التعليق. ما الذي يجب أن يتضمنه — وما الذي يجب ألا يقوله مطلقاً؟",
            "المنشور الأصلي كان عن عيد الأم. هل تحذفه، تتركه، أم تتخذ إجراءً آخر؟",
            "صمم بروتوكول إدارة مجتمع لأكاديمية كايرو كيدز يمنع تكرار هذا الموقف.",
        ]),
        'solution_ar' => "## إدارة أزمة المجتمع\n\n### الـ60 دقيقة الأولى\n\n**أولوية فورية: الاعتراف قبل أن تملك الإجابات.**\n\nأسوأ نتيجة هي استمرار الصمت. كل ساعة بلا رد من العلامة تُشير إلى اللامبالاة أو الذنب.\n\n**رد أول مقترح:**\n> *'[اسم الأم/الأب]، نحن آسفون بعمق لقراءة هذا. سلامة كل طفل في رعايتنا مسؤوليتنا الأولى المطلقة. من فضلك راسلنا مباشرةً أو على [البريد الإلكتروني] لنتحدث بشكل صحيح. سنرد خلال ساعتين.'*\n\n### قرار المنشور\n\n**اتركه** — اللقطات موجودة بالفعل. حذفه الآن يخلق قصة ثانية: 'كايرو كيدز حذفت الأدلة.'\n\n### بروتوكول إدارة المجتمع\n\n**مستويات التصعيد:**\n- المستوى 1: أسئلة روتينية ← مسؤول التواصل خلال ساعتين\n- المستوى 2: شكاوى ← مدير التسويق خلال ساعة\n- المستوى 3: سلامة الأطفال، مخاطر قانونية ← الرئيس التنفيذي + قانوني خلال 30 دقيقة",

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

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

        ]; // end file 07

      $cases = array_map(function ($case) use ($hubId, $adminId, $now) {
            return array_merge([
                'hub_id'       => $hubId,
                'created_by'   => $adminId,
                'layer'        => 'generic',
                'status'       => 'published',
                'published_at' => $now,
            ], $case);
        }, $cases);

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