-- ============================================
-- CIX Orbit Academy Seed Data
-- ============================================

-- ============================================
-- ROLES
-- ============================================

INSERT INTO roles (name, slug, description, is_system) VALUES
('Super Admin', 'super_admin', 'Full system access', 1),
('Academic Admin', 'academic_admin', 'Manage courses, modules, and academic content', 1),
('Finance Officer', 'finance_officer', 'Manage payments and financial records', 1),
('Teacher / Lecturer', 'teacher', 'Create content and mark assessments', 1),
('Assessor / Marker', 'assessor', 'Mark tests and assignments', 1),
('Student', 'student', 'Access courses and take assessments', 1),
('Support Officer', 'support_officer', 'Manage support tickets', 1),
('Auditor / Read-only Admin', 'auditor', 'Read-only access to reports and logs', 1);

-- ============================================
-- PERMISSIONS
-- ============================================

INSERT INTO permissions (name, slug, description) VALUES
('View Dashboard', 'view_dashboard', 'Access dashboard'),
('Manage Users', 'manage_users', 'Create and edit users'),
('Manage Roles', 'manage_roles', 'Manage roles and permissions'),
('Manage Students', 'manage_students', 'Manage student records'),
('Manage Teachers', 'manage_teachers', 'Manage teacher records'),
('Manage Courses', 'manage_courses', 'Create and edit courses'),
('Manage Modules', 'manage_modules', 'Create and edit modules'),
('Manage Lessons', 'manage_lessons', 'Create and edit lessons'),
('Manage Exercises', 'manage_exercises', 'Create and edit exercises'),
('Manage Question Banks', 'manage_question_banks', 'Create and edit question banks'),
('Manage Tests', 'manage_tests', 'Create and edit CBT tests'),
('Manage Assignments', 'manage_assignments', 'Create and edit assignments'),
('Manage Enrollments', 'manage_enrollments', 'Manage student enrollments'),
('Manage Payments', 'manage_payments', 'Review and approve payments'),
('Manage Certificates', 'manage_certificates', 'Issue and manage certificates'),
('Manage Reports', 'manage_reports', 'View and generate reports'),
('Manage Announcements', 'manage_announcements', 'Create announcements'),
('Manage Settings', 'manage_settings', 'Configure system settings'),
('View Audit Logs', 'view_audit_logs', 'View system audit logs'),
('Manage Backups', 'manage_backups', 'Create and restore backups'),
('Send Email', 'send_email', 'Send emails to users'),
('Mark Assessments', 'mark_assessments', 'Grade student assessments'),
('View Own Courses', 'view_own_courses', 'View enrolled courses'),
('Take Assessments', 'take_assessments', 'Take tests and quizzes'),
('Upload Proof of Payment', 'upload_proof', 'Upload payment proof'),
('View Certificates', 'view_certificates', 'View own certificates'),
('Submit Assignments', 'submit_assignments', 'Submit assignments'),
('Open Support Tickets', 'open_support_tickets', 'Create support tickets'),
('AI Access', 'ai_access', 'Use AI features');

-- ============================================
-- ROLE PERMISSIONS (Super Admin gets all)
-- ============================================

INSERT INTO role_permissions (role_id, permission_id)
SELECT 1, id FROM permissions;

INSERT INTO role_permissions (role_id, permission_id)
SELECT 2, id FROM permissions WHERE slug IN (
    'view_dashboard', 'manage_students', 'manage_teachers', 'manage_courses', 
    'manage_modules', 'manage_lessons', 'manage_exercises', 'manage_question_banks',
    'manage_tests', 'manage_assignments', 'manage_enrollments', 'manage_reports',
    'manage_announcements', 'mark_assessments', 'view_audit_logs', 'ai_access'
);

INSERT INTO role_permissions (role_id, permission_id)
SELECT 3, id FROM permissions WHERE slug IN (
    'view_dashboard', 'manage_payments', 'manage_reports', 'view_audit_logs',
    'manage_students', 'manage_certificates'
);

INSERT INTO role_permissions (role_id, permission_id)
SELECT 4, id FROM permissions WHERE slug IN (
    'view_dashboard', 'manage_courses', 'manage_modules', 'manage_lessons',
    'manage_exercises', 'manage_question_banks', 'manage_tests', 'manage_assignments',
    'mark_assessments', 'manage_reports', 'manage_announcements', 'ai_access'
);

