<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\SelfPaced\Course;
use App\Models\SelfPaced\CourseTopic;
use App\Models\SelfPaced\CourseSubTopic;

/**
 * SelfPacedTopicSeeder
 *
 * Seeds 3 topics per course, each with 2 subtopics containing rich HTML content.
 * Depends on SelfPacedCourseSeeder having run first.
 *
 * Requirements: 15.3
 */
class SelfPacedTopicSeeder extends Seeder
{
    public function run(): void
    {
        $courses = Course::whereIn('slug', [
            'community-health-promotion-disease-prevention',
            'health-sector-leadership-management',
            'health-communication-community-engagement',
        ])->get()->keyBy('slug');

        foreach ($this->getTopicsData() as $courseSlug => $topics) {
            $course = $courses->get($courseSlug);
            if (!$course) {
                continue;
            }

            foreach ($topics as $topicOrder => $topicData) {
                $topic = CourseTopic::firstOrCreate(
                    ['course_id' => $course->id, 'title' => $topicData['title']],
                    [
                        'description'  => $topicData['description'],
                        'sort_order'   => $topicOrder + 1,
                        'is_published' => true,
                    ]
                );

                foreach ($topicData['subtopics'] as $subOrder => $subData) {
                    CourseSubTopic::firstOrCreate(
                        ['topic_id' => $topic->id, 'title' => $subData['title']],
                        [
                            'content'      => $subData['content'],
                            'sort_order'   => $subOrder + 1,
                            'is_published' => true,
                        ]
                    );
                }
            }
        }

        $this->command->info('SelfPacedTopicSeeder: Topics and subtopics seeded.');
    }

    private function getTopicsData(): array
    {
        return [
            'community-health-promotion-disease-prevention' => $this->healthTopics(),
            'health-sector-leadership-management'           => $this->leadershipTopics(),
            'health-communication-community-engagement'     => $this->communicationTopics(),
        ];
    }

