-- ==========================================================
-- TOPBD — Seed Data for Fresh Installation
-- ==========================================================

-- Categories
INSERT INTO `categories` (`id`, `name`, `slug`, `icon`, `display_order`, `is_active`) VALUES
(1, 'Business', 'business', 'Briefcase', 1, 1),
(2, 'Content Creator', 'content-creator', 'Video', 2, 1),
(3, 'Influencer', 'influencer', 'Sparkles', 3, 1),
(4, 'Startup', 'startup', 'Rocket', 4, 1),
(5, 'E-commerce', 'ecommerce', 'ShoppingBag', 5, 1),
(6, 'Developer', 'developer', 'Code', 6, 1),
(7, 'Agency', 'agency', 'Building', 7, 1),
(8, 'Software & App', 'software', 'Cpu', 8, 1),
(9, 'Gaming', 'gaming', 'Gamepad2', 9, 1),
(10, 'Media / News', 'media', 'Newspaper', 10, 1),
(11, 'Education', 'education', 'GraduationCap', 11, 1),
(12, 'Brand', 'brand', 'Award', 12, 1),
(13, 'Social Profile', 'social-profile', 'Share2', 13, 1),
(14, 'Other', 'other', 'MoreHorizontal', 14, 1);

-- Default Settings
INSERT INTO `settings` (`setting_key`, `setting_value`) VALUES
('site_name', 'TOPBD'),
('site_subtitle', 'Bangladesh\'s Live Ranking & Outbid Marketplace'),
('site_url', 'https://topbd.app'),
('currency_symbol', '৳'),
('minimum_bid_increment', '1'),
('initial_minimum_bid', '10'),
('visitor_timeout_seconds', '180'),
('pagination_size', '50'),
('maintenance_mode', '0'),
('primary_color', '#006A4E'),
('secondary_color', '#F42A41'),
('background_color', '#0A0D0F'),
('card_color', '#13181D'),
('text_color', '#F0F4F8'),
('muted_text_color', '#8A99A8'),
('border_color', '#222A33'),
('accent_color', '#F59E0B'),
('rank1_bg', '#1C2422'),
('rank1_border', '#EAB308'),
('rank2_bg', '#171E24'),
('rank3_bg', '#141B20'),
('header_bg', '#0A0D0FEE'),
('footer_bg', '#07090B'),
('border_radius', '12px'),
('developer_name', 'Arafat Rahman'),
('developer_handle', '@arafat'),
('developer_bio', 'Software engineer building real-time high-performance web applications and ranking engines in Bangladesh.'),
('developer_image', 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200&auto=format&fit=crop&q=80'),
('developer_github', 'https://github.com'),
('developer_twitter', 'https://twitter.com'),
('developer_enabled', '1');

-- Frontend Texts
INSERT INTO `frontend_texts` (`text_key`, `text_value`) VALUES
('site_logo_text', 'TOPBD'),
('live_ranking_badge', 'LIVE RANKING'),
('tab_all_time', 'ALL TIME'),
('tab_today', 'TODAY'),
('visitor_badge_prefix', 'visitors'),
('claim_hero_title', 'Claim #1 for'),
('claim_hero_desc', 'The public live outbid leaderboard of Bangladesh. Outbid the top spots to drive instant visibility and traffic to your business, channel, startup, or personal brand.'),
('category_all', 'ALL'),
('category_more', 'More Categories'),
('outbid_btn_text', 'OUTBID'),
('current_bid_label', 'Current Bid'),
('next_bid_label', 'Next Bid'),
('additional_amount_label', 'Additional amount'),
('payment_method_label', 'Select Payment Gateway'),
('modal_target_label', 'TARGET'),
('modal_name_placeholder', 'Business, product or personal name'),
('modal_url_placeholder', 'https://yourwebsite.com or social profile'),
('total_generated_prefix', 'TOPBD has generated'),
('total_generated_suffix', 'in verified bids since launch'),
('footer_attribution', 'Built by @arafat'),
('footer_brand_tagline', '· Brought to you by TOPBD');

-- Menu Items
INSERT INTO `menu_items` (`title`, `url`, `target`, `display_order`, `is_active`) VALUES
('Home', '/', '_self', 1, 1),
('Rules', '/rules', '_self', 2, 1),
('Live Stats', '/stats', '_self', 3, 1),
('Terms', '/terms', '_self', 4, 1),
('Privacy', '/privacy', '_self', 5, 1);

-- Payment Gateways
INSERT INTO `gateway_configs` (`gateway_id`, `name`, `is_enabled`, `mode`, `merchant_id`, `store_id`, `username`, `password`, `app_key`, `app_secret`, `api_url`, `callback_url`) VALUES
('bkash', 'bKash Merchant Payment', 1, 'test', '01700000000', '', 'sandbox_bkash_user', 'sandbox_bkash_pass', 'bkash_app_key_test', 'bkash_app_secret_test', 'https://tokenized.sandbox.bka.sh/v1.2.0-beta', '/payments/bkash/callback.php'),
('nagad', 'Nagad Direct Pay', 1, 'test', '683002007104', '', '', '', 'nagad_pub_test', 'nagad_priv_test', 'https://api-sandbox.nagad.com.bd', '/payments/nagad/callback.php'),
('rocket', 'DBBL Rocket Pay', 1, 'test', '019000000009', '', '', '', 'rocket_key_test', '', 'https://rocket.dutchbanglabank.com/api', '/payments/rocket/callback.php'),
('sslcommerz', 'SSLCommerz (Cards & MFS)', 1, 'test', '', 'topbd_testbox', '', 'topbd_test_pass', '', '', 'https://sandbox.sslcommerz.com', '/payments/sslcommerz/callback.php'),
('shurjopay', 'shurjoPay Merchant Payment', 1, 'test', 'sp_merchant_test', '', 'sp_user', 'sp_pass', '', '', 'https://sandbox.shurjopayment.com', '/payments/shurjopay/callback.php');

-- Initial Demo Listings
INSERT INTO `listings` (`id`, `name`, `image_url`, `url`, `category_id`, `current_bid`, `clicks`, `hearts`, `is_active`, `last_bid_at`) VALUES
(1, 'Chaldal Online Grocery', 'https://images.unsplash.com/photo-1542838132-92c53300491e?w=200&auto=format&fit=crop&q=80', 'https://chaldal.com', 5, 25000.00, 1420, 890, 1, NOW()),
(2, 'Pathao Super App', 'https://images.unsplash.com/photo-1526367790999-0150786686a2?w=200&auto=format&fit=crop&q=80', 'https://pathao.com', 4, 18500.00, 1120, 742, 1, NOW()),
(3, 'Rafsan The ChotoBhai', 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=200&auto=format&fit=crop&q=80', 'https://youtube.com', 2, 14200.00, 980, 630, 1, NOW()),
(4, 'ShopUp B2B Commerce', 'https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=200&auto=format&fit=crop&q=80', 'https://shopup.org', 1, 11000.00, 740, 480, 1, NOW()),
(5, 'Shikho EdTech BD', 'https://images.unsplash.com/photo-1503676260728-1c00da094a0b?w=200&auto=format&fit=crop&q=80', 'https://shikho.com', 11, 8800.00, 610, 395, 1, NOW());

-- Content Pages
INSERT INTO `pages` (`slug`, `title`, `content`) VALUES
('rules', 'Ranking & Outbid Rules', '# TOPBD Ranking & Outbid Rules\n\n1. **How Ranking Works**: Listings are ranked strictly in descending order of their verified bid amount.\n2. **Next Minimum Bid**: To outbid any position, your new bid must be at least ৳1 higher than target candidate.\n3. **Deterministic Tie-Breaking**: Highest bid first, then most recent verified payment.\n4. **No Duplicates**: Submitting an existing URL updates and moves that listing up.'),
('terms', 'Terms of Service', '# TOPBD Terms of Service\n\nAll payments submitted for bids and live promotional rankings are non-refundable once verified by payment gateways.'),
('privacy', 'Privacy Policy', '# TOPBD Privacy Policy\n\nWe respect user privacy. We never store credit card PINs or OTPs.'),
('stats', 'Live System Statistics', '# TOPBD Live System Statistics\n\nReal-time heartbeat polling and sub-millisecond ranking recalculation.');
