-- Migration 002: app_media — admin-controlled hero banners & illustrations
SET NAMES utf8mb4;
USE `joseph`;

CREATE TABLE IF NOT EXISTS `app_media` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `slot` VARCHAR(60) NOT NULL,
  `title_ar` VARCHAR(200) NULL,
  `title_en` VARCHAR(200) NULL,
  `subtitle_ar` VARCHAR(300) NULL,
  `subtitle_en` VARCHAR(300) NULL,
  `image_url` VARCHAR(600) NOT NULL,
  `link_section` VARCHAR(50) NULL,
  `link_url` VARCHAR(600) NULL,
  `cta_label_ar` VARCHAR(80) NULL,
  `cta_label_en` VARCHAR(80) NULL,
  `order_index` SMALLINT NOT NULL DEFAULT 0,
  `is_active` BOOLEAN DEFAULT TRUE,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  INDEX `idx_app_media_slot` (`slot`, `is_active`, `order_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `app_media`
  (`slot`,`title_ar`,`title_en`,`subtitle_ar`,`subtitle_en`,`image_url`,`link_section`,`cta_label_ar`,`cta_label_en`,`order_index`)
VALUES
  ('home_hero','اكتشف دعوتك','Discover Your Calling','رحلة من العبد إلى الحاكم','From servant to ruler','https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1200&q=80','calling','ابدأ التقييم','Start Assessment',1),
  ('home_hero','ابنِ مشروعك','Build Your Project','حوّل دعوتك إلى عمل','Turn calling into venture','https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?w=1200&q=80','project','استكشف','Explore',2),
  ('home_hero','ملكوت في كل مكان','Kingdom Everywhere','اعمل لله في كل صناعة','Work for God in every industry','https://images.unsplash.com/photo-1507842217343-583bb7270b66?w=1200&q=80','kingdom','اعرف أكثر','Learn More',3),
  ('home_hero','تحديات يومية','Daily Challenges','نمو منضبط، خطوة بخطوة','Disciplined growth, step by step','https://images.unsplash.com/photo-1551434678-e076c223a692?w=1200&q=80','challenges','شارك الآن','Join Now',4),
  ('section_calling',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1499209974431-9dddcece7f88?w=1200&q=80',NULL,NULL,NULL,1),
  ('section_project',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1556761175-5973dc0f32e7?w=1200&q=80',NULL,NULL,NULL,1),
  ('section_kingdom',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?w=1200&q=80',NULL,NULL,NULL,1),
  ('section_mentor',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1521737604893-d14cc237f11d?w=1200&q=80',NULL,NULL,NULL,1),
  ('section_challenges',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1517438476312-10d79c077509?w=1200&q=80',NULL,NULL,NULL,1),
  ('section_word',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1504052434569-70ad5836ab65?w=1200&q=80',NULL,NULL,NULL,1),
  ('section_map',NULL,NULL,NULL,NULL,'https://images.unsplash.com/photo-1524661135-423995f22d0b?w=1200&q=80',NULL,NULL,NULL,1);
