<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class SettingsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // Clear existing settings
        DB::table('settings')->delete();

        // Seed settings table with default values
        DB::table('settings')->insert([
            'id' => 1,
            'app_name' => 'ZEmailnator',
            'app_version' => '1.0',
            'app_base_url' => 'http://localhost:8000',
            'app_admin' => 'admin@zemail.me',
            'app_title' => 'ZEmailnator - Temporary Email Service',
            'app_description' => 'Free temporary email service for protecting your privacy',
            'app_keyword' => 'temporary email, disposable email, fake email',
            'app_contact' => 'support@zemail.me',
            'app_meta' => json_encode(['author' => 'ZEmailnator', 'version' => '1.0']),
            'app_social' => json_encode(['twitter' => '@zemailnator', 'github' => 'zemailnator']),
            'app_header' => 'Welcome to ZEmailnator',
            'app_footer' => '© 2025 ZEmailnator. All rights reserved.',
            'imap_settings' => json_encode([
                'host' => 'imap.gmail.com',
                'port' => 993,
                'protocol' => 'imap',
                'encryption' => 'ssl',
                'validate_cert' => true,
                'username' => 'test@gmail.com',
                'password' => 'password',
            ]),
            'configuration_settings' => json_encode([
                'custom_username_length_min' => 3,
                'custom_username_length_max' => 20,
                'random_username_length_min' => 6,
                'random_username_length_max' => 12,
                'forbidden_ids' => ['admin', 'root', 'test'],
                'gmailUsernames' => ['john.doe', 'jane.smith'],
                'outlookUsernames' => ['outlookuser', 'testuser'],
                'domains' => ['gmail.com', 'outlook.com', 'example.com'],
                'enable_create_from_url' => true,
                'disable_mailbox_slug' => false,
                'fetch_messages_limit' => 15,
                'blocked_domains' => ['spam.com', 'blocked.com'],
                'date_format' => 'd M Y h:i A',
            ]),
            'ads_settings' => json_encode([
                'enable_ads' => false,
                'ad_provider' => 'google',
                'ad_positions' => ['header', 'sidebar', 'footer'],
            ]),
            'created_at' => now(),
            'updated_at' => now(),
        ]);
    }
}
