<?php

namespace Database\Seeders;

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

class FullSettingsSeeder extends Seeder
{
    public function run()
    {
        $settings = [
            // --- General Settings ---
            [
                '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' => 'footer_text',
                'value' => '© 2024 The Mini Port. All rights reserved.',
                'group' => 'general',
                'type' => 'textarea',
                'label' => 'Footer Text',
            ],
            [
                'key' => 'registration_moq_min',
                'value' => '10',
                'group' => 'general',
                'type' => 'text',
                'label' => 'Registration Min MOQ',
            ],
            [
                'key' => 'registration_moq_max',
                'value' => '150',
                'group' => 'general',
                'type' => 'text',
                'label' => 'Registration Max MOQ',
            ],

            // --- Home Page Settings ---
            [
                'key' => 'home_stat_products_count',
                'value' => '10000+',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Products Count',
            ],
            [
                'key' => 'home_stat_products_label',
                'value' => 'Products',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Products Label',
            ],
            [
                'key' => 'home_stat_suppliers_count',
                'value' => '500+',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Verified Suppliers Count',
            ],
            [
                'key' => 'home_stat_suppliers_label',
                'value' => 'Verified Suppliers',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Verified Suppliers Label',
            ],
            [
                'key' => 'home_stat_buyers_count',
                'value' => '2000+',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Active Buyers Count',
            ],
            [
                'key' => 'home_stat_buyers_label',
                'value' => 'Active Buyers',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Active Buyers Label',
            ],
            [
                'key' => 'home_stat_support_count',
                'value' => '24/7',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Support Availability',
            ],
            [
                'key' => 'home_stat_support_label',
                'value' => 'Support',
                'group' => 'home',
                'type' => 'text',
                'label' => 'Support Label',
            ],
            [
                'key' => 'home_show_trending',
                'value' => '1',
                'group' => 'home',
                'type' => 'boolean',
                'label' => 'Show Trending Products Section',
            ],

            // --- Social Media Settings ---
            [
                'key' => 'social_facebook',
                'value' => 'https://facebook.com',
                'group' => 'social',
                'type' => 'text',
                'label' => 'Facebook URL',
            ],
            [
                'key' => 'social_twitter',
                'value' => 'https://twitter.com',
                'group' => 'social',
                'type' => 'text',
                'label' => 'Twitter URL',
            ],
            [
                'key' => 'social_instagram',
                'value' => 'https://instagram.com',
                'group' => 'social',
                'type' => 'text',
                'label' => 'Instagram URL',
            ],
            [
                'key' => 'social_linkedin',
                'value' => 'https://linkedin.com',
                'group' => 'social',
                'type' => 'text',
                'label' => 'LinkedIn URL',
            ],
            [
                'key' => 'social_youtube',
                'value' => 'https://youtube.com',
                'group' => 'social',
                'type' => 'text',
                'label' => 'YouTube URL',
            ],

            // --- SEO Settings ---
            [
                'key' => 'seo_meta_title',
                'value' => 'The Mini Port - Global B2B Marketplace',
                'group' => 'seo',
                'type' => 'text',
                'label' => 'Default Meta Title',
            ],
            [
                'key' => 'seo_meta_description',
                'value' => 'Connect with top suppliers and buyers on The Mini Port, the leading global B2B marketplace.',
                'group' => 'seo',
                'type' => 'textarea',
                'label' => 'Default Meta Description',
            ],
            [
                'key' => 'seo_meta_keywords',
                'value' => 'b2b, marketplace, suppliers, buyers, trade, export, import',
                'group' => 'seo',
                'type' => 'textarea',
                'label' => 'Default Meta Keywords',
            ],

            // --- Scripts Settings ---
            [
                'key' => 'scripts_header',
                'value' => '<!-- Add Google Analytics or other header scripts here -->',
                'group' => 'scripts',
                'type' => 'textarea',
                'label' => 'Header Scripts',
            ],
            [
                'key' => 'scripts_footer',
                'value' => '<!-- Add Chat widgets or other footer scripts here -->',
                'group' => 'scripts',
                'type' => 'textarea',
                'label' => 'Footer Scripts',
            ],

            // --- Email Settings ---
            [
                'key' => 'mail_mailer',
                'value' => 'smtp',
                'group' => 'email',
                'type' => 'text',
                'label' => 'Mailer (e.g., smtp)',
            ],
            [
                'key' => 'mail_host',
                'value' => 'smtp.mailtrap.io',
                'group' => 'email',
                'type' => 'text',
                'label' => 'Mail Host',
            ],
            [
                'key' => 'mail_port',
                'value' => '2525',
                'group' => 'email',
                'type' => 'text',
                'label' => 'Mail Port',
            ],
            [
                'key' => 'mail_username',
                'value' => '',
                'group' => 'email',
                'type' => 'text',
                'label' => 'Mail Username',
            ],
            [
                'key' => 'mail_password',
                'value' => '',
                'group' => 'email',
                'type' => 'text',
                'label' => 'Mail Password',
            ],
            [
                'key' => 'mail_encryption',
                'value' => 'tls',
                'group' => 'email',
                'type' => 'text',
                'label' => 'Mail Encryption',
            ],
            [
                'key' => 'mail_from_address',
                'value' => 'noreply@theminiport.com',
                'group' => 'email',
                'type' => 'text',
                'label' => 'From Address',
            ],
            [
                'key' => 'mail_from_name',
                'value' => 'The Mini Port',
                'group' => 'email',
                'type' => 'text',
                'label' => 'From Name',
            ],

            // --- Payment Settings ---
            [
                'key' => 'payment_gateway_mode',
                'value' => 'sandbox',
                'group' => 'payment',
                'type' => 'select',
                'label' => 'Gateway Mode',
            ],
            [
                'key' => 'razorpay_key',
                'value' => '',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Razorpay Key ID',
            ],
            [
                'key' => 'razorpay_secret',
                'value' => '',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Razorpay Key Secret',
            ],
            [
                'key' => 'stripe_key',
                'value' => '',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Stripe Publishable Key',
            ],
            [
                'key' => 'stripe_secret',
                'value' => '',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Stripe Secret Key',
            ],
        ];

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