    // =========================================================================
    // HEALTH COURSE TOPICS
    // =========================================================================
    private function healthTopics(): array
    {
        return [
            [
                'title'       => 'Foundations of Community Health Promotion',
                'description' => 'Introduction to the principles, models, and frameworks that guide community health promotion practice.',
                'subtopics'   => [
                    [
                        'title'   => 'What is Community Health Promotion?',
                        'content' => '<h2>What is Community Health Promotion?</h2>
<p>Community health promotion is a process that enables people to increase control over their health and its determinants, and thereby improve their health. It is a core function of public health and contributes to the work of tackling communicable and non-communicable diseases and other threats to health.</p>
<h3>Key Principles</h3>
<ul>
  <li><strong>Empowerment:</strong> Enabling individuals and communities to take control of their health decisions.</li>
  <li><strong>Participation:</strong> Involving community members in planning and implementing health activities.</li>
  <li><strong>Equity:</strong> Addressing health disparities and ensuring fair access to health resources.</li>
  <li><strong>Sustainability:</strong> Building community capacity for long-term health improvement.</li>
  <li><strong>Multi-sectoral collaboration:</strong> Working across sectors including education, water, sanitation, and agriculture.</li>
</ul>
<h3>The Ottawa Charter Framework</h3>
<p>The Ottawa Charter for Health Promotion (1986) identifies five key action areas:</p>
<ol>
  <li>Build healthy public policy</li>
  <li>Create supportive environments</li>
  <li>Strengthen community action</li>
  <li>Develop personal skills</li>
  <li>Reorient health services</li>
</ol>
<blockquote><em>"Health promotion is the process of enabling people to increase control over, and to improve, their health." — Ottawa Charter, 1986</em></blockquote>
<h3>Relevance to South Sudan</h3>
<p>In South Sudan, community health promotion is particularly important given the limited health infrastructure, high burden of communicable diseases, and the critical role of community health workers (CHWs) in reaching underserved populations.</p>',
                    ],
                    [
                        'title'   => 'Social Determinants of Health in South Sudan',
                        'content' => '<h2>Social Determinants of Health in South Sudan</h2>
<p>The social determinants of health (SDH) are the conditions in which people are born, grow, live, work, and age. These circumstances are shaped by the distribution of money, power, and resources at global, national, and local levels.</p>
<h3>Key Social Determinants</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#f0f4f8;">
    <tr><th>Determinant</th><th>Impact on Health</th><th>South Sudan Context</th></tr>
  </thead>
  <tbody>
    <tr><td>Education</td><td>Literacy affects health knowledge and decision-making</td><td>Low literacy rates, especially among women</td></tr>
    <tr><td>Income &amp; Poverty</td><td>Poverty limits access to food, healthcare, and clean water</td><td>High poverty rates; economic instability</td></tr>
    <tr><td>Water &amp; Sanitation</td><td>Clean water prevents diarrhoeal diseases</td><td>Limited access to safe water in many areas</td></tr>
    <tr><td>Food Security</td><td>Malnutrition weakens immunity</td><td>Chronic food insecurity in conflict-affected areas</td></tr>
    <tr><td>Gender Equality</td><td>Women\'s empowerment improves maternal and child health</td><td>Gender-based disparities in health access</td></tr>
  </tbody>
</table>
<h3>Addressing SDH in Practice</h3>
<ul>
  <li>Advocating for clean water and sanitation improvements in your community</li>
  <li>Linking community members to social protection programmes</li>
  <li>Promoting girls\' education and women\'s health rights</li>
  <li>Collaborating with agriculture and food security programmes</li>
  <li>Documenting and reporting health inequities to supervisors</li>
</ul>',
                    ],
                ],
            ],
            [
                'title'       => 'Communicable Disease Prevention and Control',
                'description' => 'Understanding, preventing, and controlling the major communicable diseases affecting South Sudan communities.',
                'subtopics'   => [
                    [
                        'title'   => 'Major Communicable Diseases in South Sudan',
                        'content' => '<h2>Major Communicable Diseases in South Sudan</h2>
<p>South Sudan faces a high burden of communicable diseases. Understanding these diseases is the first step in effective prevention and control.</p>
<h3>Priority Diseases</h3>
<h4>1. Malaria</h4>
<p>Malaria is the leading cause of morbidity and mortality in South Sudan. It is transmitted by the <em>Anopheles</em> mosquito and caused by <em>Plasmodium falciparum</em> in most cases.</p>
<ul>
  <li><strong>Prevention:</strong> Insecticide-treated bed nets (ITNs), indoor residual spraying (IRS), environmental management</li>
  <li><strong>Symptoms:</strong> Fever, chills, headache, vomiting, muscle pain</li>
  <li><strong>Treatment:</strong> Artemisinin-based combination therapy (ACT)</li>
</ul>
<h4>2. Cholera / Acute Watery Diarrhoea</h4>
<p>Cholera outbreaks are common, particularly in displacement camps and flood-prone areas.</p>
<ul>
  <li><strong>Prevention:</strong> Safe water, handwashing with soap, proper sanitation</li>
  <li><strong>Treatment:</strong> Oral rehydration salts (ORS), IV fluids for severe cases</li>
</ul>
<h4>3. Tuberculosis (TB)</h4>
<p>TB remains a significant public health challenge, with high rates in crowded settings.</p>
<ul>
  <li><strong>Prevention:</strong> BCG vaccination, early case detection, contact tracing</li>
  <li><strong>Treatment:</strong> DOTS (Directly Observed Treatment, Short-course)</li>
</ul>
<h3>Disease Surveillance</h3>
<p>Community health workers play a vital role in disease surveillance by:</p>
<ol>
  <li>Identifying and reporting unusual clusters of illness</li>
  <li>Completing weekly disease reporting forms</li>
  <li>Referring suspected cases to health facilities promptly</li>
  <li>Educating communities on early warning signs</li>
</ol>',
                    ],
                    [
                        'title'   => 'Immunisation and Vaccination Programmes',
                        'content' => '<h2>Immunisation and Vaccination Programmes</h2>
<p>Immunisation is one of the most cost-effective public health interventions. In South Sudan, the Expanded Programme on Immunisation (EPI) provides vaccines against major childhood diseases.</p>
<h3>South Sudan EPI Schedule</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#e8f5e9;">
    <tr><th>Age</th><th>Vaccines</th></tr>
  </thead>
  <tbody>
    <tr><td>Birth</td><td>BCG, OPV0, Hepatitis B</td></tr>
    <tr><td>6 weeks</td><td>OPV1, Pentavalent1, PCV1, Rotavirus1</td></tr>
    <tr><td>10 weeks</td><td>OPV2, Pentavalent2, PCV2, Rotavirus2</td></tr>
    <tr><td>14 weeks</td><td>OPV3, Pentavalent3, PCV3, IPV</td></tr>
    <tr><td>9 months</td><td>Measles, Yellow Fever, Vitamin A</td></tr>
    <tr><td>15 months</td><td>Measles 2nd dose</td></tr>
  </tbody>
</table>
<h3>Role of Community Health Workers in Immunisation</h3>
<ul>
  <li><strong>Mobilisation:</strong> Inform and motivate caregivers to bring children for vaccination</li>
  <li><strong>Defaulter tracing:</strong> Follow up children who missed scheduled vaccines</li>
  <li><strong>Cold chain support:</strong> Assist in maintaining vaccine cold chain at community level</li>
  <li><strong>Record keeping:</strong> Help maintain vaccination registers and child health cards</li>
  <li><strong>Rumour management:</strong> Address vaccine hesitancy and misinformation</li>
</ul>',
                    ],
                ],
            ],
            [
                'title'       => 'Behaviour Change Communication for Health',
                'description' => 'Applying behaviour change communication (BCC) strategies to promote healthy behaviours in communities.',
                'subtopics'   => [
                    [
                        'title'   => 'Principles of Behaviour Change Communication',
                        'content' => '<h2>Principles of Behaviour Change Communication</h2>
<p>Behaviour Change Communication (BCC) is a strategic communication approach that uses a mix of communication channels and activities to develop positive behaviours, promote and sustain individual, community, and societal behaviour change.</p>
<h3>The BCC Process</h3>
<ol>
  <li><strong>Assess:</strong> Understand the target audience, their knowledge, attitudes, and practices (KAP)</li>
  <li><strong>Plan:</strong> Develop a communication strategy with clear objectives and messages</li>
  <li><strong>Develop:</strong> Create culturally appropriate materials and messages</li>
  <li><strong>Implement:</strong> Deliver messages through appropriate channels</li>
  <li><strong>Monitor &amp; Evaluate:</strong> Track progress and measure impact</li>
</ol>
<h3>Key BCC Models</h3>
<h4>Health Belief Model</h4>
<p>People are more likely to change behaviour when they:</p>
<ul>
  <li>Perceive themselves as susceptible to the health problem</li>
  <li>Believe the health problem is serious</li>
  <li>Believe the benefits of action outweigh the barriers</li>
  <li>Receive a cue to action (reminder, advice, illness in family)</li>
</ul>
<h4>Stages of Change (Transtheoretical Model)</h4>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#fff3e0;">
    <tr><th>Stage</th><th>Description</th><th>Communication Approach</th></tr>
  </thead>
  <tbody>
    <tr><td>Pre-contemplation</td><td>Not thinking about change</td><td>Raise awareness of the problem</td></tr>
    <tr><td>Contemplation</td><td>Thinking about change</td><td>Motivate and build confidence</td></tr>
    <tr><td>Preparation</td><td>Planning to change</td><td>Provide specific action steps</td></tr>
    <tr><td>Action</td><td>Making the change</td><td>Support and reinforce</td></tr>
    <tr><td>Maintenance</td><td>Sustaining the change</td><td>Prevent relapse; celebrate success</td></tr>
  </tbody>
</table>',
                    ],
                    [
                        'title'   => 'Conducting Community Health Education Sessions',
                        'content' => '<h2>Conducting Community Health Education Sessions</h2>
<p>Community health education sessions are structured learning events that bring community members together to share health information, discuss health issues, and promote healthy behaviours.</p>
<h3>Planning a Health Education Session</h3>
<h4>Step 1: Identify the Topic and Audience</h4>
<ul>
  <li>Choose a topic based on community health needs assessment</li>
  <li>Define your target audience (mothers, youth, men, elderly)</li>
  <li>Set clear, measurable learning objectives</li>
</ul>
<h4>Step 2: Conduct the Session</h4>
<ol>
  <li><strong>Introduction (5 min):</strong> Welcome participants, introduce yourself, state the topic</li>
  <li><strong>Assessment (5 min):</strong> Ask what participants already know (pre-test)</li>
  <li><strong>Presentation (15–20 min):</strong> Deliver key messages using participatory methods</li>
  <li><strong>Discussion (10 min):</strong> Encourage questions and group discussion</li>
  <li><strong>Demonstration (10 min):</strong> Show practical skills (e.g., handwashing technique)</li>
  <li><strong>Summary (5 min):</strong> Recap key messages; assign action steps</li>
</ol>
<h3>Participatory Methods</h3>
<ul>
  <li><strong>Group discussions:</strong> Encourage sharing of experiences and local knowledge</li>
  <li><strong>Role play:</strong> Act out health scenarios to build skills</li>
  <li><strong>Demonstrations:</strong> Show correct techniques (handwashing, ORS preparation)</li>
  <li><strong>Stories and case studies:</strong> Use local examples to illustrate health messages</li>
</ul>
<blockquote><em>Tip: Always use the local language and culturally appropriate examples. Involve community leaders to increase attendance and credibility.</em></blockquote>',
                    ],
                ],
            ],
        ];
    }

