<?php

namespace Database\Seeders;

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

class NavigationSeeder extends Seeder
{
    public function run(): void
    {
        // Clear existing navigations
        Navigation::truncate();

        // HOME
        Navigation::create([
            'title' => 'Home',
            'slug' => 'home',
            'route_name' => 'home',
            'order' => 1,
            'location' => 'header',
        ]);

        // ABOUT with children
        $about = Navigation::create([
            'title' => 'About',
            'slug' => 'about',
            'route_name' => 'about',
            'order' => 2,
            'location' => 'header',
        ]);

        Navigation::create([
            'title' => 'Concept Note',
            'slug' => 'concept-note',
            'url' => '/about/concept-note',
            'parent_id' => $about->id,
            'order' => 1,
        ]);

        Navigation::create([
            'title' => 'Sub-Themes',
            'slug' => 'sub-themes',
            'url' => '/about/sub-themes',
            'parent_id' => $about->id,
            'order' => 2,
        ]);

        Navigation::create([
            'title' => 'About TEFLIN',
            'slug' => 'about-teflin',
            'route_name' => 'about',
            'parent_id' => $about->id,
            'order' => 3,
        ]);

        Navigation::create([
            'title' => 'Committee',
            'slug' => 'committee',
            'url' => '/about/committee',
            'parent_id' => $about->id,
            'order' => 4,
        ]);

        // SPEAKERS with children
        $speakers = Navigation::create([
            'title' => 'Speakers',
            'slug' => 'speakers',
            'route_name' => 'speakers',
            'order' => 3,
            'location' => 'header',
        ]);

        Navigation::create([
            'title' => 'Speaker Profiles',
            'slug' => 'speaker-profiles',
            'route_name' => 'speakers',
            'parent_id' => $speakers->id,
            'order' => 1,
        ]);

        Navigation::create([
            'title' => 'Schedule',
            'slug' => 'schedule',
            'url' => '/speakers/schedule',
            'parent_id' => $speakers->id,
            'order' => 2,
        ]);

        // CALL FOR PAPERS with children
        $cfp = Navigation::create([
            'title' => 'Call for Papers',
            'slug' => 'call-for-papers',
            'route_name' => 'call-for-papers',
            'order' => 4,
            'location' => 'header',
        ]);

        Navigation::create([
            'title' => 'Submission Guidelines',
            'slug' => 'submission-guidelines',
            'route_name' => 'call-for-papers',
            'parent_id' => $cfp->id,
            'order' => 1,
        ]);

        Navigation::create([
            'title' => 'Timeline',
            'slug' => 'timeline',
            'url' => '/call-for-papers#timeline',
            'parent_id' => $cfp->id,
            'order' => 2,
        ]);

        Navigation::create([
            'title' => 'Abstract Submission',
            'slug' => 'abstract-submission',
            'route_name' => 'submission.abstract',
            'parent_id' => $cfp->id,
            'order' => 3,
        ]);

        Navigation::create([
            'title' => 'Templates',
            'slug' => 'templates',
            'route_name' => 'resources',
            'parent_id' => $cfp->id,
            'order' => 4,
        ]);

        // REGISTRATION with children
        $registration = Navigation::create([
            'title' => 'Registration',
            'slug' => 'registration',
            'route_name' => 'registration',
            'order' => 5,
            'location' => 'header',
        ]);

        Navigation::create([
            'title' => 'Registration Categories',
            'slug' => 'registration-categories',
            'url' => '/registration#categories',
            'parent_id' => $registration->id,
            'order' => 1,
        ]);

        Navigation::create([
            'title' => 'Pricing Table',
            'slug' => 'pricing-table',
            'url' => '/registration#pricing',
            'parent_id' => $registration->id,
            'order' => 2,
        ]);

        Navigation::create([
            'title' => 'Payment Instructions',
            'slug' => 'payment-instructions',
            'url' => '/registration#payment',
            'parent_id' => $registration->id,
            'order' => 3,
        ]);

        Navigation::create([
            'title' => 'Registration Form',
            'slug' => 'registration-form',
            'route_name' => 'registration.form',
            'parent_id' => $registration->id,
            'order' => 4,
        ]);

        // VENUE & TRAVEL with children
        $venue = Navigation::create([
            'title' => 'Venue & Travel',
            'slug' => 'venue-travel',
            'route_name' => 'venue',
            'order' => 6,
            'location' => 'header',
        ]);

        Navigation::create([
            'title' => 'Location Info',
            'slug' => 'location-info',
            'route_name' => 'venue',
            'parent_id' => $venue->id,
            'order' => 1,
        ]);

        Navigation::create([
            'title' => 'Accommodation',
            'slug' => 'accommodation',
            'url' => '/venue/accommodation',
            'parent_id' => $venue->id,
            'order' => 2,
        ]);

        Navigation::create([
            'title' => 'Visa Information',
            'slug' => 'visa-information',
            'url' => '/venue/visa-information',
            'parent_id' => $venue->id,
            'order' => 3,
        ]);

        Navigation::create([
            'title' => 'Tourism',
            'slug' => 'tourism',
            'url' => '/venue/tourism',
            'parent_id' => $venue->id,
            'order' => 4,
        ]);

        Navigation::create([
            'title' => 'Explore Jakarta',
            'slug' => 'explore-jakarta',
            'url' => '/venue/explore-jakarta',
            'parent_id' => $venue->id,
            'order' => 5,
        ]);

        // RESOURCES & CONTACT with children
        $resources = Navigation::create([
            'title' => 'Resources & Contact',
            'slug' => 'resources-contact',
            'route_name' => 'contact',
            'order' => 7,
            'location' => 'header',
        ]);

        Navigation::create([
            'title' => 'Downloads',
            'slug' => 'downloads',
            'route_name' => 'resources',
            'parent_id' => $resources->id,
            'order' => 1,
        ]);

        Navigation::create([
            'title' => 'FAQ',
            'slug' => 'faq',
            'url' => '/contact#faq',
            'parent_id' => $resources->id,
            'order' => 2,
        ]);

        Navigation::create([
            'title' => 'Contact Us',
            'slug' => 'contact-us',
            'route_name' => 'contact',
            'parent_id' => $resources->id,
            'order' => 3,
        ]);
    }
}