INSERT INTO role_permissions (role_id, permission_id)
SELECT 5, id FROM permissions WHERE slug IN (
    'view_dashboard', 'mark_assessments', 'manage_tests', 'manage_question_banks',
    'view_own_courses'
);

INSERT INTO role_permissions (role_id, permission_id)
SELECT 6, id FROM permissions WHERE slug IN (
    'view_dashboard', 'view_own_courses', 'take_assessments', 'upload_proof',
    'view_certificates', 'submit_assignments', 'open_support_tickets', 'ai_access'
);

INSERT INTO role_permissions (role_id, permission_id)
SELECT 7, id FROM permissions WHERE slug IN (
    'view_dashboard', 'open_support_tickets', 'view_own_courses'
);

INSERT INTO role_permissions (role_id, permission_id)
SELECT 8, id FROM permissions WHERE slug IN (
    'view_dashboard', 'manage_reports', 'view_audit_logs', 'view_own_courses'
);

-- ============================================
-- DEFAULT ADMIN USER
-- ============================================
-- Password: password (demo hash; installer-created admin should be used for production)
INSERT INTO users (role_id, first_name, last_name, email, phone, password_hash, is_active, email_verified_at)
VALUES (1, 'System', 'Administrator', 'admin@cixconnect.co.za', '0120040207', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 1, NOW());

-- ============================================
-- DEFAULT TEACHER
-- ============================================
-- Password: password (demo mode only)
INSERT INTO users (role_id, first_name, last_name, email, phone, password_hash, is_active, email_verified_at)
VALUES (4, 'Demo', 'Teacher', 'teacher@cixconnect.co.za', '0837598075', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 1, NOW());

INSERT INTO teachers (user_id, employee_id, specialization, qualifications, experience_years, is_active)
VALUES (2, 'TCH-001', 'AI, Machine Learning, Prompt Engineering', 'MSc Computer Science', 8, 1);

-- ============================================
-- DEFAULT STUDENT
-- ============================================
-- Password: password (demo mode only)
INSERT INTO users (role_id, first_name, last_name, email, phone, password_hash, is_active, email_verified_at)
VALUES (6, 'Demo', 'Student', 'student@cixconnect.co.za', '0712345678', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 1, NOW());

INSERT INTO students (user_id, student_number, province, town, highest_education, application_status, enrollment_status, payment_status)
VALUES (3, 'COA-2026-000001', 'Gauteng', 'Johannesburg', 'Matric', 'accepted', 'active', 'approved');

-- ============================================
-- COURSE CATEGORIES
-- ============================================

INSERT INTO course_categories (name, slug, description, icon) VALUES
('Artificial Intelligence', 'artificial-intelligence', 'AI fundamentals and advanced applications', 'fa-brain'),
('Business Automation', 'business-automation', 'Automate business processes with AI', 'fa-briefcase'),
('Development', 'development', 'Build apps and chatbots with AI', 'fa-code'),
('Creative AI', 'creative-ai', 'AI for design, music, and content', 'fa-palette');

-- ============================================
-- COURSE LEVELS
-- ============================================

INSERT INTO course_levels (name, slug, description, sort_order) VALUES
('Beginner', 'beginner', 'No prior experience required', 1),
('Creator', 'creator', 'Basic AI usage skills', 2),
('Business Operator', 'business-operator', 'Apply AI to business tasks', 3),
('AI Power User', 'ai-power-user', 'Advanced prompting and workflows', 4),
('Vibe Coder', 'vibe-coder', 'Build apps with AI coding tools', 5),
('API Builder', 'api-builder', 'Connect services with APIs', 6),
('Chatbot Builder', 'chatbot-builder', 'Build custom AI chatbots', 7),
('Junior AI Developer', 'junior-ai-developer', 'Production-ready AI development', 8);

-- ============================================
-- DEFAULT COURSE
-- ============================================

