<?php

/**
 * 文件功能：商店初始商品数据填充器
 * 初始化商店基础商品：经典特效卡、新增特效卡、周卡与改名卡
 */

namespace Database\Seeders;

use App\Models\ShopItem;
use Illuminate\Database\Seeder;

class ShopItemSeeder extends Seeder
{
    /**
     * 填充商店商品初始数据
     */
    public function run(): void
    {
        $items = [
            // ── 单次特效卡（立即播放一次，888金币）────────────────
            ['name' => '烟花单次卡', 'slug' => 'once_fireworks', 'icon' => '🎆',
                'description' => '购买即刻在聊天室绽放一场烟花（仅自己可见），喜庆氛围拉满！',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 1],
            ['name' => '下雨单次卡', 'slug' => 'once_rain', 'icon' => '🌧',
                'description' => '立刻召唤一场滂沱大雨，感受诗意雨天（仅自己可见）。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 2],
            ['name' => '雷电单次卡', 'slug' => 'once_lightning', 'icon' => '⚡',
                'description' => '电闪雷鸣，瞬间震撼全场！立即触发雷电特效（仅自己可见）。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 3],
            ['name' => '下雪单次卡', 'slug' => 'once_snow', 'icon' => '❄️',
                'description' => '银装素裹，漫天飞雪！立即触发下雪特效（仅自己可见）。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 4],
            ['name' => '樱花飘落单次卡', 'slug' => 'once_sakura', 'icon' => '🌸',
                'description' => '购买即刻在聊天室飘落浪漫樱花，适合欢迎、节日与轻氛围场景。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 5],
            ['name' => '流星单次卡', 'slug' => 'once_meteors', 'icon' => '🌠',
                'description' => '流星划过夜空，亮度更强、数量更多，适合 VIP 登场和晚间氛围。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 6],
            ['name' => '金币雨单次卡', 'slug' => 'once_gold-rain', 'icon' => '🪙',
                'description' => '金币从天而降，适合开奖、奖励和活动发放时刻。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 7],
            ['name' => '爱心飘落单次卡', 'slug' => 'once_hearts', 'icon' => '💖',
                'description' => '柔和爱心缓缓飘落，适合婚礼、表白与祝福场景。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 8],
            ['name' => '彩带庆典单次卡', 'slug' => 'once_confetti', 'icon' => '🎊',
                'description' => '连续彩带和纸屑庆典从天而降，适合公告、中奖和庆祝。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 9],
            ['name' => '萤火虫单次卡', 'slug' => 'once_fireflies', 'icon' => '✨',
                'description' => '发光萤火虫在屏幕间穿梭，适合安静、夜色和浪漫房间。',
                'price' => 888, 'type' => 'instant', 'duration_days' => null, 'sort_order' => 10],

            // ── 周卡（登录自动播放7天，8888金币）──────────────────
            ['name' => '烟花周卡', 'slug' => 'week_fireworks', 'icon' => '🎆',
                'description' => '连续7天，每次进入聊天室自动绽放烟花！同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 11],
            ['name' => '下雨周卡', 'slug' => 'week_rain', 'icon' => '🌧',
                'description' => '连续7天，每次进入聊天室自动下雨。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 12],
            ['name' => '雷电周卡', 'slug' => 'week_lightning', 'icon' => '⚡',
                'description' => '连续7天，每次进入聊天室自动触发雷电特效。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 13],
            ['name' => '下雪周卡', 'slug' => 'week_snow', 'icon' => '❄️',
                'description' => '连续7天，每次进入聊天室自动下雪。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 14],
            ['name' => '樱花飘落周卡', 'slug' => 'week_sakura', 'icon' => '🌸',
                'description' => '连续7天，每次进入聊天室自动飘落樱花。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 15],
            ['name' => '流星周卡', 'slug' => 'week_meteors', 'icon' => '🌠',
                'description' => '连续7天，每次进入聊天室自动划过流星。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 16],
            ['name' => '金币雨周卡', 'slug' => 'week_gold-rain', 'icon' => '🪙',
                'description' => '连续7天，每次进入聊天室自动触发金币雨。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 17],
            ['name' => '爱心飘落周卡', 'slug' => 'week_hearts', 'icon' => '💖',
                'description' => '连续7天，每次进入聊天室自动飘落爱心。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 18],
            ['name' => '彩带庆典周卡', 'slug' => 'week_confetti', 'icon' => '🎊',
                'description' => '连续7天，每次进入聊天室自动触发彩带庆典。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 19],
            ['name' => '萤火虫周卡', 'slug' => 'week_fireflies', 'icon' => '✨',
                'description' => '连续7天，每次进入聊天室自动飞出萤火虫。同时只能激活一种周卡。',
                'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 20],

            // ── 改名卡（一次性，5000金币）────────────────────────
            ['name' => '改名卡', 'slug' => 'rename_card', 'icon' => '🎭',
                'description' => '使用后可修改一次昵称（旧名保留30天黑名单，不可被他人注册）。注意：历史聊天记录中的旧名不会更改。',
                'price' => 5000, 'type' => 'one_time', 'duration_days' => null, 'sort_order' => 30],
        ];

        foreach ($items as $item) {
            ShopItem::firstOrCreate(['slug' => $item['slug']], $item + ['is_active' => true]);
        }
    }
}
