<?php

namespace Database\Seeders;

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

class SettingSeeder extends Seeder
{
    public function run()
    {
        $settings = [
            // General
            ['key' => 'site_name', 'value' => 'The Mini Port', 'group' => 'general', 'type' => 'text', 'label' => 'Site Name'],
            ['key' => 'site_logo', 'value' => null, 'group' => 'general', 'type' => 'image', 'label' => 'Site Logo'],
            ['key' => 'contact_email', 'value' => 'support@theminiport.com', 'group' => 'general', 'type' => 'text', 'label' => 'Contact Email'],
            ['key' => 'contact_phone', 'value' => '+91-1234567890', 'group' => 'general', 'type' => 'text', 'label' => 'Contact Phone'],
            ['key' => 'contact_address', 'value' => '123 Business Park, Sector 62, Noida, UP, India - 201301', 'group' => 'general', 'type' => 'textarea', 'label' => 'Contact Address'],

            // Home Page - Hero
            ['key' => 'home_hero_title', 'value' => 'Find Verified Suppliers', 'group' => 'home', 'type' => 'text', 'label' => 'Hero Title'],
            ['key' => 'home_hero_subtitle', 'value' => 'Connect with manufacturers and wholesalers worldwide.', 'group' => 'home', 'type' => 'text', 'label' => 'Hero Subtitle'],
            ['key' => 'home_hero_cta_text', 'value' => 'Learn More', 'group' => 'home', 'type' => 'text', 'label' => 'Hero CTA Text'],
            ['key' => 'home_hero_cta_link', 'value' => '#', 'group' => 'home', 'type' => 'text', 'label' => 'Hero CTA Link'],

            // Home Page - Sections
            ['key' => 'home_show_trending', 'value' => '1', 'group' => 'home', 'type' => 'boolean', 'label' => 'Show Trending Products'],
            ['key' => 'home_show_regions', 'value' => '1', 'group' => 'home', 'type' => 'boolean', 'label' => 'Show Suppliers by Region'],
            ['key' => 'home_show_categories', 'value' => '1', 'group' => 'home', 'type' => 'boolean', 'label' => 'Show Featured Categories'],
            ['key' => 'home_show_rfqs', 'value' => '1', 'group' => 'home', 'type' => 'boolean', 'label' => 'Show Latest RFQs'],

            // Core Features (MOQ)
            ['key' => 'min_moq', 'value' => '10', 'group' => 'features', 'type' => 'number', 'label' => 'Platform Min MOQ'],
            ['key' => 'max_moq', 'value' => '150', 'group' => 'features', 'type' => 'number', 'label' => 'Platform Max MOQ'],

            // Social Media
            ['key' => 'social_facebook', 'value' => '#', 'group' => 'social', 'type' => 'text', 'label' => 'Facebook URL'],
            ['key' => 'social_twitter', 'value' => '#', 'group' => 'social', 'type' => 'text', 'label' => 'Twitter URL'],
            ['key' => 'social_linkedin', 'value' => '#', 'group' => 'social', 'type' => 'text', 'label' => 'LinkedIn URL'],
            ['key' => 'social_instagram', 'value' => '#', 'group' => 'social', 'type' => 'text', 'label' => 'Instagram URL'],

            // SEO
            ['key' => 'meta_title', 'value' => 'The Mini Port - Global B2B Marketplace', 'group' => 'seo', 'type' => 'text', 'label' => 'Global Meta Title'],
            ['key' => 'meta_description', 'value' => 'The Mini Port is a leading B2B marketplace connecting buyers and suppliers globally.', 'group' => 'seo', 'type' => 'textarea', 'label' => 'Global Meta Description'],
            ['key' => 'meta_keywords', 'value' => 'b2b, marketplace, suppliers, manufacturers, exporters', 'group' => 'seo', 'type' => 'textarea', 'label' => 'Global Meta Keywords'],

            // Scripts
            ['key' => 'header_scripts', 'value' => '', 'group' => 'scripts', 'type' => 'code', 'label' => 'Header Scripts (Google Analytics, etc.)'],
            ['key' => 'footer_scripts', 'value' => '', 'group' => 'scripts', 'type' => 'code', 'label' => 'Footer Scripts'],
        ];

        foreach ($settings as $setting) {
            Setting::updateOrCreate(['key' => $setting['key']], $setting);
        }
    }
}