INSERT INTO courses (category_id, level_id, title, slug, subtitle, description, duration_hours, is_published, is_featured, pass_mark, certificate_eligible, created_by)
VALUES (1, 1, 'AI for Everyone: From Beginner to Builder', 'ai-for-everyone-from-beginner-to-builder',
'A practical academy course that takes complete beginners from AI basics to prompting, business use, chatbot creation, APIs, and vibe coding.',
'A comprehensive introductory course designed for complete beginners. Students will learn AI fundamentals, prompt engineering, business applications, chatbot development, API integration, and vibe coding. By the end of this course, students will be able to build simple AI-powered applications and automate real-world business tasks.',
48, 1, 1, 50, 1, 1);

-- ============================================
-- DEFAULT MODULES
-- ============================================

INSERT INTO modules (course_id, title, slug, description, sort_order, is_published) VALUES
(1, 'Welcome to AI', 'welcome-to-ai', 'Understand what AI is and how it impacts daily life', 1, 1),
(1, 'AI Mindset for Beginners', 'ai-mindset-for-beginners', 'Learn to think and work with AI effectively', 2, 1),
(1, 'Prompt Engineering Foundations', 'prompt-engineering-foundations', 'Master the art of crafting effective AI prompts', 3, 1),
(1, 'Using AI for Writing', 'using-ai-for-writing', 'Apply AI to business and creative writing tasks', 4, 1),
(1, 'Using AI for Design and Branding', 'using-ai-for-design-and-branding', 'Create visual content and brand assets with AI', 5, 1),
(1, 'AI for Music and Creative Production', 'ai-for-music-and-creative-production', 'Use AI in music, sound, and creative workflows', 6, 1),
(1, 'AI for Business Productivity', 'ai-for-business-productivity', 'Automate admin, customer service, and reports', 7, 1),
(1, 'Research, Fact Checking, and AI Limits', 'research-fact-checking-and-ai-limits', 'Understand hallucinations and verification strategies', 8, 1),
(1, 'Chatbots Explained', 'chatbots-explained', 'Learn about rule-based and AI chatbot architectures', 9, 1),
(1, 'Bring Your Own Key', 'bring-your-own-key', 'Safe API key management and provider selection', 10, 1),
(1, 'APIs for Beginners', 'apis-for-beginners', 'Understand REST APIs, JSON, and authentication', 11, 1),
(1, 'Automation and Workflows', 'automation-and-workflows', 'Connect apps and build automated workflows', 12, 1),
(1, 'Vibe Coding Foundations', 'vibe-coding-foundations', 'Instruct AI coding tools and debug with AI', 13, 1),
(1, 'Building a Simple AI Web App', 'building-a-simple-ai-web-app', 'Plan and build a basic web app with AI assistance', 14, 1),
(1, 'AI Ethics, Privacy, and Responsibility', 'ai-ethics-privacy-and-responsibility', 'POPIA, data privacy, and responsible AI use', 15, 1),
(1, 'Capstone Project', 'capstone-project', 'Build a complete AI-powered business solution', 16, 1);

-- ============================================
-- LESSONS FOR MODULE 1
-- ============================================

INSERT INTO lessons (module_id, title, slug, content, lesson_type, sort_order, is_published) VALUES
(1, 'What AI is', 'what-ai-is', '<h2>What is Artificial Intelligence?</h2><p>Artificial Intelligence (AI) refers to computer systems that can perform tasks typically requiring human intelligence. This includes learning, reasoning, problem-solving, perception, and language understanding.</p><p>In this lesson, we explore the core definition of AI and how it differs from traditional programming.</p>', 'text', 1, 1),
(1, 'Why AI matters', 'why-ai-matters', '<h2>Why AI Matters</h2><p>AI is transforming every industry. From healthcare to finance, education to entertainment, AI tools are making work faster, smarter, and more accessible.</p><p>Understanding AI is no longer optional—it is a core digital literacy skill for the modern economy.</p>', 'text', 2, 1),
(1, 'Common myths', 'common-myths', '<h2>Common Myths About AI</h2><p>Many people believe AI is sentient, will replace all jobs, or is infallible. This lesson debunks these myths and sets realistic expectations.</p>', 'text', 3, 1),
(1, 'Where AI is already being used', 'where-ai-is-already-being-used', '<h2>AI in Everyday Life</h2><p>AI powers spam filters, recommendation engines, voice assistants, navigation apps, and fraud detection systems. You interact with AI dozens of times daily without noticing.</p>', 'text', 4, 1);

