<?php

namespace Database\Seeders;

use App\Models\Trailer;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;

class TrailerSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $trailers = [
            [
                'title' => 'Three The Hard Way',
                'slug' => Str::slug('Three The Hard Way'),
                'tagline' => 'A covert mission comes back to life.',
                'short_description' => 'After a mission goes silent, a special unit is pulled back into the field and forced to confront a conspiracy that never truly ended.',
                'description' => 'A tense vertical thriller built around fractured loyalty, fast reveals, and escalating consequences.',
                'release_year' => 2026,
                'duration_label' => '12 episodes',
                'sort_order' => 1,
                'is_featured' => true,
                'is_published' => true,
                'published_at' => now(),
            ],
            [
                'title' => 'The Stolen Bride',
                'slug' => Str::slug('The Stolen Bride'),
                'tagline' => 'A wedding. A betrayal. A city watching.',
                'short_description' => 'When a bride disappears before the ceremony, two powerful families collide and buried secrets begin to surface.',
                'description' => 'A relationship-driven micro-drama with sharp turns, emotional reversals, and cinematic tension.',
                'release_year' => 2026,
                'duration_label' => '10 episodes',
                'sort_order' => 2,
                'is_featured' => true,
                'is_published' => true,
                'published_at' => now(),
            ],
            [
                'title' => 'Married to a Convict',
                'slug' => Str::slug('Married to a Convict'),
                'tagline' => 'Love becomes a dangerous sentence.',
                'short_description' => 'A woman enters a marriage she never expected and discovers the life she married into is far more dangerous than anyone admitted.',
                'description' => 'This series blends romance, pressure, and moral conflict into a fast-moving vertical story.',
                'release_year' => 2026,
                'duration_label' => '14 episodes',
                'sort_order' => 3,
                'is_featured' => true,
                'is_published' => true,
                'published_at' => now(),
            ],
            [
                'title' => 'Life of a Side Wife',
                'slug' => Str::slug('Life of a Side Wife'),
                'tagline' => 'Status has a cost.',
                'short_description' => 'A woman navigates power, reputation, and emotional survival inside a relationship built on unequal terms.',
                'description' => 'An emotionally charged vertical drama about identity, control, and choosing when to walk away.',
                'release_year' => 2026,
                'duration_label' => '16 episodes',
                'sort_order' => 4,
                'is_featured' => true,
                'is_published' => true,
                'published_at' => now(),
            ],
            [
                'title' => 'After Midnight',
                'slug' => Str::slug('After Midnight'),
                'tagline' => 'Some truths only appear in the dark.',
                'short_description' => 'An investigative host follows a trail of late-night crimes that all point back to the same protected circle.',
                'description' => 'A noir-inspired vertical suspense series with a relentless pace and clean visual hooks.',
                'release_year' => 2026,
                'duration_label' => '8 episodes',
                'sort_order' => 5,
                'is_featured' => false,
                'is_published' => true,
                'published_at' => now(),
            ],
            [
                'title' => 'Bloodline Contract',
                'slug' => Str::slug('Bloodline Contract'),
                'tagline' => 'Family first, until survival comes second.',
                'short_description' => 'A legacy agreement between two families turns into a dangerous battle for control when the next generation refuses to obey.',
                'description' => 'A dramatic vertical series focused on inheritance, ambition, and impossible choices.',
                'release_year' => 2026,
                'duration_label' => '9 episodes',
                'sort_order' => 6,
                'is_featured' => false,
                'is_published' => true,
                'published_at' => now(),
            ],
        ];

        foreach ($trailers as $attributes) {
            Trailer::query()->updateOrCreate(
                ['title' => $attributes['title']],
                $attributes,
            );
        }
    }
}
