<?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('social_links', function (Blueprint $table) {
            $table->id();
            $table->string('platform', 100);          // e.g. facebook, instagram, tiktok, whatsapp, youtube
            $table->string('label', 150);             // Display label, e.g. "Facebook"
            $table->string('url', 500);               // Full URL
            $table->text('icon_svg')->nullable();     // Raw SVG string (admin pastes inline SVG)
            $table->string('color', 20)->nullable();  // Hex color for icon bg, e.g. #1877F2
            $table->boolean('show_in_footer')->default(true);
            $table->boolean('show_in_fab')->default(false);    // Show in floating action buttons
            $table->unsignedTinyInteger('sort_order')->default(0);
            $table->boolean('is_active')->default(true);
            $table->timestamps();
        });
    }

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