-- ============================================
-- EXERCISES FOR MODULE 1
-- ============================================

INSERT INTO exercises (module_id, lesson_id, title, instructions, max_score, pass_mark, sort_order, is_published) VALUES
(1, NULL, 'Identify 10 places AI already affects daily life', 'List 10 real-world examples where AI impacts your daily routine. For each example, explain which AI technique is likely being used (machine learning, NLP, computer vision, etc.).', 100, 50, 1, 1);

-- ============================================
-- PACKAGES
-- ============================================

INSERT INTO packages (name, slug, description, price, currency, duration_days, trial_days, max_courses, certificate_eligible, assessment_required, approval_type, is_active, sort_order) VALUES
('AI Beginner', 'ai-beginner', 'Intro modules with basic quizzes and certificate of attendance', 499.00, 'ZAR', 90, 7, 1, 1, 0, 'auto', 1, 1),
('AI Creator', 'ai-creator', 'Writing, design, music, content creation with practical exercises', 1299.00, 'ZAR', 180, 7, 3, 1, 1, 'manual', 1, 2),
('AI Business Operator', 'ai-business-operator', 'Business workflows, reports, automation, customer service chatbots', 1899.00, 'ZAR', 365, 7, 5, 1, 1, 'manual', 1, 3),
('AI Power User', 'ai-power-user', 'Prompt engineering, research, automation, productivity systems', 2499.00, 'ZAR', 365, 7, 8, 1, 1, 'manual', 1, 4),
('Vibe Coding Starter', 'vibe-coding-starter', 'Build apps using AI coding tools and master prompts', 2999.00, 'ZAR', 365, 7, 10, 1, 1, 'manual', 1, 5),
('API Builder', 'api-builder', 'API keys, JSON, provider setup, simple integrations', 3499.00, 'ZAR', 365, 7, 10, 1, 1, 'manual', 1, 6),
('Chatbot Builder', 'chatbot-builder', 'Website chatbot, knowledge base chatbot, WhatsApp chatbot planning', 3499.00, 'ZAR', 365, 7, 10, 1, 1, 'manual', 1, 7),
('AI Developer Path', 'ai-developer-path', 'Full pathway from beginner to developer with final CBT and capstone', 5999.00, 'ZAR', 730, 14, 20, 1, 1, 'manual', 1, 8);

-- ============================================
-- PACKAGE COURSES (AI Developer Path gets all)
-- ============================================

INSERT INTO package_courses (package_id, course_id) VALUES
(1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1), (7, 1), (8, 1);

-- ============================================
-- SAMPLE QUESTION BANKS
-- ============================================

INSERT INTO question_banks (name, description, category, difficulty, course_id, module_id, created_by, is_public) VALUES
('Module 1 Quiz Bank', 'Questions for Module 1 Welcome to AI quiz', 'General', 'easy', 1, 1, 2, 1);

INSERT INTO questions (bank_id, question_type, question_text, explanation, difficulty, points, tags, ai_generated, created_by) VALUES
(1, 'multiple_choice', 'What does AI stand for?', 'AI stands for Artificial Intelligence, which refers to machines that can perform tasks requiring human-like intelligence.', 'easy', 1, 'basics,definition', 0, 2);

INSERT INTO question_options (question_id, option_text, is_correct, sort_order) VALUES
(1, 'Artificial Intelligence', 1, 1),
(1, 'Automated Integration', 0, 2),
(1, 'Advanced Internet', 0, 3),
(1, 'Algorithmic Input', 0, 4);

INSERT INTO questions (bank_id, question_type, question_text, explanation, difficulty, points, tags, ai_generated, created_by) VALUES
(1, 'multiple_choice', 'Which of the following is an example of AI in daily life?', 'Spam filters in email use machine learning algorithms to identify and block unwanted messages.', 'easy', 1, 'examples,daily-life', 0, 2);

INSERT INTO question_options (question_id, option_text, is_correct, sort_order) VALUES
(2, 'Email spam filters', 1, 1),
(2, 'A basic calculator', 0, 2),
(2, 'A light switch', 0, 3),
(2, 'A bicycle', 0, 4);

