-- Sample Modules for Boxing Day 2026 Game System
-- This file contains example modules demonstrating all module types
-- Customize these for your specific games and requirements

-- ============================================================================
-- WELCOME MODULE
-- ============================================================================
USE ianntest_boxingday;


INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('welcome-2026', 'Boxing Day 2026 Welcome', 'welcome', '{
  "title": "Boxing Day 2026",
  "subtitle": "Family Game Night",
  "logo": "/assets/images/branding/g-media-logo.png",
  "backgroundColor": "#1a1a1a",
  "textColor": "#ffffff",
  "showDate": true,
  "animation": "fade"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- GAME CARD MODULES
-- ============================================================================

-- Trivia Game Card
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('trivia-challenge', 'Trivia Challenge', 'game_card', '{
  "title": "Trivia Challenge",
  "description": "Test your knowledge across multiple categories",
  "logo": "/assets/images/game-cards/trivia-logo.png",
  "backgroundColor": "#2563eb",
  "textColor": "#ffffff",
  "music": "/assets/audio/music/trivia-theme.mp3",
  "rules": [
    "Teams take turns answering questions",
    "Each correct answer earns points",
    "Categories range from pop culture to history",
    "Bonus points for speed rounds"
  ],
  "duration": "30 minutes",
  "teams": "2-4",
  "difficulty": "Medium"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Charades Game Card
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('charades-showdown', 'Charades Showdown', 'game_card', '{
  "title": "Charades Showdown",
  "description": "Act it out without saying a word",
  "logo": "/assets/images/game-cards/charades-logo.png",
  "backgroundColor": "#dc2626",
  "textColor": "#ffffff",
  "music": "/assets/audio/music/charades-theme.mp3",
  "rules": [
    "One player acts out the word or phrase",
    "Team has 60 seconds to guess",
    "No talking or sounds allowed",
    "Points awarded for correct guesses"
  ],
  "duration": "20 minutes",
  "teams": "2-4",
  "difficulty": "Easy"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Pictionary Game Card
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('pictionary-battle', 'Pictionary Battle', 'game_card', '{
  "title": "Pictionary Battle",
  "description": "Draw your way to victory",
  "logo": "/assets/images/game-cards/pictionary-logo.png",
  "backgroundColor": "#16a34a",
  "textColor": "#ffffff",
  "music": "/assets/audio/music/pictionary-theme.mp3",
  "rules": [
    "One player draws while team guesses",
    "60 seconds per round",
    "No letters, numbers, or symbols",
    "Points for correct guesses"
  ],
  "duration": "25 minutes",
  "teams": "2-4",
  "difficulty": "Medium"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Speed Round Game Card
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('lightning-round', 'Lightning Round', 'game_card', '{
  "title": "Lightning Round",
  "description": "Fast-paced rapid-fire questions",
  "logo": "/assets/images/game-cards/lightning-logo.png",
  "backgroundColor": "#f59e0b",
  "textColor": "#000000",
  "music": "/assets/audio/music/lightning-theme.mp3",
  "rules": [
    "Rapid-fire questions for 60 seconds",
    "Quick answers only",
    "No conferring with team",
    "1 point per correct answer"
  ],
  "duration": "15 minutes",
  "teams": "2-4",
  "difficulty": "Hard"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- LEADERBOARD MODULES
-- ============================================================================

-- Main Leaderboard
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('live-leaderboard', 'Live Leaderboard', 'leaderboard', '{
  "title": "Current Standings",
  "showTop": 10,
  "sortBy": "score",
  "showBars": true,
  "animateChanges": true,
  "showTeamColors": true,
  "updateInterval": 2000,
  "highlightFirst": true,
  "showScoreDiff": true
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Team Leaderboard
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('team-rankings', 'Team Rankings', 'leaderboard', '{
  "title": "Team Standings",
  "showTop": 4,
  "sortBy": "score",
  "showBars": true,
  "animateChanges": true,
  "showTeamColors": true,
  "updateInterval": 2000,
  "highlightFirst": true,
  "showScoreDiff": true,
  "displayMode": "teams"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- TIMER MODULES
-- ============================================================================

-- 60 Second Timer
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('60-second-timer', '60 Second Timer', 'timer', '{
  "duration": 60,
  "title": "60 Seconds",
  "autoStart": false,
  "showMilliseconds": false,
  "warningAt": 10,
  "criticalAt": 5,
  "sound": "/assets/audio/effects/timer-beep.mp3",
  "endSound": "/assets/audio/effects/timer-end.mp3",
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "warningColor": "#f59e0b",
  "criticalColor": "#dc2626"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- 30 Second Timer
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('30-second-timer', '30 Second Timer', 'timer', '{
  "duration": 30,
  "title": "30 Seconds",
  "autoStart": false,
  "showMilliseconds": false,
  "warningAt": 10,
  "criticalAt": 5,
  "sound": "/assets/audio/effects/timer-beep.mp3",
  "endSound": "/assets/audio/effects/timer-end.mp3",
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "warningColor": "#f59e0b",
  "criticalColor": "#dc2626"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- 10 Second Timer
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('10-second-timer', '10 Second Timer', 'timer', '{
  "duration": 10,
  "title": "10 Seconds",
  "autoStart": false,
  "showMilliseconds": true,
  "warningAt": 5,
  "criticalAt": 3,
  "sound": "/assets/audio/effects/timer-beep.mp3",
  "endSound": "/assets/audio/effects/timer-end.mp3",
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "warningColor": "#f59e0b",
  "criticalColor": "#dc2626"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- COUNTER MODULES
-- ============================================================================

-- Points Counter
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('points-counter', 'Points Counter', 'interactive', '{
  "title": "Points",
  "initialValue": 0,
  "minValue": 0,
  "maxValue": 999,
  "step": 5,
  "showButtons": true,
  "allowNegative": false,
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "buttonColor": "#3b82f6"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Round Counter
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('round-counter', 'Round Counter', 'interactive', '{
  "title": "Round",
  "initialValue": 1,
  "minValue": 1,
  "maxValue": 10,
  "step": 1,
  "showButtons": true,
  "allowNegative": false,
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "buttonColor": "#10b981"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- RULES MODULES
-- ============================================================================

-- General Rules
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('general-rules', 'General Rules', 'interactive', '{
  "title": "Game Night Rules",
  "rules": [
    "Have fun and be respectful to all players",
    "No phones during active gameplay",
    "Listen to the host and follow instructions",
    "Celebrate wins graciously, learn from losses",
    "Keep the energy positive and supportive",
    "Time limits are strictly enforced",
    "Disputes are resolved by the host"
  ],
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "showNumbering": true,
  "animation": "slide"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Trivia Rules
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('trivia-rules', 'Trivia Rules', 'interactive', '{
  "title": "Trivia Challenge Rules",
  "rules": [
    "Teams take turns selecting categories",
    "30 seconds to answer each question",
    "Correct answer: +10 points",
    "Incorrect answer: -5 points",
    "Bonus rounds worth double points",
    "No phones or outside help allowed",
    "Host decision is final"
  ],
  "backgroundColor": "#2563eb",
  "textColor": "#ffffff",
  "showNumbering": true,
  "animation": "fade"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- TEXT DISPLAY MODULES
-- ============================================================================

-- Announcement
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('game-announcement', 'Game Announcement', 'interactive', '{
  "title": "Next Up",
  "content": "Get ready for the next exciting game!",
  "fontSize": "large",
  "textAlign": "center",
  "backgroundColor": "#1e293b",
  "textColor": "#ffffff",
  "animation": "bounce"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- Break Time
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('break-time', 'Break Time', 'interactive', '{
  "title": "Break Time",
  "content": "Take a 10 minute break. Grab snacks and drinks!",
  "fontSize": "large",
  "textAlign": "center",
  "backgroundColor": "#16a34a",
  "textColor": "#ffffff",
  "animation": "pulse"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- IMAGE DISPLAY MODULES
-- ============================================================================

-- Sponsor Logo
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('sponsor-display', 'Sponsor Display', 'interactive', '{
  "title": "Presented By",
  "imageUrl": "/assets/images/branding/sponsor-logo.png",
  "fit": "contain",
  "backgroundColor": "#ffffff",
  "showTitle": true,
  "animation": "fade"
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- VIDEO MODULES
-- ============================================================================

-- Intro Video
INSERT INTO modules (slug, name, type, config, is_active, created_at) VALUES
('intro-video', 'Intro Video', 'interactive', '{
  "title": "Welcome Video",
  "videoUrl": "/assets/video/intro.mp4",
  "autoplay": true,
  "loop": false,
  "controls": false,
  "muted": false
}', FALSE, NOW())
ON DUPLICATE KEY UPDATE
    name = VALUES(name),
    type = VALUES(type),
    config = VALUES(config),
    is_active = VALUES(is_active);

-- ============================================================================
-- NOTES
-- ============================================================================
-- 
-- Module Types Available:
-- - welcome: Welcome screen with branding
-- - game-card: Game introduction with rules and details
-- - leaderboard: Live score display
-- - timer: Countdown timer
-- - counter: Numeric counter
-- - rules: Display game rules
-- - text: Simple text display
-- - image: Image display
-- - video: Video player
--
-- Status Values:
-- - active: Currently displayed
-- - inactive: Available but not shown
-- - archived: Hidden from selection
--
-- To activate a module, update its is_active:
-- UPDATE modules SET is_active = 'active' WHERE id = X;
--
-- Only one module should be active at a time for the display
-- ============================================================================