<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('site_settings', function (Blueprint $table) {
            $table->id();
            $table->string('key')->unique();
            $table->text('value')->nullable();
            $table->timestamps();
        });

        // Insert default settings
        DB::table('site_settings')->insert([
            // Company Information
            ['key' => 'company_name', 'value' => 'Inve Security', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'company_logo', 'value' => null, 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'company_address', 'value' => 'Riyadh, Saudi Arabia', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'company_phone', 'value' => '+966 12 345 6789', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'company_email', 'value' => 'info@invesecurity.com', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'working_hours', 'value' => 'Sunday - Thursday, 9:00 AM - 6:00 PM', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'whatsapp_number', 'value' => '+966 50 123 4567', 'created_at' => now(), 'updated_at' => now()],
            
            // Social Media
            ['key' => 'facebook_url', 'value' => 'https://facebook.com/invesecurity', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'twitter_url', 'value' => 'https://twitter.com/invesecurity', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'linkedin_url', 'value' => 'https://linkedin.com/company/invesecurity', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'instagram_url', 'value' => 'https://instagram.com/invesecurity', 'created_at' => now(), 'updated_at' => now()],
            
            // Company Stats
            ['key' => 'total_clients', 'value' => '500+', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'revenue_generated', 'value' => 'SAR 2B+', 'created_at' => now(), 'updated_at' => now()],
            
            // Footer & Copyright
            ['key' => 'footer_text', 'value' => 'Leading digital transformation partner in Saudi Arabia, delivering innovative solutions that drive business growth since 2018.', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'copyright_text', 'value' => '© 2024 Inve Security', 'created_at' => now(), 'updated_at' => now()],
            
            // Google Maps
            ['key' => 'google_map_embed', 'value' => '<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3621.716758698011!2d46.67541531500024!3d24.8134698840744!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3e2ee3b7b5e6c2b5%3A0x5f5b5b5b5b5b5b5b!2sRiyadh%2C%20Saudi%20Arabia!5e0!3m2!1sen!2ssa!4v1645678901234!5m2!1sen!2ssa" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>', 'created_at' => now(), 'updated_at' => now()],
            
            // SEO
            ['key' => 'meta_title', 'value' => 'Inve Security - Digital Transformation Partner', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'meta_description', 'value' => 'Leading digital transformation partner in Saudi Arabia delivering innovative solutions for business growth.', 'created_at' => now(), 'updated_at' => now()],
            ['key' => 'meta_keywords', 'value' => 'digital transformation, business solutions, Saudi Arabia, technology', 'created_at' => now(), 'updated_at' => now()],
        ]);
    }

    public function down()
    {
        Schema::dropIfExists('site_settings');
    }
};