INSERT INTO questions (bank_id, question_type, question_text, explanation, difficulty, points, tags, ai_generated, created_by) VALUES
(1, 'multiple_choice', 'What is a common myth about AI?', 'A common myth is that AI is sentient or conscious. Current AI systems are sophisticated pattern-matching tools without consciousness.', 'easy', 1, 'myths,awareness', 0, 2);

INSERT INTO question_options (question_id, option_text, is_correct, sort_order) VALUES
(3, 'AI is sentient and has feelings', 1, 1),
(3, 'AI can only do math', 0, 2),
(3, 'AI requires no electricity', 0, 3),
(3, 'AI was invented in the 1800s', 0, 4);

-- ============================================
-- SAMPLE TEST
-- ============================================

INSERT INTO tests (course_id, module_id, title, description, test_type, duration_minutes, pass_mark, max_attempts, randomize_questions, randomize_answers, result_release_type, is_published, created_by) VALUES
(1, 1, 'Module 1 Quiz', 'Test your understanding of AI basics from Module 1', 'quiz', 15, 50, 3, 1, 1, 'immediate', 1, 2);

INSERT INTO test_sections (test_id, bank_id, title, description, question_count, points_per_question, sort_order) VALUES
(1, 1, 'AI Basics', 'Questions covering Module 1 fundamentals', 3, 1, 1);

-- ============================================
-- SAMPLE ASSIGNMENT
-- ============================================

INSERT INTO assignments (course_id, module_id, title, description, instructions, max_score, pass_mark, due_date, is_published, created_by) VALUES
(1, 1, 'Identify 10 places AI affects daily life', 'Submit a list of 10 real-world examples where AI impacts daily life.', 'Write a brief paragraph for each example explaining the AI technique used.', 100, 50, DATE_ADD(NOW(), INTERVAL 7 DAY), 1, 2);

-- ============================================
-- EMAIL TEMPLATES
-- ============================================

INSERT INTO email_templates (code, name, subject, body) VALUES
('application_received', 'Application Received', 'CIX Orbit Academy Application Received - Your Student Number', '<h2>Application Received</h2><p>Dear {student_name},</p><p>Your application to CIX Orbit Academy has been received. Your student number is: <strong>{student_number}</strong></p><p>Login URL: {login_url}</p><p>Selected course: {course_name}</p><p>Please review the payment instructions below to activate your enrollment.</p><hr><h3>Payment Instructions</h3><p>Use your student number as payment reference.</p><p>Email proof of payment to: academic@cixconnect.co.za</p><p>WhatsApp proof: 083 759 8075</p><p>Banking details will be shown in your student portal.</p><p>Best regards,<br>CIX Orbit Academy</p>'),
('payment_instructions', 'Payment Instructions', 'CIX Orbit Academy - Payment Instructions for {student_name}', '<h2>Payment Instructions</h2><p>Dear {student_name},</p><p>Please find below our banking details for payment:</p><h3>Standard Bank</h3><p>Account Name: CIX CONNECT<br>Account Number: 10200349927<br>Branch Code: 051001</p><h3>Capitec Business</h3><p>Account Name: CIX CONNECT<br>Account Number: 1051396964<br>Branch Code: 450105</p><h3>ABSA</h3><p>Account Name: CIX CONNECT<br>Account Number: 4123963036<br>Branch Code: 632005</p><p><strong>Important:</strong> Use your student number <strong>{student_number}</strong> as payment reference.</p><p>Email proof to: academic@cixconnect.co.za<br>WhatsApp proof: 083 759 8075</p>'),
('payment_approved', 'Payment Approved', 'Your Payment Has Been Approved - CIX Orbit Academy', '<h2>Payment Approved</h2><p>Dear {student_name},</p><p>Your payment has been approved and your enrollment has been activated. You can now access your course materials.</p><p>Login: {login_url}</p><p>Best regards,<br>CIX Orbit Academy</p>'),
('payment_rejected', 'Payment Review Required', 'Payment Proof Review Required - CIX Orbit Academy', '<h2>Payment Review Required</h2><p>Dear {student_name},</p><p>We could not verify your payment proof. Please review the reason below and submit updated proof.</p><p>Reason: {reason}</p><p>Upload new proof at: {login_url}</p>'),
('certificate_issued', 'Certificate Issued', 'Congratulations! Your Certificate Has Been Issued', '<h2>Congratulations!</h2><p>Dear {student_name},</p><p>You have successfully completed <strong>{course_name}</strong>. Your certificate has been issued.</p><p>Download it from your dashboard: {login_url}</p><p>Certificate Number: {certificate_number}</p>'),
('password_reset', 'Password Reset', 'Reset Your CIX Orbit Academy Password', '<h2>Password Reset</h2><p>Click the link below to reset your password:</p><p><a href="{reset_link}">Reset Password</a></p><p>This link expires in 1 hour.</p>'),
('announcement', 'New Announcement', '{subject}', '<p>{message}</p>');

