<?php

namespace Database\Seeders;

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

class SiteSettingsSeeder extends Seeder
{
    public function run()
    {
        $defaults = [
            'brand_name' => 'Basketloot',
            'domain' => 'basketloot.com',
            'tagline' => 'Explore offers, complete online quests, and earn rewards with BasketLoot.',
            'points_name' => 'coins',
            'support_email' => 'support@basketloot.com',
            'primary_color' => '#7CFF5B',
            'accent_color' => '#4DDCFF',
            'logo_path' => 'branding/basketloot-logo.svg',
            'favicon_path' => 'branding/basketloot-favicon.svg',
            'theme_bg' => '#080B12',
            'theme_surface' => '#131B2A',
            'theme_surface_2' => '#162031',
            'theme_text' => '#F7FAFF',
            'theme_muted' => '#7E8FA8',
            'protection_max_accounts_per_ip' => '1',
            'protection_max_accounts_count' => '1',
            'protection_ip_change' => '0',
            'protection_auto_block_ip_change' => '0',
            'protection_custom_email_domains' => '0',
            'protection_email_domains' => 'gmail.com,yahoo.com,hotmail.com,outlook.com,icloud.com',
            'protection_verify_email_withdraw' => '1',
            'protection_block_countries' => '0',
            'protection_blocked_countries' => '',
            'protection_ipqualityscore_enabled' => '0',
            'protection_ipqualityscore_api_key' => '',
            'protection_ipqualityscore_threshold' => '85',
            'protection_proxycheck_enabled' => '0',
            'protection_proxycheck_api_key' => '',
            'protection_proxycheck_threshold' => '85',
            'postback_secret' => '',
            'postback_require_signature' => '0',
            'postback_duplicate_window' => '30',
            'third_party_recaptcha_enabled' => '0',
            'third_party_recaptcha_site_key' => '',
            'third_party_recaptcha_secret_key' => '',
            'referral_enabled' => '1',
            'referral_commission_percent' => '5',
            'referral_signup_bonus' => '5',
            'levels_enabled' => '1',
            'level_points_step' => '1000',
            'leaderboard_enabled' => '1',
            'leaderboard_period' => 'monthly',
            'streaks_enabled' => '1',
            'streak_daily_bonus' => '5',
            'social_facebook' => '',
            'social_discord' => '',
            'social_x' => '',
            'social_telegram' => '',
        ];

        foreach ($defaults as $key => $value) {
            // Insert missing defaults without overwriting values already chosen
            // by an administrator on an existing installation.
            SiteSetting::firstOrCreate(['key' => $key], ['value' => $value]);
        }
    }
}
