<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\SelfPaced\CourseCategory;
use Illuminate\Support\Str;

/**
 * SelfPacedCategorySeeder
 *
 * Seeds 5 sample course categories for the Self-Paced Learning Portal.
 * Categories: Health, Leadership, Finance, Technology, Communication.
 *
 * Requirements: 15.2
 */
class SelfPacedCategorySeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            [
                'name'        => 'Health',
                'slug'        => 'health',
                'description' => 'Courses covering public health, disease prevention, nutrition, maternal health, and community health promotion in South Sudan.',
                'icon'        => 'fa-heartbeat',
                'color'       => '#e74c3c',
                'sort_order'  => 1,
            ],
            [
                'name'        => 'Leadership',
                'slug'        => 'leadership',
                'description' => 'Courses on leadership development, governance, strategic management, and organisational effectiveness for health sector professionals.',
                'icon'        => 'fa-users',
                'color'       => '#2980b9',
                'sort_order'  => 2,
            ],
            [
                'name'        => 'Finance',
                'slug'        => 'finance',
                'description' => 'Courses on health financing, budgeting, financial management, and resource mobilisation for health organisations.',
                'icon'        => 'fa-chart-line',
                'color'       => '#27ae60',
                'sort_order'  => 3,
            ],
            [
                'name'        => 'Technology',
                'slug'        => 'technology',
                'description' => 'Courses on digital health tools, health information systems, telemedicine, and technology adoption in healthcare settings.',
                'icon'        => 'fa-laptop-medical',
                'color'       => '#8e44ad',
                'sort_order'  => 4,
            ],
            [
                'name'        => 'Communication',
                'slug'        => 'communication',
                'description' => 'Courses on health communication, community engagement, behaviour change communication, and advocacy skills.',
                'icon'        => 'fa-comments',
                'color'       => '#f39c12',
                'sort_order'  => 5,
            ],
        ];

        foreach ($categories as $data) {
            CourseCategory::firstOrCreate(
                ['slug' => $data['slug']],
                $data
            );
        }

        $this->command->info('SelfPacedCategorySeeder: 5 categories seeded.');
    }
}