-- ============================================
-- THEMES
-- ============================================

INSERT INTO themes (name, slug, description, is_active, is_default, css_variables) VALUES
('Orbit Dark', 'orbit-dark', 'Dark futuristic theme with orange accents', 1, 1, '{"--primary":"#000000","--secondary":"#ff6b00","--accent":"#00ff41","--bg":"#0a0a0a","--surface":"#1a1a1a","--text":"#ffffff","--text-secondary":"#b0b0b0","--border":"#333333"}'),
('CIX Orange Lime', 'cix-orange-lime', 'CIX Connect branding with deep orange and lime green', 0, 0, '{"--primary":"#ff6b00","--secondary":"#00ff41","--bg":"#ffffff","--surface":"#f5f5f5","--text":"#000000","--text-secondary":"#333333","--border":"#e0e0e0"}'),
('Academic Blue', 'academic-blue', 'Classic academic blue theme', 0, 0, '{"--primary":"#1a3c6c","--secondary":"#d4af37","--bg":"#f8f9fa","--surface":"#ffffff","--text":"#212529","--text-secondary":"#6c757d","--border":"#dee2e6"}'),
('Executive Black', 'executive-black', 'Professional black and gold executive theme', 0, 0, '{"--primary":"#0d0d0d","--secondary":"#c9a227","--bg":"#ffffff","--surface":"#f5f5f5","--text":"#1a1a1a","--text-secondary":"#666666","--border":"#dddddd"}'),
('UNISA Inspired', 'unisa-inspired', 'Inspired by academic institutional colors', 0, 0, '{"--primary":"#003366","--secondary":"#ffcc00","--bg":"#ffffff","--surface":"#f0f0f0","--text":"#333333","--text-secondary":"#666666","--border":"#cccccc"}'),
('Wits Inspired', 'wits-inspired', 'Inspired by Wits University colors', 0, 0, '{"--primary":"#003366","--secondary":"#ffd700","--bg":"#ffffff","--surface":"#f5f5f5","--text":"#222222","--text-secondary":"#555555","--border":"#dddddd"}'),
('Clean White', 'clean-white', 'Minimal clean white theme', 0, 0, '{"--primary":"#ffffff","--secondary":"#333333","--accent":"#007bff","--bg":"#ffffff","--surface":"#f8f9fa","--text":"#212529","--text-secondary":"#6c757d","--border":"#dee2e6"}'),
('Cyber Green', 'cyber-green', 'High-tech cyberpunk green theme', 0, 0, '{"--primary":"#0a0a0a","--secondary":"#00ff41","--accent":"#00ffff","--bg":"#050505","--surface":"#111111","--text":"#00ff41","--text-secondary":"#00cc33","--border":"#003300"}'),
('Deep Space', 'deep-space', 'Dark blue space theme', 0, 0, '{"--primary":"#0a0e27","--secondary":"#6c63ff","--accent":"#00d4ff","--bg":"#0a0e27","--surface":"#151a3a","--text":"#e0e0ff","--text-secondary":"#a0a0cc","--border":"#2a2f5a"}'),
('Royal Purple', 'royal-purple', 'Elegant purple and gold theme', 0, 0, '{"--primary":"#4a1d6b","--secondary":"#d4af37","--bg":"#faf8ff","--surface":"#ffffff","--text":"#2d1b36","--text-secondary":"#6b5b7a","--border":"#d8c8e8"}'),
('Gold Prestige', 'gold-prestige', 'Luxury gold and dark theme', 0, 0, '{"--primary":"#1a1a1a","--secondary":"#d4af37","--bg":"#ffffff","--surface":"#fafafa","--text":"#1a1a1a","--text-secondary":"#555555","--border":"#e0e0e0"}'),
('Calm Grey', 'calm-grey', 'Soothing grey and teal theme', 0, 0, '{"--primary":"#607d8b","--secondary":"#009688","--bg":"#f5f5f5","--surface":"#ffffff","--text":"#424242","--text-secondary":"#757575","--border":"#e0e0e0"}'),
('Student Light', 'student-light', 'Bright and friendly student theme', 0, 0, '{"--primary":"#2196f3","--secondary":"#ff9800","--bg":"#ffffff","--surface":"#f0f7ff","--text":"#333333","--text-secondary":"#666666","--border":"#d0e3f3"}'),
('Teacher Blue', 'teacher-blue', 'Professional blue for educators', 0, 0, '{"--primary":"#1565c0","--secondary":"#43a047","--bg":"#ffffff","--surface":"#e3f2fd","--text":"#212121","--text-secondary":"#616161","--border":"#bbdefb"}'),
('Finance Green', 'finance-green', 'Finance-focused green theme', 0, 0, '{"--primary":"#2e7d32","--secondary":"#f9a825","--bg":"#ffffff","--surface":"#e8f5e9","--text":"#1b5e20","--text-secondary":"#4caf50","--border":"#c8e6c9"}'),
('Assessment Red', 'assessment-red', 'High-contrast assessment theme', 0, 0, '{"--primary":"#c62828","--secondary":"#f9a825","--bg":"#ffffff","--surface":"#ffebee","--text":"#212121","--text-secondary":"#616161","--border":"#ffcdd2"}'),
('Midnight Academy', 'midnight-academy', 'Deep navy and gold academy theme', 0, 0, '{"--primary":"#0d1b2a","--secondary":"#ffd700","--bg":"#0d1b2a","--surface":"#1b263b","--text":"#e0e0e0","--text-secondary":"#a0a0b0","--border":"#2a3f5f"}'),
('Soft Cream', 'soft-cream', 'Warm cream and brown theme', 0, 0, '{"--primary":"#5d4037","--secondary":"#8d6e63","--bg":"#faf8f5","--surface":"#ffffff","--text":"#3e2723","--text-secondary":"#795548","--border":"#d7ccc8"}'),
('Corporate Slate', 'corporate-slate', 'Corporate slate and orange theme', 0, 0, '{"--primary":"#37474f","--secondary":"#ff6d00","--bg":"#ffffff","--surface":"#f5f5f5","--text":"#263238","--text-secondary":"#546e7a","--border":"#cfd8dc"}'),
('Neon Tech', 'neon-tech', 'Vibrant neon tech theme', 0, 0, '{"--primary":"#000000","--secondary":"#ff00ff","--accent":"#00ffff","--bg":"#0a0a0a","--surface":"#1a1a2e","--text":"#ffffff","--text-secondary":"#b0b0b0","--border":"#ff00ff"}'),
('Minimal Black', 'minimal-black', 'Ultra-minimal black and white theme', 0, 0, '{"--primary":"#000000","--secondary":"#ffffff","--bg":"#ffffff","--surface":"#fafafa","--text":"#000000","--text-secondary":"#666666","--border":"#eeeeee"}'),
('High Contrast Accessibility', 'high-contrast-accessibility', 'WCAG compliant high contrast theme', 0, 0, '{"--primary":"#000000","--secondary":"#ffff00","--bg":"#ffffff","--surface":"#ffffff","--text":"#000000","--text-secondary":"#000000","--border":"#000000"}');

