<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     * Create user profiles table for role-specific data.
     */
    public function up(): void
    {
        Schema::create('user_profiles', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->json('role_specific_data')->nullable();
            $table->string('company_name', 191)->nullable();
            $table->string('address')->nullable();
            $table->string('city', 100)->nullable();
            $table->string('state', 100)->nullable();
            $table->string('country', 100)->nullable();
            $table->string('postal_code', 20)->nullable();
            $table->string('emergency_contact_name', 191)->nullable();
            $table->string('emergency_contact_phone', 20)->nullable();
            $table->text('bio')->nullable();
            $table->string('website')->nullable();
            $table->string('linkedin')->nullable();
            $table->string('twitter')->nullable();
            $table->string('facebook')->nullable();
            $table->string('instagram')->nullable();
            $table->string('certification', 191)->nullable();
            $table->string('specialization', 191)->nullable();
            $table->integer('experience_years')->nullable();
            $table->string('fitness_level', 50)->nullable();
            $table->text('goals')->nullable();
            $table->text('medical_conditions')->nullable();
            $table->string('trainer_preference', 191)->nullable();
            $table->text('expertise_areas')->nullable();
            $table->string('mentoring_experience', 191)->nullable();
            $table->string('availability', 100)->nullable();
            $table->text('learning_goals')->nullable();
            $table->string('experience_level', 50)->nullable();
            $table->string('mentor_preference', 191)->nullable();
            $table->string('partnership_type', 100)->nullable();
            $table->string('contact_person', 191)->nullable();
            $table->string('contribution_type', 100)->nullable();
            $table->string('portfolio_url')->nullable();
            $table->text('skills')->nullable();
            $table->string('marketing_focus', 191)->nullable();
            $table->string('target_audience', 191)->nullable();
            $table->string('campaign_experience', 191)->nullable();
            $table->timestamps();
            
            $table->index('user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_profiles');
    }
};
