<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\AuctionHouse;
use App\Models\AuctionVehicle;
use App\Services\Calculator\BangladeshLandedCostCalculator;
use Illuminate\Support\Str;
use Carbon\Carbon;

class AuctionSeeder extends Seeder
{
    public function run(): void
    {
        $calculator = app(BangladeshLandedCostCalculator::class);

        // 1. Japanese Auction Houses
        $houses = [
            ['name' => 'USS Tokyo', 'code' => 'USS-TKY', 'city' => 'Noda, Chiba', 'country' => 'Japan'],
            ['name' => 'TAA Yokohama', 'code' => 'TAA-YKH', 'city' => 'Yokohama', 'country' => 'Japan'],
            ['name' => 'CAA Chubu', 'code' => 'CAA-CHB', 'city' => 'Toyota, Aichi', 'country' => 'Japan'],
            ['name' => 'HAA Kobe', 'code' => 'HAA-KOB', 'city' => 'Kobe, Hyogo', 'country' => 'Japan'],
            ['name' => 'ARAI Tokyo', 'code' => 'ARAI-TKY', 'city' => 'Oyama, Tochigi', 'country' => 'Japan'],
            ['name' => 'JAA Tokyo', 'code' => 'JAA-TKY', 'city' => 'Tokyo', 'country' => 'Japan'],
        ];

        $houseModels = [];
        foreach ($houses as $house) {
            $houseModels[$house['code']] = AuctionHouse::updateOrCreate(['code' => $house['code']], $house);
        }

        // 2. 32 Realistic Japanese Auction Lots
        $auctionVehiclesData = [
            // USS Tokyo Lots
            [
                'house' => 'USS-TKY',
                'lot' => '50124',
                'make' => 'Toyota',
                'model' => 'Harrier',
                'package' => 'Z Leather Package',
                'year' => 2022,
                'mileage' => 19500,
                'engine_cc' => 1986,
                'fuel_type' => 'Petrol',
                'color' => 'White Pearl Crystal Shine',
                'grade' => '4.5',
                'starting_bid_jpy' => 2850000,
                'expected_bid_jpy' => 3300000,
                'hours_offset' => 14,
                'main_image' => 'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=1200&q=80',
                'damage_info' => 'Front bumper A1 scratch, Left front door U1 pinpoint dent. Clean interior A grade.',
            ],
            [
                'house' => 'USS-TKY',
                'lot' => '50198',
                'make' => 'Toyota',
                'model' => 'Corolla Cross',
                'package' => 'Hybrid Z',
                'year' => 2023,
                'mileage' => 8400,
                'engine_cc' => 1797,
                'fuel_type' => 'Hybrid',
                'color' => 'Platinum White Pearl',
                'grade' => '5.0',
                'starting_bid_jpy' => 2450000,
                'expected_bid_jpy' => 2850000,
                'hours_offset' => 22,
                'main_image' => 'https://images.unsplash.com/photo-1590362891988-f778047831d0?w=1200&q=80',
                'damage_info' => 'Flawless mint condition. Factory plastic covers still on sunvisors.',
            ],
            [
                'house' => 'USS-TKY',
                'lot' => '50312',
                'make' => 'Toyota',
                'model' => 'Land Cruiser Prado',
                'package' => 'TX L Package (Modellista)',
                'year' => 2021,
                'mileage' => 24000,
                'engine_cc' => 2693,
                'fuel_type' => 'Petrol',
                'color' => 'Attitude Black Mica',
                'grade' => '4.5',
                'starting_bid_jpy' => 4500000,
                'expected_bid_jpy' => 5200000,
                'hours_offset' => 18,
                'main_image' => 'https://images.unsplash.com/photo-1533473359331-0135ef1b58bf?w=1200&q=80',
                'damage_info' => 'Right rear quarter U1, Rear bumper A1. Genuine Modellista kit.',
            ],
            [
                'house' => 'USS-TKY',
                'lot' => '50450',
                'make' => 'Honda',
                'model' => 'Vezel',
                'package' => 'e:HEV Z',
                'year' => 2022,
                'mileage' => 16200,
                'engine_cc' => 1496,
                'fuel_type' => 'Hybrid',
                'color' => 'Meteoroid Gray Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 2100000,
                'expected_bid_jpy' => 2450000,
                'hours_offset' => 8,
                'main_image' => 'https://images.unsplash.com/photo-1541348263662-e0c8de4259ba?w=1200&q=80',
                'damage_info' => 'Minor stone chip on windshield A1. Interior pristine.',
            ],
            [
                'house' => 'USS-TKY',
                'lot' => '50567',
                'make' => 'Nissan',
                'model' => 'X-Trail',
                'package' => 'e-POWER G e-4ORCE',
                'year' => 2023,
                'mileage' => 11000,
                'engine_cc' => 1497,
                'fuel_type' => 'Hybrid (e-POWER)',
                'color' => 'Sunset Orange / Black Two-Tone',
                'grade' => '5.0',
                'starting_bid_jpy' => 3100000,
                'expected_bid_jpy' => 3650000,
                'hours_offset' => 28,
                'main_image' => 'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=1200&q=80',
                'damage_info' => 'Dealer test-drive vehicle. No noticeable scratches.',
            ],
            [
                'house' => 'USS-TKY',
                'lot' => '50689',
                'make' => 'Toyota',
                'model' => 'Noah',
                'package' => 'S-Z Hybrid 7-Seater',
                'year' => 2022,
                'mileage' => 19800,
                'engine_cc' => 1797,
                'fuel_type' => 'Hybrid',
                'color' => 'White Pearl Crystal Shine',
                'grade' => '4.5',
                'starting_bid_jpy' => 2950000,
                'expected_bid_jpy' => 3400000,
                'hours_offset' => 34,
                'main_image' => 'https://images.unsplash.com/photo-1552519507-da3b142c6e3d?w=1200&q=80',
                'damage_info' => 'Left sliding door minor scratch A1. Ottoman captain seats.',
            ],

            // TAA Yokohama Lots
            [
                'house' => 'TAA-YKH',
                'lot' => '30112',
                'make' => 'Toyota',
                'model' => 'Premio',
                'package' => 'F EX Package',
                'year' => 2020,
                'mileage' => 28400,
                'engine_cc' => 1496,
                'fuel_type' => 'Petrol',
                'color' => 'Pearl White',
                'grade' => '4.5',
                'starting_bid_jpy' => 1850000,
                'expected_bid_jpy' => 2150000,
                'hours_offset' => 12,
                'main_image' => 'https://images.unsplash.com/photo-1550355291-bbee04a92027?w=1200&q=80',
                'damage_info' => 'Front lip A1, Rear left door U1. Beige interior A grade.',
            ],
            [
                'house' => 'TAA-YKH',
                'lot' => '30245',
                'make' => 'Toyota',
                'model' => 'Allion',
                'package' => 'A15 G-Plus',
                'year' => 2020,
                'mileage' => 31500,
                'engine_cc' => 1496,
                'fuel_type' => 'Petrol',
                'color' => 'Silver Metallic',
                'grade' => '4.0',
                'starting_bid_jpy' => 1750000,
                'expected_bid_jpy' => 2050000,
                'hours_offset' => 20,
                'main_image' => 'https://images.unsplash.com/photo-1617814076367-b759c7d7e738?w=1200&q=80',
                'damage_info' => 'Left rear fender W1 repaint. Mechanically certified A1.',
            ],
            [
                'house' => 'TAA-YKH',
                'lot' => '30378',
                'make' => 'Toyota',
                'model' => 'RAV4',
                'package' => 'Adventure Off-Road Package',
                'year' => 2021,
                'mileage' => 22300,
                'engine_cc' => 1986,
                'fuel_type' => 'Petrol',
                'color' => 'Urban Khaki / Gray Roof',
                'grade' => '4.5',
                'starting_bid_jpy' => 2650000,
                'expected_bid_jpy' => 3100000,
                'hours_offset' => 26,
                'main_image' => 'https://images.unsplash.com/photo-1568605117036-5fe5e7bab0b7?w=1200&q=80',
                'damage_info' => 'Adventure matte black wheels. Clean undercarriage.',
            ],
            [
                'house' => 'TAA-YKH',
                'lot' => '30491',
                'make' => 'Toyota',
                'model' => 'Corolla Axio',
                'package' => 'Hybrid G',
                'year' => 2021,
                'mileage' => 24800,
                'engine_cc' => 1496,
                'fuel_type' => 'Hybrid',
                'color' => 'Super White II',
                'grade' => '4.5',
                'starting_bid_jpy' => 1350000,
                'expected_bid_jpy' => 1620000,
                'hours_offset' => 6,
                'main_image' => 'https://images.unsplash.com/photo-1619682817481-e994891cd1f5?w=1200&q=80',
                'damage_info' => 'Small scratch rear bumper A1. Complete service record.',
            ],
            [
                'house' => 'TAA-YKH',
                'lot' => '30560',
                'make' => 'Toyota',
                'model' => 'Corolla Fielder',
                'package' => 'Hybrid WxB',
                'year' => 2021,
                'mileage' => 27000,
                'engine_cc' => 1496,
                'fuel_type' => 'Hybrid',
                'color' => 'Black Mica',
                'grade' => '4.5',
                'starting_bid_jpy' => 1420000,
                'expected_bid_jpy' => 1700000,
                'hours_offset' => 16,
                'main_image' => 'https://images.unsplash.com/photo-1605559424843-9e4c228bf1c2?w=1200&q=80',
                'damage_info' => 'WxB black aero package. Half leather seats A grade.',
            ],

            // CAA Chubu Lots
            [
                'house' => 'CAA-CHB',
                'lot' => '40192',
                'make' => 'Honda',
                'model' => 'Grace',
                'package' => 'Hybrid EX',
                'year' => 2020,
                'mileage' => 33400,
                'engine_cc' => 1496,
                'fuel_type' => 'Hybrid',
                'color' => 'White Orchid Pearl',
                'grade' => '4.5',
                'starting_bid_jpy' => 1400000,
                'expected_bid_jpy' => 1650000,
                'hours_offset' => 10,
                'main_image' => 'https://images.unsplash.com/photo-1550355291-bbee04a92027?w=1200&q=80',
                'damage_info' => 'Right rear door A1, front bumper U1. Paddle shifters, cruise control.',
            ],
            [
                'house' => 'CAA-CHB',
                'lot' => '40283',
                'make' => 'Honda',
                'model' => 'Civic',
                'package' => 'EX Sedan VTEC Turbo',
                'year' => 2021,
                'mileage' => 21800,
                'engine_cc' => 1496,
                'fuel_type' => 'Petrol Turbo',
                'color' => 'Sonic Gray Pearl',
                'grade' => '4.5',
                'starting_bid_jpy' => 2300000,
                'expected_bid_jpy' => 2750000,
                'hours_offset' => 30,
                'main_image' => 'https://images.unsplash.com/photo-1617814076367-b759c7d7e738?w=1200&q=80',
                'damage_info' => 'Sunroof, black leather seats, Honda SENSING.',
            ],
            [
                'house' => 'CAA-CHB',
                'lot' => '40371',
                'make' => 'Honda',
                'model' => 'CR-V',
                'package' => 'e:HEV Masterpiece',
                'year' => 2021,
                'mileage' => 26400,
                'engine_cc' => 1993,
                'fuel_type' => 'Hybrid',
                'color' => 'Platinum White Pearl',
                'grade' => '4.5',
                'starting_bid_jpy' => 2950000,
                'expected_bid_jpy' => 3450000,
                'hours_offset' => 38,
                'main_image' => 'https://images.unsplash.com/photo-1568605117036-5fe5e7bab0b7?w=1200&q=80',
                'damage_info' => 'Brown leather interior, panoramic glass roof, power boot.',
            ],
            [
                'house' => 'CAA-CHB',
                'lot' => '40455',
                'make' => 'Nissan',
                'model' => 'Note',
                'package' => 'e-POWER X',
                'year' => 2022,
                'mileage' => 14200,
                'engine_cc' => 1198,
                'fuel_type' => 'Hybrid (e-POWER)',
                'color' => 'Vivid Blue / Black Roof',
                'grade' => '5.0',
                'starting_bid_jpy' => 1350000,
                'expected_bid_jpy' => 1650000,
                'hours_offset' => 4,
                'main_image' => 'https://images.unsplash.com/photo-1541348263662-e0c8de4259ba?w=1200&q=80',
                'damage_info' => 'Grade 5 mint condition. ProPILOT radar cruise.',
            ],

            // HAA Kobe Lots
            [
                'house' => 'HAA-KOB',
                'lot' => '60105',
                'make' => 'Nissan',
                'model' => 'Serena',
                'package' => 'e-POWER Highway Star V',
                'year' => 2022,
                'mileage' => 17600,
                'engine_cc' => 1198,
                'fuel_type' => 'Hybrid (e-POWER)',
                'color' => 'Diamond Black',
                'grade' => '4.5',
                'starting_bid_jpy' => 2350000,
                'expected_bid_jpy' => 2750000,
                'hours_offset' => 42,
                'main_image' => 'https://images.unsplash.com/photo-1552519507-da3b142c6e3d?w=1200&q=80',
                'damage_info' => 'Hands-free dual sliding doors, rear flip-down TV.',
            ],
            [
                'house' => 'HAA-KOB',
                'lot' => '60219',
                'make' => 'Mazda',
                'model' => 'CX-5',
                'package' => '20S Black Tone Edition',
                'year' => 2022,
                'mileage' => 18900,
                'engine_cc' => 1997,
                'fuel_type' => 'Petrol',
                'color' => 'Polymetal Gray Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 2450000,
                'expected_bid_jpy' => 2850000,
                'hours_offset' => 15,
                'main_image' => 'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=1200&q=80',
                'damage_info' => 'Black mirror caps, 19-inch gloss black alloys, red stitching.',
            ],
            [
                'house' => 'HAA-KOB',
                'lot' => '60334',
                'make' => 'Suzuki',
                'model' => 'Hustler',
                'package' => 'Hybrid G',
                'year' => 2022,
                'mileage' => 10500,
                'engine_cc' => 658,
                'fuel_type' => 'Hybrid',
                'color' => 'Denim Blue / White Two-Tone',
                'grade' => '5.0',
                'starting_bid_jpy' => 1050000,
                'expected_bid_jpy' => 1300000,
                'hours_offset' => 9,
                'main_image' => 'https://images.unsplash.com/photo-1590362891988-f778047831d0?w=1200&q=80',
                'damage_info' => 'Like-new grade 5 condition. Dual camera brake support.',
            ],
            [
                'house' => 'HAA-KOB',
                'lot' => '60481',
                'make' => 'Suzuki',
                'model' => 'Spacia Gear',
                'package' => 'Hybrid XZ',
                'year' => 2022,
                'mileage' => 13400,
                'engine_cc' => 658,
                'fuel_type' => 'Hybrid',
                'color' => 'Off Blue Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 1150000,
                'expected_bid_jpy' => 1400000,
                'hours_offset' => 25,
                'main_image' => 'https://images.unsplash.com/photo-1552519507-da3b142c6e3d?w=1200&q=80',
                'damage_info' => 'Outdoor utility styling, water-repellent interior.',
            ],
            [
                'house' => 'HAA-KOB',
                'lot' => '60592',
                'make' => 'Suzuki',
                'model' => 'Swift',
                'package' => 'Hybrid RS',
                'year' => 2021,
                'mileage' => 21000,
                'engine_cc' => 1242,
                'fuel_type' => 'Hybrid',
                'color' => 'Burning Red Pearl',
                'grade' => '4.5',
                'starting_bid_jpy' => 1280000,
                'expected_bid_jpy' => 1550000,
                'hours_offset' => 17,
                'main_image' => 'https://images.unsplash.com/photo-1541348263662-e0c8de4259ba?w=1200&q=80',
                'damage_info' => 'RS sport suspension, paddle shifters, sport bucket seats.',
            ],
            [
                'house' => 'HAA-KOB',
                'lot' => '60710',
                'make' => 'Mitsubishi',
                'model' => 'Outlander',
                'package' => 'PHEV G',
                'year' => 2022,
                'mileage' => 18200,
                'engine_cc' => 2359,
                'fuel_type' => 'Plug-in Hybrid',
                'color' => 'Sterling Silver Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 3800000,
                'expected_bid_jpy' => 4450000,
                'hours_offset' => 45,
                'main_image' => 'https://images.unsplash.com/photo-1533473359331-0135ef1b58bf?w=1200&q=80',
                'damage_info' => 'S-AWC 4WD, MI-PILOT driving assist, leather upholstery.',
            ],

            // ARAI Tokyo Lots
            [
                'house' => 'ARAI-TKY',
                'lot' => '70114',
                'make' => 'Toyota',
                'model' => 'Voxy',
                'package' => 'Hybrid S-Z (90 Series)',
                'year' => 2023,
                'mileage' => 9500,
                'engine_cc' => 1797,
                'fuel_type' => 'Hybrid',
                'color' => 'Attitude Black Mica',
                'grade' => '5.0',
                'starting_bid_jpy' => 3250000,
                'expected_bid_jpy' => 3750000,
                'hours_offset' => 31,
                'main_image' => 'https://images.unsplash.com/photo-1542282088-72c9c27ed0cd?w=1200&q=80',
                'damage_info' => 'Mint showroom condition. Full Modellista aero package.',
            ],
            [
                'house' => 'ARAI-TKY',
                'lot' => '70258',
                'make' => 'Toyota',
                'model' => 'Harrier',
                'package' => 'G Package',
                'year' => 2021,
                'mileage' => 28000,
                'engine_cc' => 1986,
                'fuel_type' => 'Petrol',
                'color' => 'Slate Gray Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 2450000,
                'expected_bid_jpy' => 2850000,
                'hours_offset' => 11,
                'main_image' => 'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=1200&q=80',
                'damage_info' => 'Front bumper A1, Left rear door U1. Toyota Safety Sense.',
            ],
            [
                'house' => 'ARAI-TKY',
                'lot' => '70390',
                'make' => 'Toyota',
                'model' => 'Corolla Cross',
                'package' => 'G Package Petrol',
                'year' => 2022,
                'mileage' => 21500,
                'engine_cc' => 1797,
                'fuel_type' => 'Petrol',
                'color' => 'Silver Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 1950000,
                'expected_bid_jpy' => 2300000,
                'hours_offset' => 21,
                'main_image' => 'https://images.unsplash.com/photo-1590362891988-f778047831d0?w=1200&q=80',
                'damage_info' => 'Clean auction sheet, 1 owner Japanese private vehicle.',
            ],
            [
                'house' => 'ARAI-TKY',
                'lot' => '70462',
                'make' => 'Honda',
                'model' => 'Vezel',
                'package' => 'G Package Petrol',
                'year' => 2022,
                'mileage' => 18700,
                'engine_cc' => 1496,
                'fuel_type' => 'Petrol',
                'color' => 'Crystal Black Pearl',
                'grade' => '4.5',
                'starting_bid_jpy' => 1850000,
                'expected_bid_jpy' => 2150000,
                'hours_offset' => 19,
                'main_image' => 'https://images.unsplash.com/photo-1541348263662-e0c8de4259ba?w=1200&q=80',
                'damage_info' => 'LED headlights, Honda SENSING, push start.',
            ],
            [
                'house' => 'ARAI-TKY',
                'lot' => '70588',
                'make' => 'Toyota',
                'model' => 'Premio',
                'package' => '1.5 F L Package',
                'year' => 2020,
                'mileage' => 37000,
                'engine_cc' => 1496,
                'fuel_type' => 'Petrol',
                'color' => 'Black Mica',
                'grade' => '4.0',
                'starting_bid_jpy' => 1650000,
                'expected_bid_jpy' => 1950000,
                'hours_offset' => 23,
                'main_image' => 'https://images.unsplash.com/photo-1550355291-bbee04a92027?w=1200&q=80',
                'damage_info' => 'Scratch on rear fender A2, minor door ding U1.',
            ],

            // JAA Tokyo Lots
            [
                'house' => 'JAA-TKY',
                'lot' => '80120',
                'make' => 'Toyota',
                'model' => 'Land Cruiser Prado',
                'package' => 'TX 5-Seater',
                'year' => 2021,
                'mileage' => 27500,
                'engine_cc' => 2693,
                'fuel_type' => 'Petrol',
                'color' => 'Bronze Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 4100000,
                'expected_bid_jpy' => 4750000,
                'hours_offset' => 37,
                'main_image' => 'https://images.unsplash.com/photo-1533473359331-0135ef1b58bf?w=1200&q=80',
                'damage_info' => 'Sunroof, roof rails, 4WD high/low transfer case.',
            ],
            [
                'house' => 'JAA-TKY',
                'lot' => '80249',
                'make' => 'Nissan',
                'model' => 'X-Trail',
                'package' => '20Xi Leather Edition',
                'year' => 2021,
                'mileage' => 31000,
                'engine_cc' => 1997,
                'fuel_type' => 'Hybrid',
                'color' => 'Brilliant White Pearl',
                'grade' => '4.5',
                'starting_bid_jpy' => 2150000,
                'expected_bid_jpy' => 2500000,
                'hours_offset' => 13,
                'main_image' => 'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=1200&q=80',
                'damage_info' => 'Black leather, ProPILOT, around view camera.',
            ],
            [
                'house' => 'JAA-TKY',
                'lot' => '80381',
                'make' => 'Mazda',
                'model' => 'CX-5',
                'package' => '25S L Package',
                'year' => 2021,
                'mileage' => 29400,
                'engine_cc' => 2488,
                'fuel_type' => 'Petrol',
                'color' => 'Machine Gray Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 2550000,
                'expected_bid_jpy' => 2950000,
                'hours_offset' => 27,
                'main_image' => 'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=1200&q=80',
                'damage_info' => 'White Nappa leather, ventilated seats, 360 camera.',
            ],
            [
                'house' => 'JAA-TKY',
                'lot' => '80499',
                'make' => 'Suzuki',
                'model' => 'Hustler',
                'package' => 'J Style II Two-Tone',
                'year' => 2023,
                'mileage' => 6500,
                'engine_cc' => 658,
                'fuel_type' => 'Hybrid',
                'color' => 'Khaki / Soft Beige Roof',
                'grade' => '5.0',
                'starting_bid_jpy' => 1250000,
                'expected_bid_jpy' => 1500000,
                'hours_offset' => 5,
                'main_image' => 'https://images.unsplash.com/photo-1590362891988-f778047831d0?w=1200&q=80',
                'damage_info' => 'Special Edition J Style II with chrome grille and leatherette trim.',
            ],
            [
                'house' => 'JAA-TKY',
                'lot' => '80612',
                'make' => 'Toyota',
                'model' => 'Allion',
                'package' => 'A18 G Package',
                'year' => 2020,
                'mileage' => 35000,
                'engine_cc' => 1797,
                'fuel_type' => 'Petrol',
                'color' => 'Silver Metallic',
                'grade' => '4.5',
                'starting_bid_jpy' => 1800000,
                'expected_bid_jpy' => 2100000,
                'hours_offset' => 33,
                'main_image' => 'https://images.unsplash.com/photo-1617814076367-b759c7d7e738?w=1200&q=80',
                'damage_info' => '1.8L Valvematic engine, wooden steering, black interior.',
            ],
        ];

        foreach ($auctionVehiclesData as $index => $data) {
            $house = $houseModels[$data['house']];
            $auctionDate = Carbon::now()->addHours($data['hours_offset']);
            
            // Calculate landed cost based on starting bid
            $calc = $calculator->calculate([
                'price_jpy' => $data['starting_bid_jpy'],
                'engine_cc' => $data['engine_cc'],
                'fuel_type' => $data['fuel_type'],
                'is_hybrid' => str_contains(strtolower($data['fuel_type']), 'hybrid'),
                'year' => $data['year'],
            ]);

            $slug = Str::slug("{$data['make']}-{$data['model']}-{$data['year']}-lot-{$data['lot']}");

            AuctionVehicle::updateOrCreate(
                ['lot_number' => $data['lot']],
                [
                    'auction_house_id' => $house->id,
                    'slug' => $slug,
                    'chassis_number' => strtoupper(substr($data['make'], 0, 3)) . rand(10, 99) . '-' . rand(100000, 999999),
                    'make' => $data['make'],
                    'model' => $data['model'],
                    'package' => $data['package'],
                    'year' => $data['year'],
                    'mileage' => $data['mileage'],
                    'engine_cc' => $data['engine_cc'],
                    'fuel_type' => $data['fuel_type'],
                    'transmission' => 'Automatic',
                    'drive_type' => str_contains(strtolower($data['package'] ?? ''), '4wd') ? '4WD' : '2WD',
                    'color' => $data['color'],
                    'auction_grade' => $data['grade'],
                    'interior_grade' => 'A',
                    'exterior_grade' => $data['grade'] === '5.0' ? 'A' : ($data['grade'] === '4.5' ? 'A' : 'B'),
                    'starting_bid_jpy' => $data['starting_bid_jpy'],
                    'expected_bid_jpy' => $data['expected_bid_jpy'],
                    'current_highest_bid_jpy' => $data['starting_bid_jpy'],
                    'estimated_bd_cost_bdt' => $calc['total_landed_cost_bdt'],
                    'auction_date' => $auctionDate->toDateString(),
                    'auction_time' => $auctionDate->format('H:i:s'),
                    'auction_starts_at' => $auctionDate->copy()->subMinutes(30),
                    'auction_ends_at' => $auctionDate,
                    'main_image' => $data['main_image'],
                    'gallery' => [
                        $data['main_image'],
                        'https://images.unsplash.com/photo-1549399542-7e3f8b79c341?w=800&q=80',
                        'https://images.unsplash.com/photo-1550355291-bbee04a92027?w=800&q=80',
                    ],
                    'auction_sheet_url' => 'https://images.unsplash.com/photo-1586281380349-632531db7ed4?w=800&q=80',
                    'condition_map' => [
                        'front_bumper' => 'A1 (Minor Stone Scratches)',
                        'hood' => 'Clear, Original Paint',
                        'left_front_fender' => 'Original',
                        'left_front_door' => 'U1 (Pinpoint Dent)',
                        'rear_bumper' => 'A1',
                        'right_rear_fender' => 'Clear',
                        'roof' => 'Pristine, No UV Fade',
                    ],
                    'damage_info' => $data['damage_info'],
                    'equipment_options' => 'Push Start, Keyless Go, Power Windows, Alloy Wheels, Anti-lock Braking, SRS Airbags, Digital Climate Control',
                    'status' => 'live',
                    'result_status' => 'pending',
                    'bids_count' => rand(1, 6),
                    'views_count' => rand(50, 450),
                ]
            );
        }
    }
}
