<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('microsite_settings', function (Blueprint $table) {
            $table->id();
            $table->foreignId('seller_id')->constrained()->onDelete('cascade');
            
            // Hero Section
            $table->string('tagline')->nullable();
            $table->string('cta_text')->default('Contact Us');
            $table->string('cta_link')->nullable();
            
            // Stats Section
            $table->boolean('show_stats')->default(true);
            $table->integer('years_in_business')->nullable();
            $table->integer('happy_clients')->nullable();
            $table->integer('products_sold')->nullable();
            
            // Section Visibility
            $table->boolean('show_about')->default(true);
            $table->boolean('show_products')->default(true);
            $table->boolean('show_certificates')->default(true);
            $table->boolean('show_testimonials')->default(true);
            $table->boolean('show_faq')->default(true);
            $table->boolean('show_video')->default(false);
            $table->boolean('show_contact')->default(true);
            
            // Video Section
            $table->string('video_url')->nullable();
            $table->string('video_title')->nullable();
            
            // Brochure
            $table->string('brochure_path')->nullable();
            
            // Analytics
            $table->unsignedBigInteger('page_views')->default(0);
            $table->unsignedBigInteger('inquiry_count')->default(0);
            
            // SEO
            $table->string('meta_title')->nullable();
            $table->text('meta_description')->nullable();
            $table->string('meta_keywords')->nullable();
            
            $table->timestamps();
        });
    }

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