    // =========================================================================
    // LEADERSHIP COURSE TOPICS
    // =========================================================================
    private function leadershipTopics(): array
    {
        return [
            [
                'title'       => 'Foundations of Health Sector Leadership',
                'description' => 'Core leadership principles and competencies for health professionals in South Sudan.',
                'subtopics'   => [
                    [
                        'title'   => 'Leadership Styles and Their Application in Health Settings',
                        'content' => '<h2>Leadership Styles and Their Application in Health Settings</h2>
<p>Effective leadership is critical to improving health outcomes in South Sudan. Understanding different leadership styles helps health managers choose the right approach for different situations.</p>
<h3>Major Leadership Styles</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#e3f2fd;">
    <tr><th>Style</th><th>Description</th><th>Best Used When</th><th>Health Sector Example</th></tr>
  </thead>
  <tbody>
    <tr><td><strong>Transformational</strong></td><td>Inspires and motivates through vision</td><td>Driving major change or reform</td><td>Leading a health facility restructuring</td></tr>
    <tr><td><strong>Transactional</strong></td><td>Manages through rewards and accountability</td><td>Routine operations and performance management</td><td>Managing staff attendance and targets</td></tr>
    <tr><td><strong>Servant</strong></td><td>Prioritises the needs of the team</td><td>Building trust and team cohesion</td><td>Supporting frontline health workers</td></tr>
    <tr><td><strong>Situational</strong></td><td>Adapts style to the situation and team maturity</td><td>Managing diverse teams with varying skill levels</td><td>Supervising both experienced and new staff</td></tr>
    <tr><td><strong>Democratic</strong></td><td>Involves team in decision-making</td><td>Complex decisions requiring buy-in</td><td>Developing facility improvement plans</td></tr>
  </tbody>
</table>
<h3>Leadership Competencies for Health Managers</h3>
<ul>
  <li><strong>Strategic thinking:</strong> Ability to see the big picture and plan for the future</li>
  <li><strong>Communication:</strong> Clear, transparent communication with staff, patients, and stakeholders</li>
  <li><strong>Decision-making:</strong> Making timely, evidence-based decisions under pressure</li>
  <li><strong>Team building:</strong> Creating cohesive, motivated, and high-performing teams</li>
  <li><strong>Accountability:</strong> Taking responsibility for outcomes and holding others accountable</li>
  <li><strong>Adaptability:</strong> Responding effectively to changing circumstances and crises</li>
</ul>
<h3>Leadership in the South Sudan Health Context</h3>
<p>Health leaders in South Sudan face unique challenges including:</p>
<ul>
  <li>Limited resources and infrastructure</li>
  <li>High staff turnover and brain drain</li>
  <li>Conflict-affected environments</li>
  <li>Coordination with multiple humanitarian actors</li>
  <li>Community trust and cultural sensitivity</li>
</ul>
<blockquote><em>"Leadership is not about being in charge. It is about taking care of those in your charge." — Simon Sinek</em></blockquote>',
                    ],
                    [
                        'title'   => 'Strategic Planning for Health Facilities',
                        'content' => '<h2>Strategic Planning for Health Facilities</h2>
<p>Strategic planning is the process of defining an organisation\'s direction and making decisions on allocating resources to pursue this direction. For health facilities in South Sudan, strategic planning is essential for improving service delivery and achieving health outcomes.</p>
<h3>The Strategic Planning Process</h3>
<ol>
  <li><strong>Situational Analysis (Where are we now?)</strong>
    <ul>
      <li>SWOT analysis: Strengths, Weaknesses, Opportunities, Threats</li>
      <li>Review of current performance data and health indicators</li>
      <li>Stakeholder analysis and community needs assessment</li>
    </ul>
  </li>
  <li><strong>Vision and Mission (Where do we want to be?)</strong>
    <ul>
      <li>Define a clear, inspiring vision statement</li>
      <li>Develop a mission statement that describes your purpose</li>
      <li>Identify core values that guide your work</li>
    </ul>
  </li>
  <li><strong>Strategic Objectives (What will we achieve?)</strong>
    <ul>
      <li>Set SMART objectives: Specific, Measurable, Achievable, Relevant, Time-bound</li>
      <li>Align objectives with national health priorities</li>
      <li>Prioritise based on available resources</li>
    </ul>
  </li>
  <li><strong>Implementation Plan (How will we get there?)</strong>
    <ul>
      <li>Develop action plans with clear responsibilities and timelines</li>
      <li>Allocate resources (human, financial, material)</li>
      <li>Identify risks and mitigation strategies</li>
    </ul>
  </li>
  <li><strong>Monitoring and Evaluation (How will we know we are succeeding?)</strong>
    <ul>
      <li>Define key performance indicators (KPIs)</li>
      <li>Establish regular review meetings</li>
      <li>Document lessons learned and adapt the plan</li>
    </ul>
  </li>
</ol>
<h3>SWOT Analysis Template</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#f3e5f5;">
    <tr><th>Internal</th><th>External</th></tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Strengths</strong><br>What do we do well?<br>What resources do we have?</td>
      <td><strong>Opportunities</strong><br>What external factors can we leverage?<br>What trends favour us?</td>
    </tr>
    <tr>
      <td><strong>Weaknesses</strong><br>Where do we underperform?<br>What resources are lacking?</td>
      <td><strong>Threats</strong><br>What external factors could harm us?<br>What are our competitors doing?</td>
    </tr>
  </tbody>
</table>',
                    ],
                ],
            ],
            [
                'title'       => 'Human Resource Management in Health',
                'description' => 'Managing health workers effectively to improve performance, retention, and team cohesion.',
                'subtopics'   => [
                    [
                        'title'   => 'Recruitment, Supervision, and Performance Management',
                        'content' => '<h2>Recruitment, Supervision, and Performance Management</h2>
<p>Effective human resource management is the backbone of a well-functioning health facility. In South Sudan, where health worker shortages are acute, managing existing staff well is critical.</p>
<h3>Recruitment Best Practices</h3>
<ul>
  <li>Define clear job descriptions with required qualifications and competencies</li>
  <li>Use transparent, merit-based selection processes</li>
  <li>Involve community representatives in recruitment where appropriate</li>
  <li>Conduct structured interviews with standardised questions</li>
  <li>Verify qualifications and references before appointment</li>
</ul>
<h3>Supportive Supervision</h3>
<p>Supportive supervision is a collaborative approach that focuses on improving quality of care through regular, structured interaction between supervisors and health workers.</p>
<h4>Key Elements of Supportive Supervision</h4>
<ol>
  <li><strong>Regular visits:</strong> Scheduled and unannounced facility visits</li>
  <li><strong>Observation:</strong> Directly observe clinical and administrative practices</li>
  <li><strong>Feedback:</strong> Provide constructive, specific, and timely feedback</li>
  <li><strong>Problem-solving:</strong> Jointly identify and address challenges</li>
  <li><strong>Documentation:</strong> Record findings and agreed action points</li>
  <li><strong>Follow-up:</strong> Review progress on previous action points</li>
</ol>
<h3>Performance Management Cycle</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#e8f5e9;">
    <tr><th>Phase</th><th>Activities</th><th>Frequency</th></tr>
  </thead>
  <tbody>
    <tr><td>Planning</td><td>Set performance objectives and KPIs with each staff member</td><td>Annually / at start of contract</td></tr>
    <tr><td>Monitoring</td><td>Track progress against objectives; provide ongoing feedback</td><td>Monthly / quarterly</td></tr>
    <tr><td>Review</td><td>Formal performance appraisal; document achievements and gaps</td><td>Annually</td></tr>
    <tr><td>Development</td><td>Identify training needs; create individual development plans</td><td>Annually</td></tr>
    <tr><td>Recognition</td><td>Acknowledge and reward good performance</td><td>Ongoing</td></tr>
  </tbody>
</table>',
                    ],
                    [
                        'title'   => 'Staff Motivation and Retention Strategies',
                        'content' => '<h2>Staff Motivation and Retention Strategies</h2>
<p>Retaining skilled health workers is one of the greatest challenges facing health facilities in South Sudan. Understanding what motivates health workers helps managers create an environment where staff want to stay and perform well.</p>
<h3>Maslow\'s Hierarchy of Needs Applied to Health Workers</h3>
<ul>
  <li><strong>Physiological:</strong> Adequate salary, safe working conditions, access to food and water</li>
  <li><strong>Safety:</strong> Job security, protection from violence, safe transport</li>
  <li><strong>Social:</strong> Teamwork, collegial relationships, community respect</li>
  <li><strong>Esteem:</strong> Recognition, professional development, career advancement</li>
  <li><strong>Self-actualisation:</strong> Meaningful work, autonomy, contributing to health outcomes</li>
</ul>
<h3>Practical Motivation Strategies</h3>
<h4>Financial Incentives</h4>
<ul>
  <li>Competitive and timely salary payment</li>
  <li>Performance-based bonuses where feasible</li>
  <li>Housing and transport allowances</li>
  <li>Health insurance for staff and dependants</li>
</ul>
<h4>Non-Financial Incentives</h4>
<ul>
  <li>Public recognition and awards for outstanding performance</li>
  <li>Opportunities for training and professional development</li>
  <li>Clear career progression pathways</li>
  <li>Flexible working arrangements where possible</li>
  <li>Supportive and respectful management style</li>
  <li>Safe and well-equipped working environment</li>
</ul>
<h3>Addressing Staff Burnout</h3>
<p>Health workers in South Sudan are at high risk of burnout due to heavy workloads, limited resources, and exposure to trauma. Signs of burnout include:</p>
<ul>
  <li>Emotional exhaustion and cynicism</li>
  <li>Reduced productivity and quality of care</li>
  <li>Increased absenteeism</li>
  <li>Physical symptoms (headaches, fatigue)</li>
</ul>
<p>Managers can address burnout by ensuring adequate staffing, providing psychosocial support, rotating difficult assignments, and creating a culture of open communication.</p>',
                    ],
                ],
            ],
            [
                'title'       => 'Health Financing and Resource Management',
                'description' => 'Understanding health financing mechanisms and managing resources effectively in the South Sudan health system.',
                'subtopics'   => [
                    [
                        'title'   => 'Health Financing in South Sudan',
                        'content' => '<h2>Health Financing in South Sudan</h2>
<p>Health financing refers to the mobilisation, accumulation, and allocation of money to cover the health needs of the people. In South Sudan, health financing is a critical challenge given the country\'s limited domestic resources and heavy dependence on external funding.</p>
<h3>Sources of Health Financing in South Sudan</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#fff8e1;">
    <tr><th>Source</th><th>Description</th><th>Challenges</th></tr>
  </thead>
  <tbody>
    <tr><td>Government budget</td><td>National and state government allocations to health</td><td>Low and unpredictable; often below 15% Abuja target</td></tr>
    <tr><td>Donor funding</td><td>Bilateral and multilateral aid (USAID, EU, DFID, etc.)</td><td>Fragmented; tied to donor priorities; not always sustainable</td></tr>
    <tr><td>NGO/INGO funding</td><td>International NGOs providing direct health services</td><td>Parallel systems; coordination challenges</td></tr>
    <tr><td>Out-of-pocket payments</td><td>Direct payments by patients at point of care</td><td>Catastrophic for poor households; barrier to access</td></tr>
    <tr><td>Community health funds</td><td>Community-based pooling mechanisms</td><td>Limited scale; management capacity constraints</td></tr>
  </tbody>
</table>
<h3>Key Health Financing Functions</h3>
<ol>
  <li><strong>Revenue collection:</strong> Raising funds from various sources</li>
  <li><strong>Pooling:</strong> Accumulating and managing revenues to spread financial risk</li>
  <li><strong>Purchasing:</strong> Allocating funds to health services and providers</li>
</ol>
<h3>Universal Health Coverage (UHC)</h3>
<p>South Sudan is committed to achieving Universal Health Coverage — ensuring all people have access to quality health services without financial hardship. Key strategies include:</p>
<ul>
  <li>Increasing domestic health budget allocation</li>
  <li>Developing community health insurance schemes</li>
  <li>Reducing out-of-pocket payments through subsidies</li>
  <li>Improving efficiency in health spending</li>
</ul>',
                    ],
                    [
                        'title'   => 'Budget Planning and Financial Management for Health Managers',
                        'content' => '<h2>Budget Planning and Financial Management for Health Managers</h2>
<p>Effective financial management ensures that limited health resources are used efficiently and transparently to achieve the best possible health outcomes.</p>
<h3>The Budget Cycle</h3>
<ol>
  <li><strong>Budget preparation:</strong> Estimate costs for planned activities; align with strategic plan</li>
  <li><strong>Budget approval:</strong> Submit for review and approval by relevant authority</li>
  <li><strong>Budget execution:</strong> Implement activities according to approved budget</li>
  <li><strong>Budget monitoring:</strong> Track expenditure against budget; identify variances</li>
  <li><strong>Budget reporting:</strong> Prepare financial reports for accountability</li>
  <li><strong>Budget review:</strong> Evaluate performance; inform next budget cycle</li>
</ol>
<h3>Key Financial Management Principles</h3>
<ul>
  <li><strong>Transparency:</strong> All financial transactions are documented and open to scrutiny</li>
  <li><strong>Accountability:</strong> Those managing funds are responsible for their use</li>
  <li><strong>Efficiency:</strong> Resources are used to achieve maximum health impact</li>
  <li><strong>Equity:</strong> Resources are allocated fairly to reach those most in need</li>
  <li><strong>Sustainability:</strong> Financial plans are realistic and can be maintained over time</li>
</ul>
<h3>Common Financial Management Challenges</h3>
<ul>
  <li>Delayed fund releases from central government</li>
  <li>Inadequate financial management skills among health managers</li>
  <li>Weak internal controls leading to misuse of funds</li>
  <li>Poor record-keeping and documentation</li>
  <li>Lack of financial management software and tools</li>
</ul>
<h3>Practical Tips for Health Facility Managers</h3>
<ul>
  <li>Maintain a simple cash book recording all income and expenditure</li>
  <li>Require receipts for all purchases above a minimum threshold</li>
  <li>Conduct monthly reconciliation of accounts</li>
  <li>Involve staff in budget planning to increase ownership</li>
  <li>Report financial irregularities promptly to supervisors</li>
</ul>',
                    ],
                ],
            ],
        ];
    }

