-- WebMap Website Seeds
-- Seeds for domain routing configuration
-- Run after migrations

-- ============================================================================
-- Clear existing data (development only)
-- ============================================================================
TRUNCATE website_apps CASCADE;
TRUNCATE websites CASCADE;

-- ============================================================================
-- Website: atlilith.com (Landing + SEO)
-- ============================================================================
INSERT INTO websites (id, slug, domains, branding, theme, is_active)
VALUES (
  '550e8400-e29b-41d4-a716-446655440001',
  'atlilith',
  ARRAY[
    'atlilith.com',
    'www.atlilith.com',
    'next.atlilith.com',
    'next.www.atlilith.com',
    'atlilith.localhost',
    'www.atlilith.local',
    'atlilith.local'
  ],
  '{
    "displayName": "Lilith",
    "tagline": "The better platform",
    "description": "Creator-first platform with 100% earnings, DMCA protection, and transparent ranking."
  }'::jsonb,
  '{
    "primary": "#d946ef",
    "secondary": "#a855f7",
    "accent": "#ec4899",
    "background": "#ffffff",
    "text": "#1a202c",
    "themeMode": "light"
  }'::jsonb,
  true
);

-- atlilith.com apps: landing at /, seo at /_/
INSERT INTO website_apps (id, website_id, app, base_path, features, sort_order)
VALUES
  (
    '550e8400-e29b-41d4-a716-446655440011',
    '550e8400-e29b-41d4-a716-446655440001',
    'landing',
    '/',
    '{
      "ageGate": true,
      "newsletter": true,
      "contactForm": true,
      "socialLinks": true,
      "creatorSignup": true,
      "clientSubscription": true
    }'::jsonb,
    0
  ),
  (
    '550e8400-e29b-41d4-a716-446655440012',
    '550e8400-e29b-41d4-a716-446655440001',
    'seo',
    '/_/',
    '{
      "locationPages": true,
      "servicePages": true,
      "dynamicContent": true
    }'::jsonb,
    1
  );

-- ============================================================================
-- Website: trustedmeet.com (Marketplace + SEO)
-- ============================================================================
INSERT INTO websites (id, slug, domains, branding, theme, is_active)
VALUES (
  '550e8400-e29b-41d4-a716-446655440002',
  'trustedmeet',
  ARRAY[
    'trustedmeet.com',
    'www.trustedmeet.com',
    'next.www.trustedmeet.com',
    'trustedmeet.localhost',
    'www.trustedmeet.local',
    'trustedmeet.local'
  ],
  '{
    "displayName": "TrustedMeet",
    "tagline": "Verified. Safe. Confidential.",
    "description": "Connect with verified, background-checked companions. Safe bookings with escrow protection."
  }'::jsonb,
  '{
    "primary": "#2d3748",
    "secondary": "#4a5568",
    "accent": "#48bb78",
    "background": "#ffffff",
    "text": "#1a202c",
    "themeMode": "light"
  }'::jsonb,
  true
);

-- trustedmeet.com apps: marketplace at /, seo at /_/
INSERT INTO website_apps (id, website_id, app, base_path, features, sort_order)
VALUES
  (
    '550e8400-e29b-41d4-a716-446655440021',
    '550e8400-e29b-41d4-a716-446655440002',
    'marketplace',
    '/',
    '{
      "ageGate": true,
      "discovery": true,
      "booking": true,
      "inbox": true,
      "locationPages": true,
      "verification": true
    }'::jsonb,
    0
  ),
  (
    '550e8400-e29b-41d4-a716-446655440022',
    '550e8400-e29b-41d4-a716-446655440002',
    'seo',
    '/_/',
    '{
      "locationPages": true,
      "servicePages": true,
      "dynamicContent": true
    }'::jsonb,
    1
  );

-- ============================================================================
-- Website: admin.atlilith.com (Platform Admin)
-- ============================================================================
INSERT INTO websites (id, slug, domains, branding, theme, is_active)
VALUES (
  '550e8400-e29b-41d4-a716-446655440003',
  'admin',
  ARRAY[
    'admin.atlilith.com',
    'next.admin.atlilith.com',
    'admin.localhost',
    'admin.atlilith.local'
  ],
  '{
    "displayName": "Lilith Admin",
    "tagline": "Platform Administration",
    "description": "Administrative interface for the Lilith Platform."
  }'::jsonb,
  '{
    "primary": "#4f46e5",
    "secondary": "#6366f1",
    "accent": "#8b5cf6",
    "background": "#f8fafc",
    "text": "#1e293b",
    "themeMode": "light"
  }'::jsonb,
  true
);

-- admin.atlilith.com apps: platform-admin at /
INSERT INTO website_apps (id, website_id, app, base_path, features, sort_order)
VALUES
  (
    '550e8400-e29b-41d4-a716-446655440031',
    '550e8400-e29b-41d4-a716-446655440003',
    'platform-admin',
    '/',
    '{
      "userManagement": true,
      "contentModeration": true,
      "analytics": true,
      "settings": true
    }'::jsonb,
    0
  );

-- ============================================================================
-- Website: status.atlilith.com (Status Dashboard)
-- ============================================================================
INSERT INTO websites (id, slug, domains, branding, theme, is_active)
VALUES (
  '550e8400-e29b-41d4-a716-446655440004',
  'status',
  ARRAY[
    'status.atlilith.com',
    'next.status.atlilith.com',
    'status.localhost',
    'status.atlilith.local'
  ],
  '{
    "displayName": "Lilith Status",
    "tagline": "System Status",
    "description": "Real-time status and health monitoring for Lilith Platform services."
  }'::jsonb,
  '{
    "primary": "#059669",
    "secondary": "#10b981",
    "accent": "#34d399",
    "background": "#f0fdf4",
    "text": "#064e3b",
    "themeMode": "light"
  }'::jsonb,
  true
);

-- status.atlilith.com apps: status-dashboard at /
INSERT INTO website_apps (id, website_id, app, base_path, features, sort_order)
VALUES
  (
    '550e8400-e29b-41d4-a716-446655440041',
    '550e8400-e29b-41d4-a716-446655440004',
    'status-dashboard',
    '/',
    '{
      "serviceStatus": true,
      "incidentHistory": true,
      "uptimeMetrics": true,
      "subscriptions": true
    }'::jsonb,
    0
  );