-- ============================================
-- SETTINGS
-- ============================================

INSERT INTO settings (setting_key, setting_value, setting_type, description, is_public) VALUES
('academy_name', 'CIX Orbit Academy', 'text', 'Academy name', 1),
('company_name', 'CIX Connect', 'text', 'Company name', 1),
('academy_url', 'https://cixorbitacademy.cixconnect.co.za/', 'text', 'Academy URL', 1),
('main_website', 'https://cixconnect.co.za', 'text', 'Main website URL', 1),
('office_phone', '012 004 0207', 'text', 'Office phone number', 1),
('whatsapp_number', '0837598075', 'text', 'WhatsApp number', 1),
('academic_email', 'academic@cixconnect.co.za', 'text', 'Academic email address', 1),
('slogan', 'Learn. Build. Automate. Grow.', 'text', 'Academy slogan', 1),
('slogan2', 'From Beginner to Builder.', 'text', 'Academy slogan 2', 1),
('slogan3', 'AI Skills for the New Economy.', 'text', 'Academy slogan 3', 1),
('timezone', 'Africa/Johannesburg', 'text', 'System timezone', 0),
('language', 'en', 'text', 'Default language', 0),
('maintenance_mode', '0', 'boolean', 'Enable maintenance mode', 0),
('default_theme', 'orbit-dark', 'text', 'Default theme slug', 0),
('admin_default_theme', 'orbit-dark', 'text', 'Default admin portal theme slug', 0),
('teacher_default_theme', 'teacher-blue', 'text', 'Default teacher portal theme slug', 0),
('student_default_theme', 'student-light', 'text', 'Default student portal theme slug', 0),
('public_default_theme', 'orbit-dark', 'text', 'Default public frontend theme slug', 0),
('manual_application_review', '0', 'boolean', 'Require admin review before activating new applications', 0),
('payment_instruction', 'Use your student number as payment reference. Email proof of payment to academic@cixconnect.co.za or WhatsApp proof to 083 759 8075.', 'text', 'Default student payment instruction', 1),
('student_number_format', 'COA-{YYYY}-{NNNNNN}', 'text', 'Student number format', 0);