    // =========================================================================
    // COMMUNICATION COURSE TOPICS
    // =========================================================================
    private function communicationTopics(): array
    {
        return [
            [
                'title'       => 'Foundations of Health Communication',
                'description' => 'Core principles and models of effective health communication for behaviour change.',
                'subtopics'   => [
                    [
                        'title'   => 'Principles of Effective Health Communication',
                        'content' => '<h2>Principles of Effective Health Communication</h2>
<p>Health communication is the study and use of communication strategies to inform and influence individual and community decisions that enhance health. Effective health communication is essential for promoting healthy behaviours and improving health outcomes in South Sudan.</p>
<h3>Core Principles</h3>
<ul>
  <li><strong>Audience-centred:</strong> Messages are designed based on the needs, values, and preferences of the target audience</li>
  <li><strong>Evidence-based:</strong> Communication is grounded in accurate, up-to-date health information</li>
  <li><strong>Culturally appropriate:</strong> Messages respect local culture, language, and beliefs</li>
  <li><strong>Clear and simple:</strong> Messages use plain language and avoid jargon</li>
  <li><strong>Actionable:</strong> Messages tell people what specific action to take</li>
  <li><strong>Consistent:</strong> The same core messages are delivered across all channels</li>
  <li><strong>Credible:</strong> Messages come from trusted sources</li>
</ul>
<h3>The Communication Process</h3>
<p>Effective communication involves:</p>
<ol>
  <li><strong>Sender:</strong> The person or organisation delivering the message</li>
  <li><strong>Message:</strong> The health information or call to action</li>
  <li><strong>Channel:</strong> The medium used to deliver the message (radio, interpersonal, print)</li>
  <li><strong>Receiver:</strong> The target audience</li>
  <li><strong>Feedback:</strong> The audience\'s response to the message</li>
  <li><strong>Noise:</strong> Barriers that interfere with communication (language, culture, literacy)</li>
</ol>
<h3>Communication Channels in South Sudan</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#e8eaf6;">
    <tr><th>Channel</th><th>Reach</th><th>Best For</th><th>Limitations</th></tr>
  </thead>
  <tbody>
    <tr><td>Community radio</td><td>Wide</td><td>Mass awareness campaigns</td><td>One-way; limited feedback</td></tr>
    <tr><td>Interpersonal communication</td><td>Individual/small group</td><td>Behaviour change; counselling</td><td>Time-intensive; limited scale</td></tr>
    <tr><td>Community meetings</td><td>Community level</td><td>Group education; mobilisation</td><td>Requires community access</td></tr>
    <tr><td>Printed materials</td><td>Literate audiences</td><td>Reference materials; job aids</td><td>Limited for low-literacy populations</td></tr>
    <tr><td>Mobile phones/SMS</td><td>Growing</td><td>Reminders; appointment alerts</td><td>Requires phone ownership</td></tr>
    <tr><td>Social media</td><td>Urban/educated</td><td>Youth engagement; advocacy</td><td>Limited internet access in rural areas</td></tr>
  </tbody>
</table>',
                    ],
                    [
                        'title'   => 'Designing Health Messages for Diverse Audiences',
                        'content' => '<h2>Designing Health Messages for Diverse Audiences</h2>
<p>Effective health messages must be tailored to the specific characteristics, needs, and preferences of the target audience. A one-size-fits-all approach rarely works in health communication.</p>
<h3>Audience Segmentation</h3>
<p>Divide your target population into distinct groups based on:</p>
<ul>
  <li><strong>Demographics:</strong> Age, sex, education level, occupation</li>
  <li><strong>Geography:</strong> Urban vs. rural; specific counties or communities</li>
  <li><strong>Behaviour:</strong> Current practices, stage of change, risk level</li>
  <li><strong>Psychographics:</strong> Values, beliefs, attitudes, motivations</li>
</ul>
<h3>Key Audience Groups in South Sudan Health Communication</h3>
<h4>Mothers and Caregivers</h4>
<ul>
  <li>Focus on child health, nutrition, immunisation, and maternal health</li>
  <li>Use visual materials and demonstrations</li>
  <li>Engage through women\'s groups and antenatal care visits</li>
</ul>
<h4>Men and Fathers</h4>
<ul>
  <li>Address male involvement in maternal and child health</li>
  <li>Use community meetings, sports events, and radio</li>
  <li>Frame messages around family responsibility and provider role</li>
</ul>
<h4>Youth and Adolescents</h4>
<ul>
  <li>Focus on sexual and reproductive health, substance abuse, mental health</li>
  <li>Use peer education, social media, and youth-friendly services</li>
  <li>Involve youth in message design</li>
</ul>
<h3>Message Development Framework (SOCO)</h3>
<p>Use the SOCO (Single Overriding Communication Objective) approach:</p>
<ol>
  <li>Identify the <strong>one key behaviour</strong> you want to change</li>
  <li>Determine the <strong>main barrier</strong> to that behaviour</li>
  <li>Craft a message that <strong>addresses the barrier</strong> and motivates action</li>
  <li>Test the message with the <strong>target audience</strong> before wide distribution</li>
  <li>Refine based on <strong>feedback</strong></li>
</ol>
<blockquote><em>Example SOCO: "Mothers in Juba who deliver at home should deliver at a health facility because skilled birth attendants save lives."</em></blockquote>',
                    ],
                ],
            ],
            [
                'title'       => 'Community Engagement and Mobilisation',
                'description' => 'Strategies for engaging communities and mobilising them for health action.',
                'subtopics'   => [
                    [
                        'title'   => 'Community Engagement Strategies',
                        'content' => '<h2>Community Engagement Strategies</h2>
<p>Community engagement is the process of working collaboratively with community members to address issues that affect their well-being. In health, effective community engagement leads to better health outcomes, increased trust, and more sustainable programmes.</p>
<h3>Levels of Community Engagement</h3>
<ol>
  <li><strong>Inform:</strong> Provide communities with balanced information to help them understand the health issue</li>
  <li><strong>Consult:</strong> Obtain community feedback on health plans and decisions</li>
  <li><strong>Involve:</strong> Work directly with communities throughout the process</li>
  <li><strong>Collaborate:</strong> Partner with communities in each aspect of the decision</li>
  <li><strong>Empower:</strong> Place final decision-making in the hands of the community</li>
</ol>
<h3>Key Community Engagement Approaches</h3>
<h4>Community Health Committees (CHCs)</h4>
<p>CHCs are groups of community members who represent the health interests of their community. They:</p>
<ul>
  <li>Provide a link between the community and health facilities</li>
  <li>Participate in health planning and priority-setting</li>
  <li>Monitor health service quality and report issues</li>
  <li>Mobilise community resources for health activities</li>
</ul>
<h4>Community Dialogues</h4>
<p>Structured conversations that bring community members together to discuss health issues, share experiences, and develop collective solutions.</p>
<h4>Community-Led Total Sanitation (CLTS)</h4>
<p>A participatory approach that mobilises communities to eliminate open defecation through collective action rather than external subsidies.</p>
<h3>Barriers to Community Engagement</h3>
<ul>
  <li>Lack of trust between communities and health authorities</li>
  <li>Language and cultural barriers</li>
  <li>Limited time and resources for engagement activities</li>
  <li>Tokenistic participation without real influence</li>
  <li>Conflict and insecurity limiting community access</li>
</ul>',
                    ],
                    [
                        'title'   => 'Working with Community and Religious Leaders',
                        'content' => '<h2>Working with Community and Religious Leaders</h2>
<p>Community and religious leaders are powerful influencers in South Sudan. Their support can make or break health programmes. Engaging them effectively is essential for successful health communication and community mobilisation.</p>
<h3>Why Leaders Matter</h3>
<ul>
  <li>They are trusted and respected by community members</li>
  <li>They can reach large numbers of people quickly</li>
  <li>Their endorsement increases acceptance of health messages</li>
  <li>They can address rumours and misinformation</li>
  <li>They can mobilise community resources and volunteers</li>
</ul>
<h3>Types of Community Leaders</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#fce4ec;">
    <tr><th>Type</th><th>Role</th><th>Engagement Approach</th></tr>
  </thead>
  <tbody>
    <tr><td>Traditional chiefs</td><td>Governance and dispute resolution</td><td>Formal meetings; seek endorsement for health activities</td></tr>
    <tr><td>Religious leaders (pastors, imams)</td><td>Spiritual guidance; moral authority</td><td>Engage through faith-based organisations; share health messages in services</td></tr>
    <tr><td>Women\'s group leaders</td><td>Mobilise women; address gender issues</td><td>Partner for community health education; involve in planning</td></tr>
    <tr><td>Youth leaders</td><td>Influence peers; community activism</td><td>Peer education; youth health clubs</td></tr>
    <tr><td>Teachers</td><td>Educate children; community respect</td><td>School health programmes; parent engagement</td></tr>
  </tbody>
</table>
<h3>Steps for Engaging Leaders</h3>
<ol>
  <li><strong>Identify:</strong> Map key leaders in the community</li>
  <li><strong>Approach:</strong> Request a meeting through appropriate channels; respect protocols</li>
  <li><strong>Inform:</strong> Share health information clearly and honestly</li>
  <li><strong>Listen:</strong> Understand their concerns and perspectives</li>
  <li><strong>Involve:</strong> Ask for their active participation in health activities</li>
  <li><strong>Acknowledge:</strong> Publicly recognise their contribution</li>
  <li><strong>Maintain:</strong> Keep leaders informed and engaged throughout the programme</li>
</ol>
<blockquote><em>Tip: Never bypass traditional leaders. Even if you disagree with some practices, building a respectful relationship is essential for long-term health programme success.</em></blockquote>',
                    ],
                ],
            ],
            [
                'title'       => 'Digital and Social Media for Health Communication',
                'description' => 'Using digital tools and social media platforms to amplify health messages and engage communities.',
                'subtopics'   => [
                    [
                        'title'   => 'Social Media Platforms for Health Communication',
                        'content' => '<h2>Social Media Platforms for Health Communication</h2>
<p>Social media is increasingly being used for health communication in South Sudan, particularly in urban areas and among educated populations. Understanding how to use these platforms effectively can significantly extend the reach of health messages.</p>
<h3>Key Platforms and Their Uses</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#e0f7fa;">
    <tr><th>Platform</th><th>Primary Users</th><th>Best Health Uses</th><th>Content Types</th></tr>
  </thead>
  <tbody>
    <tr><td>Facebook</td><td>Adults 25–45</td><td>Community groups; health campaigns; event promotion</td><td>Posts, videos, live streams, events</td></tr>
    <tr><td>WhatsApp</td><td>All ages with smartphones</td><td>Community health groups; rapid information sharing; CHW networks</td><td>Text, images, voice notes, videos</td></tr>
    <tr><td>Twitter/X</td><td>Educated professionals; journalists</td><td>Advocacy; policy engagement; health news</td><td>Short posts, threads, links</td></tr>
    <tr><td>YouTube</td><td>Youth; educated adults</td><td>Health education videos; training materials</td><td>Videos, tutorials, documentaries</td></tr>
    <tr><td>TikTok</td><td>Youth 15–30</td><td>Youth health messaging; viral campaigns</td><td>Short videos, challenges</td></tr>
  </tbody>
</table>
<h3>Principles for Effective Social Media Health Communication</h3>
<ul>
  <li><strong>Know your audience:</strong> Tailor content to the platform\'s user demographics</li>
  <li><strong>Be consistent:</strong> Post regularly to maintain engagement</li>
  <li><strong>Use visuals:</strong> Images and videos get significantly more engagement than text alone</li>
  <li><strong>Keep it simple:</strong> Short, clear messages perform better</li>
  <li><strong>Engage:</strong> Respond to comments and questions promptly</li>
  <li><strong>Verify before sharing:</strong> Only share accurate, verified health information</li>
  <li><strong>Monitor:</strong> Track engagement metrics to understand what works</li>
</ul>
<h3>Combating Health Misinformation Online</h3>
<p>Social media can spread health misinformation rapidly. Strategies to counter misinformation include:</p>
<ul>
  <li>Proactively share accurate information before rumours spread</li>
  <li>Clearly label content from official health authorities</li>
  <li>Engage directly with misinformation by providing corrections with evidence</li>
  <li>Partner with trusted influencers to amplify correct information</li>
  <li>Report harmful health misinformation to platform administrators</li>
</ul>',
                    ],
                    [
                        'title'   => 'Evaluating Health Communication Campaigns',
                        'content' => '<h2>Evaluating Health Communication Campaigns</h2>
<p>Evaluation is essential to determine whether health communication campaigns are achieving their intended objectives and to improve future campaigns. Without evaluation, it is impossible to know if resources are being used effectively.</p>
<h3>Types of Evaluation</h3>
<h4>1. Process Evaluation (Was the campaign implemented as planned?)</h4>
<ul>
  <li>Were activities implemented on time and within budget?</li>
  <li>How many people were reached?</li>
  <li>Were materials distributed as planned?</li>
  <li>What were the implementation challenges?</li>
</ul>
<h4>2. Outcome Evaluation (Did the campaign change knowledge, attitudes, or behaviour?)</h4>
<ul>
  <li>Did awareness of the health issue increase?</li>
  <li>Did attitudes towards the health behaviour change?</li>
  <li>Did the target behaviour change?</li>
  <li>Were health outcomes improved?</li>
</ul>
<h4>3. Impact Evaluation (Did the campaign contribute to long-term health improvements?)</h4>
<ul>
  <li>Did disease incidence or prevalence change?</li>
  <li>Were health system utilisation rates affected?</li>
  <li>What was the cost-effectiveness of the campaign?</li>
</ul>
<h3>Evaluation Methods</h3>
<table border="1" cellpadding="8" cellspacing="0" style="width:100%; border-collapse:collapse;">
  <thead style="background:#f1f8e9;">
    <tr><th>Method</th><th>Description</th><th>Best For</th></tr>
  </thead>
  <tbody>
    <tr><td>Surveys/KAP studies</td><td>Structured questionnaires measuring knowledge, attitudes, practices</td><td>Outcome evaluation; baseline and endline comparison</td></tr>
    <tr><td>Focus group discussions</td><td>In-depth group discussions with target audience</td><td>Understanding perceptions; formative research</td></tr>
    <tr><td>Observation</td><td>Direct observation of behaviours in community settings</td><td>Behaviour change verification</td></tr>
    <tr><td>Routine data review</td><td>Analysis of health facility data (ANC attendance, vaccination rates)</td><td>Impact evaluation</td></tr>
    <tr><td>Social media analytics</td><td>Platform-provided data on reach, engagement, and demographics</td><td>Digital campaign process evaluation</td></tr>
  </tbody>
</table>
<h3>Developing an Evaluation Plan</h3>
<ol>
  <li>Define evaluation questions aligned with campaign objectives</li>
  <li>Select appropriate evaluation methods and tools</li>
  <li>Establish baseline data before the campaign begins</li>
  <li>Collect data at midpoint and end of campaign</li>
  <li>Analyse data and document findings</li>
  <li>Share results with stakeholders and use to improve future campaigns</li>
</ol>',
                    ],
                ],
            ],
        ];
    }
}
