<?php

namespace Database\Seeders;

use App\Models\User;
use App\Models\Course;
use App\Models\Announcement;
use App\Models\CourseSession;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        // Create Admin User
        $admin = User::create([
            'name' => 'Admin Edunetra',
            'email' => 'admin@edunetra.id',
            'password' => Hash::make('password'),
            'role' => 'admin',
            'is_active' => true,
        ]);

        // Create Teacher Users
        $teacher1 = User::create([
            'name' => 'Dr. Sarah Johnson',
            'email' => 'sarah@edunetra.id',
            'password' => Hash::make('password'),
            'role' => 'teacher',
            'bio' => 'Experienced English teacher with 10+ years in language education.',
            'is_active' => true,
        ]);

        $teacher2 = User::create([
            'name' => 'Prof. Michael Chen',
            'email' => 'michael@edunetra.id',
            'password' => Hash::make('password'),
            'role' => 'teacher',
            'bio' => 'Computer Science professor specializing in web development.',
            'is_active' => true,
        ]);

        // Create Student Users
        $student1 = User::create([
            'name' => 'John Doe',
            'email' => 'john@example.com',
            'password' => Hash::make('password'),
            'role' => 'student',
            'is_active' => true,
        ]);

        $student2 = User::create([
            'name' => 'Jane Smith',
            'email' => 'jane@example.com',
            'password' => Hash::make('password'),
            'role' => 'student',
            'is_active' => true,
        ]);

        // Create Courses
        $courses = [
            [
                'title' => 'English for Young Learner',
                'description' => 'Comprehensive English learning program designed for young students to build strong foundation in English language skills. This course focuses on interactive learning methods suitable for visually impaired students.',
                'slug' => 'english-for-young-learner',
                'level' => 'beginner',
                'status' => 'published',
                'duration_weeks' => 8,
                'price' => 0,
                'teacher_id' => $teacher1->id,
                'max_students' => 20,
                'start_date' => now()->addDays(7),
                'end_date' => now()->addDays(63),
                'tags' => ['English', 'Language', 'Young Learner', 'Visual Impairment'],
                'image' => 'https://images.unsplash.com/photo-1503676260728-1c00da094a0b?w=800&h=600&fit=crop',
            ],
            [
                'title' => 'Web Development Fundamentals',
                'description' => 'Learn the basics of web development including HTML, CSS, and JavaScript. This course is designed with accessibility in mind, teaching students how to create inclusive web applications.',
                'slug' => 'web-development-fundamentals',
                'level' => 'intermediate',
                'status' => 'published',
                'duration_weeks' => 8,
                'price' => 0,
                'teacher_id' => $teacher2->id,
                'max_students' => 15,
                'start_date' => now()->addDays(14),
                'end_date' => now()->addDays(70),
                'tags' => ['Programming', 'Web Development', 'Technology', 'Accessibility'],
                'image' => 'https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=800&h=600&fit=crop',
            ],
            [
                'title' => 'Advanced English Communication',
                'description' => 'Advanced English course focusing on communication skills, presentation, and professional English for career development.',
                'slug' => 'advanced-english-communication',
                'level' => 'advanced',
                'status' => 'published',
                'duration_weeks' => 10,
                'price' => 0,
                'teacher_id' => $teacher1->id,
                'max_students' => 12,
                'start_date' => now()->addDays(21),
                'end_date' => now()->addDays(91),
                'tags' => ['English', 'Communication', 'Professional', 'Advanced'],
                'image' => 'https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=800&h=600&fit=crop',
            ],
            [
                'title' => 'Digital Literacy for Everyone',
                'description' => 'Essential digital skills course covering computer basics, internet safety, and digital tools for daily life and work.',
                'slug' => 'digital-literacy-for-everyone',
                'level' => 'beginner',
                'status' => 'published',
                'duration_weeks' => 6,
                'price' => 0,
                'teacher_id' => $teacher2->id,
                'max_students' => 25,
                'start_date' => now()->addDays(10),
                'end_date' => now()->addDays(52),
                'tags' => ['Digital Literacy', 'Computer Skills', 'Internet', 'Technology'],
                'image' => 'https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=800&h=600&fit=crop',
            ],
            [
                'title' => 'Creative Writing Workshop',
                'description' => 'Explore your creativity through writing. Learn various writing techniques, storytelling, and develop your unique voice.',
                'slug' => 'creative-writing-workshop',
                'level' => 'intermediate',
                'status' => 'draft',
                'duration_weeks' => 8,
                'price' => 0,
                'teacher_id' => $teacher1->id,
                'max_students' => 15,
                'start_date' => now()->addDays(30),
                'end_date' => now()->addDays(86),
                'tags' => ['Writing', 'Creative', 'Literature', 'Storytelling'],
                'image' => 'https://images.unsplash.com/photo-1455390582262-044cdead277a?w=800&h=600&fit=crop',
            ],
            [
                'title' => 'Introduction to Data Science',
                'description' => 'Learn the fundamentals of data science including data analysis, visualization, and basic machine learning concepts.',
                'slug' => 'introduction-to-data-science',
                'level' => 'intermediate',
                'status' => 'published',
                'duration_weeks' => 14,
                'price' => 0,
                'teacher_id' => $teacher2->id,
                'max_students' => 10,
                'start_date' => now()->addDays(28),
                'end_date' => now()->addDays(126),
                'tags' => ['Data Science', 'Analytics', 'Python', 'Machine Learning'],
                'image' => 'https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=800&h=600&fit=crop',
            ]
        ];

        $createdCourses = [];
        foreach ($courses as $courseData) {
            $createdCourses[] = Course::create($courseData);
        }

        $course1 = $createdCourses[0]; // English for Young Learner
        $course2 = $createdCourses[1]; // Web Development Fundamentals

        // Create Course Sessions for English Course
        $englishSessions = [
            [
                'title' => 'Introduction to English Alphabet',
                'description' => 'Learn the English alphabet with audio pronunciation and tactile methods',
                'content' => '<h2>Welcome to English Learning!</h2><p>In this session, we will explore the English alphabet using multiple sensory approaches:</p><ul><li>Audio pronunciation of each letter</li><li>Tactile letter recognition</li><li>Simple words starting with each letter</li><li>Interactive exercises and games</li></ul><p><strong>Learning Objectives:</strong></p><ol><li>Recognize all 26 letters of the English alphabet</li><li>Pronounce each letter correctly</li><li>Identify letters through touch and sound</li></ol>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Alphabet Song', 'content' => '/audio/alphabet-song.mp3'],
                    ['type' => 'text', 'title' => 'Letter Practice Sheet', 'content' => 'Practice writing and recognizing letters A-Z'],
                ]
            ],
            [
                'title' => 'Basic Vocabulary - Family & Friends',
                'description' => 'Learn essential vocabulary about family members and friendship',
                'content' => '<h2>Family and Friends Vocabulary</h2><p>This session introduces important words about people in our lives:</p><h3>Family Members:</h3><ul><li>Mother, Father, Sister, Brother</li><li>Grandmother, Grandfather</li><li>Aunt, Uncle, Cousin</li></ul><h3>Friends and Relationships:</h3><ul><li>Friend, Best friend</li><li>Classmate, Teacher</li><li>Neighbor</li></ul><p><strong>Activities:</strong></p><ol><li>Listen and repeat vocabulary</li><li>Describe your family</li><li>Role-play conversations</li></ol>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Family Vocabulary Audio', 'content' => '/audio/family-vocab.mp3'],
                    ['type' => 'text', 'title' => 'Family Tree Exercise', 'content' => 'Create your own family tree using new vocabulary'],
                ]
            ],
            [
                'title' => 'Numbers and Counting',
                'description' => 'Master numbers 1-100 with practical applications',
                'content' => '<h2>Numbers and Counting</h2><p>Learn to count and use numbers in everyday situations:</p><h3>Numbers 1-20:</h3><p>Focus on pronunciation and recognition of basic numbers</p><h3>Numbers 21-100:</h3><p>Learn patterns and counting by tens</p><h3>Practical Applications:</h3><ul><li>Telling time</li><li>Counting objects</li><li>Basic math operations</li><li>Phone numbers and addresses</li></ul>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Counting Song', 'content' => '/audio/counting-song.mp3'],
                    ['type' => 'text', 'title' => 'Number Practice', 'content' => 'Practice exercises for number recognition'],
                ]
            ],
            [
                'title' => 'Colors and Shapes',
                'description' => 'Explore colors and basic shapes through descriptive language',
                'content' => '<h2>Colors and Shapes</h2><p>Learn to describe the world around us using colors and shapes:</p><h3>Basic Colors:</h3><ul><li>Red, Blue, Yellow, Green</li><li>Black, White, Gray</li><li>Orange, Purple, Pink, Brown</li></ul><h3>Basic Shapes:</h3><ul><li>Circle, Square, Triangle</li><li>Rectangle, Oval</li><li>Star, Heart</li></ul><h3>Descriptive Activities:</h3><p>Practice describing objects using color and shape vocabulary</p>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Colors Song', 'content' => '/audio/colors-song.mp3'],
                    ['type' => 'text', 'title' => 'Shape Recognition', 'content' => 'Tactile shape identification exercises'],
                ]
            ],
            [
                'title' => 'Daily Activities and Routines',
                'description' => 'Learn vocabulary for daily activities and time expressions',
                'content' => '<h2>Daily Activities and Routines</h2><p>Express your daily routine using English:</p><h3>Daily Activities:</h3><ul><li>Wake up, Get dressed, Eat breakfast</li><li>Go to school, Study, Play</li><li>Eat lunch, Do homework</li><li>Eat dinner, Watch TV, Go to bed</li></ul><h3>Time Expressions:</h3><ul><li>In the morning, In the afternoon, In the evening</li><li>Before, After, During</li><li>Early, Late, On time</li></ul>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Daily Routine Audio', 'content' => '/audio/daily-routine.mp3'],
                    ['type' => 'text', 'title' => 'My Daily Schedule', 'content' => 'Create your own daily schedule in English'],
                ]
            ],
            [
                'title' => 'Food and Drinks',
                'description' => 'Vocabulary for food, drinks, and meal times',
                'content' => '<h2>Food and Drinks</h2><p>Learn to talk about food and express preferences:</p><h3>Common Foods:</h3><ul><li>Fruits: Apple, Banana, Orange</li><li>Vegetables: Carrot, Tomato, Lettuce</li><li>Proteins: Chicken, Fish, Eggs</li><li>Grains: Rice, Bread, Pasta</li></ul><h3>Drinks:</h3><ul><li>Water, Milk, Juice</li><li>Tea, Coffee</li></ul><h3>Expressing Preferences:</h3><p>I like... I don\'t like... My favorite food is...</p>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Food Vocabulary', 'content' => '/audio/food-vocab.mp3'],
                    ['type' => 'text', 'title' => 'Menu Reading', 'content' => 'Practice reading simple menus'],
                ]
            ],
            [
                'title' => 'Simple Conversations',
                'description' => 'Practice basic conversational English and greetings',
                'content' => '<h2>Simple Conversations</h2><p>Learn to have basic conversations in English:</p><h3>Greetings:</h3><ul><li>Hello, Hi, Good morning</li><li>How are you? I\'m fine, thank you</li><li>Nice to meet you</li></ul><h3>Basic Questions:</h3><ul><li>What\'s your name? My name is...</li><li>How old are you? I am ... years old</li><li>Where are you from? I am from...</li></ul><h3>Polite Expressions:</h3><ul><li>Please, Thank you, You\'re welcome</li><li>Excuse me, I\'m sorry</li></ul>',
                'materials' => [
                    ['type' => 'audio', 'title' => 'Conversation Practice', 'content' => '/audio/conversations.mp3'],
                    ['type' => 'text', 'title' => 'Dialogue Scripts', 'content' => 'Practice conversations with a partner'],
                ]
            ],
            [
                'title' => 'Review and Assessment',
                'description' => 'Comprehensive review of all course materials and final assessment',
                'content' => '<h2>Course Review and Assessment</h2><p>Let\'s review everything we\'ve learned:</p><h3>Review Topics:</h3><ul><li>Alphabet and pronunciation</li><li>Family and friends vocabulary</li><li>Numbers and counting</li><li>Colors and shapes</li><li>Daily activities</li><li>Food and drinks</li><li>Basic conversations</li></ul><h3>Assessment Activities:</h3><ol><li>Vocabulary quiz</li><li>Pronunciation test</li><li>Simple conversation practice</li><li>Creative presentation</li></ol><p><strong>Congratulations on completing the English for Young Learner course!</strong></p>',
                'materials' => [
                    ['type' => 'text', 'title' => 'Final Quiz', 'content' => 'Comprehensive assessment of course material'],
                    ['type' => 'text', 'title' => 'Certificate Template', 'content' => 'Course completion certificate'],
                ]
            ]
        ];

        foreach ($englishSessions as $index => $sessionData) {
            CourseSession::create([
                'course_id' => $course1->id,
                'title' => $sessionData['title'],
                'description' => $sessionData['description'],
                'session_number' => $index + 1,
                'content' => $sessionData['content'],
                'materials' => $sessionData['materials'],
                'is_published' => true,
                'duration_minutes' => 90,
            ]);
        }

        // Create Course Sessions for Web Development Course
        $webSessions = [
            [
                'title' => 'Introduction to HTML',
                'description' => 'Learn the fundamentals of HTML structure and semantic markup',
                'content' => '<h2>Introduction to HTML</h2><p>HTML (HyperText Markup Language) is the foundation of web development. In this session, you will learn:</p><h3>What is HTML?</h3><ul><li>Structure of web pages</li><li>HTML elements and tags</li><li>Document structure</li></ul><h3>Basic HTML Elements:</h3><ul><li>Headings (h1-h6)</li><li>Paragraphs (p)</li><li>Links (a)</li><li>Images (img)</li><li>Lists (ul, ol, li)</li></ul><h3>Accessibility in HTML:</h3><ul><li>Semantic markup</li><li>Alt text for images</li><li>Proper heading hierarchy</li><li>ARIA labels</li></ul><p><strong>Hands-on Exercise:</strong> Create your first HTML page with proper structure and accessibility features.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'HTML Cheat Sheet', 'content' => '/files/html-cheat-sheet.pdf'],
                    ['type' => 'video', 'title' => 'HTML Basics Video', 'content' => '/videos/html-basics.mp4'],
                    ['type' => 'text', 'title' => 'Practice Exercise', 'content' => 'Create a personal webpage using HTML'],
                ]
            ],
            [
                'title' => 'CSS Styling Basics',
                'description' => 'Master CSS fundamentals for styling and layout',
                'content' => '<h2>CSS Styling Basics</h2><p>CSS (Cascading Style Sheets) controls the visual presentation of HTML. Learn to:</p><h3>CSS Fundamentals:</h3><ul><li>Selectors and properties</li><li>Colors and typography</li><li>Box model</li><li>Layout basics</li></ul><h3>Styling Techniques:</h3><ul><li>Text styling</li><li>Background and borders</li><li>Spacing (margin, padding)</li><li>Display properties</li></ul><h3>Accessibility Considerations:</h3><ul><li>Color contrast</li><li>Font sizes and readability</li><li>Focus indicators</li><li>Screen reader compatibility</li></ul><p><strong>Project:</strong> Style your HTML page with CSS to make it visually appealing and accessible.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'CSS Reference Guide', 'content' => '/files/css-reference.pdf'],
                    ['type' => 'video', 'title' => 'CSS Styling Demo', 'content' => '/videos/css-styling.mp4'],
                    ['type' => 'link', 'title' => 'CSS Color Picker', 'content' => 'https://colorpicker.me/'],
                ]
            ],
            [
                'title' => 'JavaScript Fundamentals',
                'description' => 'Introduction to JavaScript programming and interactivity',
                'content' => '<h2>JavaScript Fundamentals</h2><p>JavaScript adds interactivity to web pages. In this session:</p><h3>JavaScript Basics:</h3><ul><li>Variables and data types</li><li>Functions and events</li><li>Conditional statements</li><li>Loops and arrays</li></ul><h3>Web Interactivity:</h3><ul><li>Event handling</li><li>Form validation</li><li>Dynamic content updates</li><li>User feedback</li></ul><h3>Accessibility with JavaScript:</h3><ul><li>Keyboard navigation</li><li>Screen reader announcements</li><li>Focus management</li><li>Progressive enhancement</li></ul><p><strong>Exercise:</strong> Add interactive features to your webpage using JavaScript.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'JavaScript Quick Reference', 'content' => '/files/js-reference.pdf'],
                    ['type' => 'video', 'title' => 'JavaScript Basics Tutorial', 'content' => '/videos/js-basics.mp4'],
                    ['type' => 'text', 'title' => 'Interactive Examples', 'content' => 'Code examples for common JavaScript patterns'],
                ]
            ],
            [
                'title' => 'DOM Manipulation',
                'description' => 'Learn to dynamically modify web page content',
                'content' => '<h2>DOM Manipulation</h2><p>The Document Object Model (DOM) allows JavaScript to interact with HTML elements:</p><h3>DOM Concepts:</h3><ul><li>Selecting elements</li><li>Modifying content</li><li>Adding/removing elements</li><li>Event listeners</li></ul><h3>Practical Applications:</h3><ul><li>Dynamic content updates</li><li>Interactive forms</li><li>Show/hide elements</li><li>Animation effects</li></ul><h3>Accessibility Best Practices:</h3><ul><li>Announcing changes to screen readers</li><li>Maintaining focus order</li><li>Providing alternative interactions</li></ul><p><strong>Project:</strong> Build an interactive to-do list application.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'DOM Methods Guide', 'content' => '/files/dom-methods.pdf'],
                    ['type' => 'video', 'title' => 'DOM Manipulation Demo', 'content' => '/videos/dom-manipulation.mp4'],
                    ['type' => 'text', 'title' => 'To-Do App Starter Code', 'content' => 'Base HTML/CSS for the to-do application'],
                ]
            ],
            [
                'title' => 'Responsive Design',
                'description' => 'Create websites that work on all devices',
                'content' => '<h2>Responsive Design</h2><p>Learn to create websites that adapt to different screen sizes:</p><h3>Responsive Principles:</h3><ul><li>Mobile-first approach</li><li>Flexible layouts</li><li>Media queries</li><li>Flexible images</li></ul><h3>CSS Techniques:</h3><ul><li>Flexbox layout</li><li>CSS Grid basics</li><li>Relative units</li><li>Viewport meta tag</li></ul><h3>Accessibility Across Devices:</h3><ul><li>Touch-friendly interfaces</li><li>Readable text sizes</li><li>Adequate spacing</li><li>Device orientation support</li></ul><p><strong>Challenge:</strong> Make your website fully responsive across desktop, tablet, and mobile devices.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'Responsive Design Guide', 'content' => '/files/responsive-design.pdf'],
                    ['type' => 'video', 'title' => 'Mobile-First Design', 'content' => '/videos/mobile-first.mp4'],
                    ['type' => 'link', 'title' => 'Device Testing Tool', 'content' => 'https://responsivedesignchecker.com/'],
                ]
            ],
            [
                'title' => 'Forms and Validation',
                'description' => 'Build accessible and user-friendly web forms',
                'content' => '<h2>Forms and Validation</h2><p>Create effective web forms with proper validation:</p><h3>Form Elements:</h3><ul><li>Input types and attributes</li><li>Labels and fieldsets</li><li>Select and textarea</li><li>Buttons and submission</li></ul><h3>Validation Techniques:</h3><ul><li>HTML5 validation</li><li>JavaScript validation</li><li>Error messaging</li><li>User feedback</li></ul><h3>Form Accessibility:</h3><ul><li>Proper labeling</li><li>Error announcements</li><li>Keyboard navigation</li><li>Clear instructions</li></ul><p><strong>Project:</strong> Build a contact form with comprehensive validation and accessibility features.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'Form Best Practices', 'content' => '/files/form-best-practices.pdf'],
                    ['type' => 'video', 'title' => 'Accessible Forms Tutorial', 'content' => '/videos/accessible-forms.mp4'],
                    ['type' => 'text', 'title' => 'Form Validation Examples', 'content' => 'Code examples for different validation scenarios'],
                ]
            ],
            [
                'title' => 'APIs and AJAX',
                'description' => 'Connect your website to external data sources',
                'content' => '<h2>APIs and AJAX</h2><p>Learn to fetch and display data from external sources:</p><h3>API Concepts:</h3><ul><li>What are APIs?</li><li>REST principles</li><li>JSON data format</li><li>HTTP methods</li></ul><h3>AJAX Techniques:</h3><ul><li>Fetch API</li><li>Async/await</li><li>Error handling</li><li>Loading states</li></ul><h3>User Experience:</h3><ul><li>Loading indicators</li><li>Error messages</li><li>Offline handling</li><li>Accessibility considerations</li></ul><p><strong>Exercise:</strong> Build a weather app that fetches data from a public API.</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'API Integration Guide', 'content' => '/files/api-guide.pdf'],
                    ['type' => 'video', 'title' => 'Working with APIs', 'content' => '/videos/api-tutorial.mp4'],
                    ['type' => 'link', 'title' => 'Public APIs List', 'content' => 'https://public-apis.io/'],
                ]
            ],
            [
                'title' => 'Final Project',
                'description' => 'Showcase your skills with a comprehensive web application',
                'content' => '<h2>Final Project</h2><p>Apply everything you\'ve learned to create a complete web application:</p><h3>Project Requirements:</h3><ul><li>Responsive design</li><li>Interactive features</li><li>Form handling</li><li>API integration</li><li>Full accessibility compliance</li></ul><h3>Project Ideas:</h3><ul><li>Personal portfolio website</li><li>Task management app</li><li>Recipe finder</li><li>Local business website</li><li>Educational quiz app</li></ul><h3>Evaluation Criteria:</h3><ul><li>Code quality and organization</li><li>Design and usability</li><li>Accessibility compliance</li><li>Functionality and features</li><li>Documentation</li></ul><p><strong>Congratulations!</strong> You\'ve completed the Web Development Fundamentals course and built a real web application!</p>',
                'materials' => [
                    ['type' => 'file', 'title' => 'Project Guidelines', 'content' => '/files/final-project-guidelines.pdf'],
                    ['type' => 'text', 'title' => 'Project Checklist', 'content' => 'Comprehensive checklist for project completion'],
                    ['type' => 'link', 'title' => 'Deployment Guide', 'content' => 'https://netlify.com/docs/'],
                ]
            ]
        ];

        foreach ($webSessions as $index => $sessionData) {
            CourseSession::create([
                'course_id' => $course2->id,
                'title' => $sessionData['title'],
                'description' => $sessionData['description'],
                'session_number' => $index + 1,
                'content' => $sessionData['content'],
                'materials' => $sessionData['materials'],
                'is_published' => true,
                'duration_minutes' => 120,
            ]);
        }

        // Create sessions for other courses
        $advancedEnglish = $createdCourses[2]; // Advanced English Communication
        $digitalLiteracy = $createdCourses[3]; // Digital Literacy for Everyone
        $creativeWriting = $createdCourses[4]; // Creative Writing Workshop
        $dataScience = $createdCourses[5]; // Introduction to Data Science

        // Advanced English Communication Sessions
        $advancedEnglishSessions = [
            'Professional Email Writing', 'Business Presentations', 'Meeting Participation',
            'Negotiation Skills', 'Public Speaking', 'Interview Techniques',
            'Cross-Cultural Communication', 'Advanced Grammar', 'Writing Reports', 'Final Assessment'
        ];

        foreach ($advancedEnglishSessions as $index => $title) {
            CourseSession::create([
                'course_id' => $advancedEnglish->id,
                'title' => $title,
                'description' => "Master {$title} for professional communication",
                'session_number' => $index + 1,
                'content' => "<h2>{$title}</h2><p>Professional English communication skills for career advancement.</p>",
                'materials' => [
                    ['type' => 'text', 'title' => 'Study Materials', 'content' => "Materials for {$title}"],
                    ['type' => 'audio', 'title' => 'Audio Examples', 'content' => "/audio/{$index}.mp3"],
                ],
                'is_published' => true,
                'duration_minutes' => 75,
            ]);
        }

        // Digital Literacy Sessions
        $digitalLiteracySessions = [
            'Computer Basics', 'Internet Navigation', 'Email and Communication',
            'Online Safety', 'Digital Tools', 'File Management'
        ];

        foreach ($digitalLiteracySessions as $index => $title) {
            CourseSession::create([
                'course_id' => $digitalLiteracy->id,
                'title' => $title,
                'description' => "Learn essential {$title} skills",
                'session_number' => $index + 1,
                'content' => "<h2>{$title}</h2><p>Essential digital skills for modern life and work.</p>",
                'materials' => [
                    ['type' => 'video', 'title' => 'Tutorial Video', 'content' => "/videos/{$title}.mp4"],
                    ['type' => 'text', 'title' => 'Practice Guide', 'content' => "Step-by-step guide for {$title}"],
                ],
                'is_published' => true,
                'duration_minutes' => 60,
            ]);
        }

        // Create Announcements
        Announcement::create([
            'title' => 'New Info: Course Registration Open',
            'content' => 'Registration for new courses is now open. Join our English and Web Development programs!',
            'type' => 'new_info',
            'is_published' => true,
            'is_featured' => true,
            'created_by' => $admin->id,
            'published_at' => now(),
        ]);

        Announcement::create([
            'title' => 'Volunteer Opportunity: Teaching Assistant',
            'content' => 'We are looking for volunteers to assist in our teaching programs. Great opportunity for experience!',
            'type' => 'volunteer',
            'is_published' => true,
            'created_by' => $admin->id,
            'published_at' => now(),
        ]);

        Announcement::create([
            'title' => 'Open Recruitment: New Teachers',
            'content' => 'Edunetra is expanding! We are looking for qualified teachers to join our team.',
            'type' => 'recruitment',
            'is_published' => true,
            'created_by' => $admin->id,
            'published_at' => now(),
        ]);

        Announcement::create([
            'title' => 'Shadow Teacher Program',
            'content' => 'Join our Shadow Teacher program to gain hands-on teaching experience.',
            'type' => 'shadow_teacher',
            'is_published' => true,
            'created_by' => $admin->id,
            'published_at' => now(),
        ]);

        Announcement::create([
            'title' => 'LENTERA: Layanan Pendampingan Mobilitas Difabel Netra',
            'content' => 'Program khusus untuk mendukung pembelajaran bagi penyandang disabilitas netra.',
            'type' => 'lentera',
            'is_published' => true,
            'is_featured' => true,
            'created_by' => $admin->id,
            'published_at' => now(),
        ]);
    }
}
