<?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],

            // ── 消息气泡装扮 ──────────────────────────
            ['name' => '鎏金流光气泡', 'slug' => 'msg_bubble_golden', 'icon' => '🟡',
                'description' => '浅金底纹、左侧金线和流光扫过，发言更醒目但不刺眼。',
                'price' => 5000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 50],
            ['name' => '樱语花笺气泡', 'slug' => 'msg_bubble_sakura', 'icon' => '🌸',
                'description' => '粉白信笺底色配花点纹理，适合温柔、浪漫的发言氛围。',
                'price' => 5000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 51],
            ['name' => '星河微光气泡', 'slug' => 'msg_bubble_star', 'icon' => '🌌',
                'description' => '淡蓝星河底纹和微光星点，保留清爽阅读感。',
                'price' => 5000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 52],
            ['name' => '霓虹彩带气泡', 'slug' => 'msg_bubble_rainbow', 'icon' => '🌈',
                'description' => '顶部流动彩带和浅色底框，发言有动态高光。',
                'price' => 5000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 53],
            ['name' => '皇冠礼赞气泡', 'slug' => 'msg_bubble_crown', 'icon' => '👑',
                'description' => '金色礼赞底纹、皇冠角标和侧边金线，突出尊贵发言。',
                'price' => 5000, 'type' => 'msg_bubble', 'duration_days' => 1, 'sort_order' => 54],

            // ── 昵称颜色装扮 ──────────────────────────
            ['name' => '金色昵称', 'slug' => 'msg_name_golden', 'icon' => '🥇',
                'description' => '让你的昵称闪耀金光。',
                'price' => 3000, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 60],
            ['name' => '渐变昵称', 'slug' => 'msg_name_rainbow', 'icon' => '🎨',
                'description' => '彩虹渐变色昵称，五彩斑斓。',
                'price' => 3000, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 61],
            ['name' => '发光昵称', 'slug' => 'msg_name_glow', 'icon' => '✨',
                'description' => '昵称带柔和发光效果，暗夜中最亮的星。',
                'price' => 3000, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 62],
            ['name' => '火焰昵称', 'slug' => 'msg_name_flame', 'icon' => '🔥',
                'description' => '火焰色脉动昵称，热情似火。',
                'price' => 3000, 'type' => 'msg_name_color', 'duration_days' => 1, 'sort_order' => 63],

            // ── 消息文字颜色特效装扮 ─────────────────
            ['name' => '七彩文字', 'slug' => 'msg_text_rainbow', 'icon' => '🌈',
                'description' => '文字色彩在彩虹七色间平滑流动，发言自带虹光特效。',
                'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 65],
            ['name' => '流光文字', 'slug' => 'msg_text_shimmer', 'icon' => '💫',
                'description' => '一道流光从左到右扫过文字表面，如金属般闪亮。',
                'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 66],
            ['name' => '霓虹文字', 'slug' => 'msg_text_neon', 'icon' => '💜',
                'description' => '紫蓝霓虹光晕在文字周围脉动呼吸，像灯牌一样醒目。',
                'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 67],
            ['name' => '火焰文字', 'slug' => 'msg_text_flame', 'icon' => '🔥',
                'description' => '橙红烈火在文字中上下跃动，热情燃烧般的视觉冲击。',
                'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 68],
            ['name' => '冰蓝文字', 'slug' => 'msg_text_ice', 'icon' => '❄️',
                'description' => '冰蓝晶光在文字表面流转，如同冰晶折射出的冷艳光泽。',
                'price' => 8000, 'type' => 'msg_text_color', 'duration_days' => 1, 'sort_order' => 69],

            // ── 头像框装扮 ────────────────────────────
            ['name' => '月银守护头像框', 'slug' => 'avatar_frame_silver', 'icon' => '🥈',
                'description' => '银白金属光泽外框，低调但比普通头像更精致。',
                'price' => 8888, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 70],
            ['name' => '金辉勋章头像框', 'slug' => 'avatar_frame_gold', 'icon' => '🥇',
                'description' => '金色勋章质感外框，带柔和光晕。',
                'price' => 8888, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 71],
            ['name' => '星轨环绕头像框', 'slug' => 'avatar_frame_star', 'icon' => '⭐',
                'description' => '星轨渐变环绕头像旋转，适合高调展示。',
                'price' => 8888, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 72],
            ['name' => '龙焰御守头像框', 'slug' => 'avatar_frame_dragon', 'icon' => '🐉',
                'description' => '红金御守质感外框，带虚线纹理和强烈光晕。',
                'price' => 8888, 'type' => 'avatar_frame', 'duration_days' => 1, 'sort_order' => 73],
        ];

        foreach ($items as $item) {
            // 商品名和描述可能随视觉样式迭代，Seeder 重跑时需要同步更新展示文案。
            ShopItem::updateOrCreate(['slug' => $item['slug']], $item + ['is_active' => true]);
        }
    }
}