-- ============================================
-- BANKING DETAILS
-- ============================================

INSERT INTO banking_details (bank_name, account_name, account_number, branch_code, instructions, is_active, sort_order) VALUES
('Standard Bank', 'CIX CONNECT', '10200349927', '051001', 'Use your student number as payment reference. Email proof of payment to academic@cixconnect.co.za or WhatsApp proof to 083 759 8075.', 1, 1),
('Capitec Business', 'CIX CONNECT', '1051396964', '450105', 'Use your student number as payment reference. Email proof of payment to academic@cixconnect.co.za or WhatsApp proof to 083 759 8075.', 1, 2),
('ABSA', 'CIX CONNECT', '4123963036', '632005', 'Use your student number as payment reference. Email proof of payment to academic@cixconnect.co.za or WhatsApp proof to 083 759 8075.', 1, 3);

-- ============================================
-- PWA SETTINGS
-- ============================================

INSERT INTO pwa_settings (app_name, short_name, description, theme_color, background_color, display_mode, orientation, start_url, is_enabled) VALUES
('CIX Orbit Academy', 'CIX Academy', 'Learn. Build. Automate. Grow.', '#000000', '#ffffff', 'standalone', 'portrait', '/', 1);

-- ============================================
-- DEFAULT QUESTION BANKS FOR OTHER MODULES (Minimal)
-- ============================================

INSERT INTO question_banks (name, description, category, difficulty, module_id, created_by, is_public) VALUES
('Module 2 Quiz Bank', 'Questions for AI Mindset module', 'Mindset', 'easy', 2, 2, 1),
('Module 3 Quiz Bank', 'Questions for Prompt Engineering module', 'Prompting', 'medium', 3, 2, 1);

-- ============================================
-- SAMPLE CBT TEST FOR MODULE 1
-- ============================================

INSERT INTO tests (course_id, module_id, title, description, test_type, duration_minutes, pass_mark, max_attempts, randomize_questions, randomize_answers, result_release_type, is_published, created_by) VALUES
(1, 1, 'Module 1 Final CBT', 'Final computer-based test for Module 1', 'cbt', 20, 50, 2, 1, 1, 'immediate', 1, 2);

INSERT INTO test_sections (test_id, bank_id, title, description, question_count, points_per_question, sort_order) VALUES
(2, 1, 'AI Fundamentals', 'Core concepts from Module 1', 10, 1, 1);
