<?php

namespace Database\Seeders;

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

class SiteSettingSeeder extends Seeder
{
    /**
     * Run the database seeder.
     */
    public function run(): void
    {
        $settings = [
            // General Settings
            [
                'key' => 'site_title',
                'value' => 'FishShop BD',
                'type' => 'text',
                'group' => 'general',
                'description' => 'Website title shown in browser tab and header'
            ],
            [
                'key' => 'site_logo',
                'value' => '/images/logo.png',
                'type' => 'file',
                'group' => 'general',
                'description' => 'Main site logo image'
            ],
            [
                'key' => 'site_favicon',
                'value' => '/images/favicon.ico',
                'type' => 'file',
                'group' => 'general',
                'description' => 'Favicon icon for browser tab'
            ],
            
            // Contact Settings
            [
                'key' => 'contact_phone',
                'value' => '01913988543',
                'type' => 'text',
                'group' => 'contact',
                'description' => 'Primary contact phone number'
            ],
            [
                'key' => 'whatsapp_number',
                'value' => '01913988543',
                'type' => 'text',
                'group' => 'contact',
                'description' => 'WhatsApp contact number'
            ],
            [
                'key' => 'contact_email',
                'value' => 'info@fishbd.com',
                'type' => 'email',
                'group' => 'contact',
                'description' => 'Primary contact email address'
            ],
            [
                'key' => 'messenger_link',
                'value' => 'https://m.me/fishbdpage',
                'type' => 'url',
                'group' => 'contact',
                'description' => 'Facebook Messenger page link'
            ],
            
            // Delivery Settings
            [
                'key' => 'free_delivery_enabled',
                'value' => '1',
                'type' => 'boolean',
                'group' => 'delivery',
                'description' => 'Enable free delivery feature'
            ],
            [
                'key' => 'free_delivery_minimum',
                'value' => '500',
                'type' => 'number',
                'group' => 'delivery',
                'description' => 'Minimum order amount for free delivery'
            ],
            [
                'key' => 'delivery_fee_amount',
                'value' => '50',
                'type' => 'number',
                'group' => 'delivery',
                'description' => 'Delivery fee amount'
            ],
            
            // Footer Settings
            [
                'key' => 'footer_location',
                'value' => 'Dhaka, Bangladesh',
                'type' => 'text',
                'group' => 'footer',
                'description' => 'Location text shown in footer'
            ],
            [
                'key' => 'footer_copyright',
                'value' => '© 2025 FishShop BD. All rights reserved.',
                'type' => 'text',
                'group' => 'footer',
                'description' => 'Copyright text in footer'
            ],
            
            // Social Media Settings
            [
                'key' => 'facebook_page',
                'value' => 'https://facebook.com/fishbdpage',
                'type' => 'url',
                'group' => 'social',
                'description' => 'Facebook page URL'
            ],
            [
                'key' => 'instagram_page',
                'value' => 'https://instagram.com/fishbd',
                'type' => 'url',
                'group' => 'social',
                'description' => 'Instagram page URL'
            ],
            [
                'key' => 'youtube_channel',
                'value' => 'https://youtube.com/@fishbd',
                'type' => 'url',
                'group' => 'social',
                'description' => 'YouTube channel URL'
            ]
        ];

        foreach ($settings as $setting) {
            SiteSetting::create($setting);
        }

        // Refresh config cache after seeding
        SiteSetting::refreshConfigCache();
    }
}
