<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('product_showcases', function (Blueprint $table) {
            // Add theme_color field
            $table->string('theme_color')->default('#3b82f6')->after('products_limit');
            
            // Remove old color fields
            $table->dropColumn(['bg_color', 'title_color']);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('product_showcases', function (Blueprint $table) {
            $table->dropColumn('theme_color');
            
            // Restore old fields
            $table->string('bg_color')->default('#ffffff')->after('products_limit');
            $table->string('title_color')->default('#1f2937')->after('bg_color');
        });
    }
};
