<?php

declare(strict_types=1);

namespace Database\Seeders;

use App\Models\BlogCategory;
use Illuminate\Database\Seeder;

final class BlogCategorySeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            ['name' => 'Tech', 'slug' => 'tech', 'description' => 'Software, hardware, and technology.', 'sort_order' => 10],
            ['name' => 'Fintech', 'slug' => 'fintech', 'description' => 'Financial technology, banking innovation, and digital finance.', 'sort_order' => 20],
            ['name' => 'Law enforcement', 'slug' => 'law-enforcement', 'description' => 'Policing, public safety, and criminal justice.', 'sort_order' => 30],
            ['name' => 'Politics', 'slug' => 'politics', 'description' => 'Government, policy, and elections.', 'sort_order' => 40],
            ['name' => 'Security', 'slug' => 'security', 'description' => 'Threats, defenses, and best practices.', 'sort_order' => 50],
            ['name' => 'AI & machine learning', 'slug' => 'ai-machine-learning', 'description' => 'Models, tooling, ethics, and adoption.', 'sort_order' => 60],
            ['name' => 'Cloud computing', 'slug' => 'cloud-computing', 'description' => 'Infrastructure, platforms, and migration.', 'sort_order' => 70],
            ['name' => 'Developer tools', 'slug' => 'developer-tools', 'description' => 'Frameworks, IDEs, and workflows.', 'sort_order' => 80],
            ['name' => 'Startups', 'slug' => 'startups', 'description' => 'Founding, funding, and scaling.', 'sort_order' => 90],
            ['name' => 'Science', 'slug' => 'science', 'description' => 'Research, discovery, and methods.', 'sort_order' => 100],
            ['name' => 'Health', 'slug' => 'health', 'description' => 'Wellness, medicine, and public health.', 'sort_order' => 110],
            ['name' => 'Climate & energy', 'slug' => 'climate-energy', 'description' => 'Sustainability, policy, and technology.', 'sort_order' => 120],
            ['name' => 'Education', 'slug' => 'education', 'description' => 'Learning, institutions, and skills.', 'sort_order' => 130],
            ['name' => 'Gaming', 'slug' => 'gaming', 'description' => 'Studios, platforms, and culture.', 'sort_order' => 140],
            ['name' => 'Design', 'slug' => 'design', 'description' => 'Product, brand, and experience design.', 'sort_order' => 150],
            ['name' => 'Productivity', 'slug' => 'productivity', 'description' => 'Tools, habits, and remote work.', 'sort_order' => 160],
            ['name' => 'Blockchain', 'slug' => 'blockchain', 'description' => 'Networks, consensus, and applications.', 'sort_order' => 170],
            ['name' => 'Cybersecurity', 'slug' => 'cybersecurity', 'description' => 'Offense, defense, and resilience.', 'sort_order' => 180],
            ['name' => 'Data & analytics', 'slug' => 'data-analytics', 'description' => 'Pipelines, BI, and decision-making.', 'sort_order' => 190],
            ['name' => 'Mobile', 'slug' => 'mobile', 'description' => 'iOS, Android, and cross-platform.', 'sort_order' => 200],
            ['name' => 'Web development', 'slug' => 'web-development', 'description' => 'Front-end, back-end, and full stack.', 'sort_order' => 210],
            ['name' => 'DevOps & SRE', 'slug' => 'devops-sre', 'description' => 'Delivery, reliability, and observability.', 'sort_order' => 220],
            ['name' => 'Open source', 'slug' => 'open-source', 'description' => 'Licenses, communities, and governance.', 'sort_order' => 230],
            ['name' => 'Hardware', 'slug' => 'hardware', 'description' => 'Chips, devices, and manufacturing.', 'sort_order' => 240],
            ['name' => 'Regulation & compliance', 'slug' => 'regulation-compliance', 'description' => 'Rules, audits, and risk.', 'sort_order' => 250],
            ['name' => 'Privacy', 'slug' => 'privacy', 'description' => 'Data rights, tracking, and policy.', 'sort_order' => 260],
            ['name' => 'E-commerce', 'slug' => 'e-commerce', 'description' => 'Stores, payments, and logistics.', 'sort_order' => 270],
            ['name' => 'Media & journalism', 'slug' => 'media-journalism', 'description' => 'Reporting, platforms, and trust.', 'sort_order' => 280],
            ['name' => 'Real estate', 'slug' => 'real-estate', 'description' => 'Markets, investing, and PropTech.', 'sort_order' => 290],
            ['name' => 'Transportation', 'slug' => 'transportation', 'description' => 'Mobility, logistics, and autonomy.', 'sort_order' => 300],
            ['name' => 'Space', 'slug' => 'space', 'description' => 'Exploration, launch, and satellites.', 'sort_order' => 310],
            ['name' => 'Legal', 'slug' => 'legal', 'description' => 'Contracts, courts, and tech law.', 'sort_order' => 320],
            ['name' => 'Economy', 'slug' => 'economy', 'description' => 'Macro trends, labor, and trade.', 'sort_order' => 330],
            ['name' => 'Culture', 'slug' => 'culture', 'description' => 'Arts, society, and trends.', 'sort_order' => 340],
            ['name' => 'Internet of Things', 'slug' => 'internet-of-things', 'description' => 'Connected devices, sensors, and smart environments.', 'sort_order' => 350],
            ['name' => 'Robotics & automation', 'slug' => 'robotics-automation', 'description' => 'Industrial robots, RPA, and autonomous systems.', 'sort_order' => 360],
            ['name' => 'AR & VR', 'slug' => 'ar-vr', 'description' => 'Spatial computing, headsets, and immersive experiences.', 'sort_order' => 370],
            ['name' => 'Quantum computing', 'slug' => 'quantum-computing', 'description' => 'Qubits, algorithms, and early applications.', 'sort_order' => 380],
            ['name' => 'Digital transformation', 'slug' => 'digital-transformation', 'description' => 'Modernizing organizations, processes, and customer journeys.', 'sort_order' => 390],
            ['name' => 'Venture capital & investing', 'slug' => 'venture-capital-investing', 'description' => 'Funding rounds, valuations, and portfolio strategy.', 'sort_order' => 400],
            ['name' => 'AgTech & food', 'slug' => 'agtech-food', 'description' => 'Farming innovation, supply chains, and food security.', 'sort_order' => 410],
            ['name' => 'Civic technology', 'slug' => 'civic-technology', 'description' => 'Public services, digital government, and civic engagement.', 'sort_order' => 420],
            ['name' => 'Accessibility', 'slug' => 'accessibility', 'description' => 'Inclusive design, assistive tech, and WCAG-aligned practice.', 'sort_order' => 430],
            ['name' => 'Future of work', 'slug' => 'future-of-work', 'description' => 'Hybrid teams, skills, and workplace technology.', 'sort_order' => 440],
        ];

        foreach ($categories as $attributes) {
            BlogCategory::query()->updateOrCreate(
                ['slug' => $attributes['slug']],
                [
                    'name' => $attributes['name'],
                    'description' => $attributes['description'],
                    'sort_order' => $attributes['sort_order'],
                ]
            );
        }
    }
}
