// Dashboard data — searches (unified), scan types, top-up packs, privacy tiers.

// Unified searches list. First entry is the foundational purchase ("Original Report"),
// the rest are additional scans run from the dashboard.
const SEARCHES = [
  {
    id: "s0",
    pinned: true,
    name: "Daniel Reyes",
    handle: "@dreyes",
    initials: "DR",
    color: "#2563EB",
    scans: ["Original Report"],
    date: "May 14, 2026",
    status: "Completed",
    isOriginal: true
  },
  {
    id: "s1",
    name: "Olivia Hartwell",
    handle: "@oliviah",
    initials: "OH",
    color: "#7C3AED",
    scans: ["Relationship Status"],
    date: "May 9, 2026",
    status: "Completed"
  },
  {
    id: "s2",
    name: "Marcus Lin",
    handle: "marcus.lin@—",
    initials: "ML",
    color: "#0EA5E9",
    scans: ["Person Check"],
    date: "May 3, 2026",
    status: "Completed"
  },
  {
    id: "s3",
    name: "Priya Anand",
    handle: "(415) 555-•••8",
    initials: "PA",
    color: "#F59E0B",
    scans: ["Person Check"],
    date: "Apr 28, 2026",
    status: "Completed"
  },
  {
    id: "s4",
    name: "Sienna Brooks",
    handle: "sienna.b@—",
    initials: "SB",
    color: "#EC4899",
    scans: ["Face Scan"],
    date: "Apr 21, 2026",
    status: "Completed"
  }
];

const SCAN_TYPES = [
  {
    id: "new-person",
    name: "Person Check",
    desc: "Find anyone — identity, location, employer, social profiles, dating activity and more.",
    icon: "IconUser",
    cost: 5000,
    usedThisWeek: 6917,
    color: "#3B5BF5",
    tag: "Most popular",
    tagTone: "popular"
  },
  {
    id: "face",
    name: "Face Scan",
    desc: "Match a photo across social and image-indexed platforms.",
    icon: "IconImage",
    cost: 7500,
    usedThisWeek: 3204,
    color: "#7C3AED",
    tag: "New",
    tagTone: "new"
  },
  {
    id: "dating-app",
    name: "Dating App Scan",
    desc: "Full sweep across dating apps, hidden profiles, and recent activity.",
    icon: "IconHeart",
    cost: 5000,
    usedThisWeek: 4821,
    color: "#EC4899",
    tag: "Hot",
    tagTone: "hot"
  },
  {
    id: "tinder-sonar",
    name: "Tinder Sonar",
    desc: "Find out if your ex already saw your profile — and what they did next.",
    icon: "IconRadar",
    cost: 6000,
    usedThisWeek: 1842,
    color: "#FF4458",
    tag: "Trending",
    tagTone: "trending"
  }
];

const TOPUP_PACKS = [
  {
    id: "starter", name: "Starter", price: "$4.99", chips: 5000,
    cashback: 10, bonus: 500, total: 5500, tag: null, save: null
  },
  {
    id: "popular", name: "Popular", price: "$9.99", chips: 12000,
    cashback: 12, bonus: 1440, total: 13440, tag: "Most Popular", save: "Save 20%",
    featured: true
  },
  {
    id: "best", name: "Best Value", price: "$19.99", chips: 27500,
    cashback: 15, bonus: 4125, total: 31625, tag: null, save: "Save 38%"
  },
  {
    id: "highroller", name: "High Roller", price: "$49.99", chips: 75000,
    cashback: 20, bonus: 15000, total: 90000, tag: null, save: "Save 50%"
  }
];

// For the value-meter — relative fill (0-1) by pack
const PACK_METER = { starter: 0.25, popular: 0.5, best: 0.78, highroller: 1.0 };

const PRIVACY_TIERS = [
  {
    id: "trial", name: "Shield 30",
    desc: "Try Privacy Shield with a low-commitment month.",
    chips: 25000, duration: "30 days", cta: "Get Shield 30",
    featured: false
  },
  {
    id: "year", name: "Shield+",
    desc: "Full-year suppression across 100+ people-search sites.",
    chips: 100000, duration: "1 year", cta: "Get Shield+",
    featured: false, popular: true
  },
  {
    id: "lifetime", name: "Lifetime Shield",
    desc: "Permanent removal. Pay once, stay invisible forever.",
    chips: 250000, duration: "Forever", cta: "Get Lifetime",
    featured: true
  }
];

const ACTIVITY_LINES = [
  "2,847 scans completed today",
  "143 people protected by Privacy Shield",
  "1,219 new identity reports compiled this week",
  "Average scan finishes in 1m 42s",
  "12 new platforms added to the index this week"
];

const formatTokens = (n) => n.toLocaleString("en-US");

// Brand social logos (used in the Person Check example report + social-account fields)
const SOCIAL_LOGOS = {
  x:         "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/X_logo.jpg/960px-X_logo.jpg",
  linkedin:  "https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/LinkedIn_icon.svg/1280px-LinkedIn_icon.svg.png",
  facebook:  "https://upload.wikimedia.org/wikipedia/commons/e/ee/Logo_de_Facebook.png",
  instagram: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/1280px-Instagram_logo_2016.svg.png"
};

// Accent color per scan/report name — drives the colored tags in My Searches
// and any per-product theming keyed off a display name.
const SCAN_NAME_ACCENT = {
  "Original Report":     "#0D1B2A",
  "Person Check":        "#3B5BF5",
  "Face Scan":           "#7C3AED",
  "Dating App Scan":     "#EC4899",
  "Tinder Sonar":        "#FF4458",
  "Relationship Status": "#F43F5E"
};

// External image refs (CDN-hosted, used by example previews/modals)
const PROFILE_IMAGES = [
  "https://d1muf25xaso8hp.cloudfront.net/https%3A%2F%2F00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io%2Ff1767601730573x369022721890427840%2Fphoto-1524504388940-b1c1722653e1.avif?w=512&h=512&auto=compress&dpr=2&fit=max",
  "https://d1muf25xaso8hp.cloudfront.net/https%3A%2F%2F00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io%2Ff1767601820747x460458574683233400%2Freplicate-prediction-19mwyhqp31rmt0cvhn1vp1brbw.avif?w=512&h=512&auto=compress&dpr=2&fit=max",
  "https://d1muf25xaso8hp.cloudfront.net/https%3A%2F%2F00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io%2Ff1767601811213x539045398580144640%2Freplicate-prediction-nt2tenwct5rmt0cvhn2tdqck60.avif?w=512&h=512&auto=compress&dpr=2&fit=max",
  "https://d1muf25xaso8hp.cloudfront.net/https%3A%2F%2F00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io%2Ff1767601757558x560448260780641150%2Freplicate-prediction-gae3a4h1b9rmy0cvhn18hdbjd0.avif?w=512&h=512&auto=compress&dpr=2&fit=max",
  "https://d1muf25xaso8hp.cloudfront.net/https%3A%2F%2F00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io%2Ff1767601771688x761829863752602900%2Freplicate-prediction-atj3xzpqrhrmt0cvhmzbd09s68.avif?w=512&h=384&auto=compress&dpr=2&fit=max",
  "https://d1muf25xaso8hp.cloudfront.net/https%3A%2F%2F00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io%2Ff1767601743254x247591516819462000%2Freplicate-prediction-x2q70prxpdrmr0cvhn0t1g3xq4.avif?w=512&h=384&auto=compress&dpr=2&fit=max"
];

const PLATFORM_LOGOS = {
  tinder:   "https://00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io/cdn-cgi/image/w=96,h=96,f=auto,dpr=2,fit=contain/f1765607888008x514218633405409100/28.png",
  bumble:   "https://00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io/cdn-cgi/image/w=96,h=96,f=auto,dpr=2,fit=contain/f1765607892767x700008193022784400/30.png",
  hinge:    "https://00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io/cdn-cgi/image/w=96,h=96,f=auto,dpr=2,fit=contain/f1765607897179x132038548497801280/29.png",
  onlyfans: "https://00fe066d8af9f481aa3eb85a8448a9ba.cdn.bubble.io/cdn-cgi/image/w=96,h=96,f=auto,dpr=2,fit=contain/f1767606377947x846726855437925500/off.png"
};

// ============================================================
// Notifications — past events tied to this account
// ============================================================
const NOTIFICATIONS = [
  {
    id: "n1",
    type: "report",
    title: "Your report is ready",
    body: "Relationship Status scan for Olivia Hartwell — 12 results found.",
    time: "2 hours ago",
    unread: true,
    cta: "View report"
  },
  {
    id: "n2",
    type: "shield",
    title: "Shield+ activated",
    body: "Your profile is now suppressed from all Sweepify searches. Expires Mar 14, 2026.",
    time: "Yesterday",
    unread: true
  },
  {
    id: "n3",
    type: "tokens",
    title: "Tokens credited",
    body: "Popular pack — 13,440 tokens added to your balance (+12% cashback).",
    time: "Yesterday",
    unread: false
  },
  {
    id: "n4",
    type: "report",
    title: "Your report is ready",
    body: "Life Update scan for Marcus Lin — last seen in Austin, TX.",
    time: "May 3, 2026",
    unread: false,
    cta: "View report"
  },
  {
    id: "n5",
    type: "alert",
    title: "Low token balance",
    body: "You're below 5,000 tokens. Top up to keep running scans without interruption.",
    time: "Apr 29, 2026",
    unread: false
  },
  {
    id: "n6",
    type: "report",
    title: "Your report is ready",
    body: "Person Check for (415) 555-•••8 — 4 platforms matched.",
    time: "Apr 28, 2026",
    unread: false,
    cta: "View report"
  },
  {
    id: "n7",
    type: "shield",
    title: "Identity verification complete",
    body: "We've verified your identity. Shield will activate the moment you purchase a plan.",
    time: "Apr 21, 2026",
    unread: false
  }
];

// ============================================================
// Support FAQ + contact options
// ============================================================
const SUPPORT_FAQ = [
  {
    q: "How long does a scan take?",
    a: "Most scans complete in under 2 minutes. Face Scan can take up to 5 minutes when matching across image-indexed platforms. You'll get a notification when your report is ready."
  },
  {
    q: "What if my scan returns no results?",
    a: "If a scan returns zero matches across all platforms, we'll automatically credit the tokens back to your account within 24 hours. You'll see a notification when the refund is processed."
  },
  {
    q: "Are my searches anonymous?",
    a: "Yes. The people you search for never see your name, email, or any indication that they were searched. We only query publicly available sources."
  },
  {
    q: "Can I delete a report after I've run it?",
    a: "Yes. Open the report from My Searches, click the menu, and choose 'Delete'. The report is purged from our servers within 24 hours and cannot be recovered."
  },
  {
    q: "Why was my payment declined?",
    a: "The most common reasons are an expired card, an incorrect billing zip, or a bank-side fraud check. Stripe will email you the exact reason — try again with a different card if the issue persists."
  },
  {
    q: "How do I get a refund on tokens?",
    a: "Tokens are non-refundable once they've been spent on a scan. Unused token balances purchased within the last 14 days can be refunded — reach out to support with your order number."
  }
];

// ============================================================
// Face Scan match data — for results page
// ============================================================
const FACE_MATCH_CATEGORIES = [
  { id: "social",     label: "Social Media",   Icon: "IconUsers"     },
  { id: "professional", label: "Professional", Icon: "IconLink"      },
  { id: "video",      label: "Videos",         Icon: "IconImage"     },
  { id: "news",       label: "News & Blogs",   Icon: "IconFile"      },
  { id: "marketplace",label: "Marketplaces",   Icon: "IconChip"      },
  { id: "mugshots",   label: "Mugshots",       Icon: "IconShield"    }
];

const FACE_MATCHES = [
  { id: "m1",  site: "instagram.com",    category: "social",       score: 94, image: 0 },
  { id: "m2",  site: "linkedin.com",     category: "professional", score: 91, image: 1 },
  { id: "m3",  site: "vimeo.com",        category: "video",        score: 88, image: 2 },
  { id: "m4",  site: "facebook.com",     category: "social",       score: 86, image: 3 },
  { id: "m5",  site: "medium.com",       category: "news",         score: 84, image: 4 },
  { id: "m6",  site: "poshmark.com",     category: "marketplace",  score: 81, image: 5 },
  { id: "m7",  site: "youtube.com",      category: "video",        score: 79, image: 0, multi: 2 },
  { id: "m8",  site: "twitter.com",      category: "social",       score: 77, image: 1 },
  { id: "m9",  site: "linkedin.com",     category: "professional", score: 76, image: 2 },
  { id: "m10", site: "stockcake.com",    category: "marketplace",  score: 73, image: 3 },
  { id: "m11", site: "tiktok.com",       category: "social",       score: 71, image: 4 },
  { id: "m12", site: "reddit.com",       category: "social",       score: 68, image: 5 },
  { id: "m13", site: "patreon.com",      category: "marketplace",  score: 64, image: 0 },
  { id: "m14", site: "behance.net",      category: "professional", score: 58, image: 1 },
  { id: "m15", site: "tumblr.com",       category: "social",       score: 54, image: 2 },
  { id: "m16", site: "pinterest.com",    category: "social",       score: 52, image: 3 }
];

const FACE_TIERS = [
  { id: "certain",   label: "Certain Match",   min: 90, max: 100, color: "#EF4444" },
  { id: "confident", label: "Confident Match", min: 83, max: 89,  color: "#F59E0B" },
  { id: "uncertain", label: "Uncertain Match", min: 70, max: 82,  color: "#A16207" },
  { id: "weak",      label: "Weak Match",      min: 50, max: 69,  color: "#94A3B8" }
];

const FACE_WAIVER_TERMS = [
  "I will not confront or threaten anyone identified through this scan",
  "I will not harass, stalk, or intimidate any person",
  "I will not upload photos of anyone under the age of 18",
  "I will not blackmail, extort, or coerce anyone using this information",
  "I will not use any information to make employment, housing, credit, or insurance decisions",
  "I will treat all results as informational only and cross-reference before drawing conclusions",
  "I understand many unrelated people look alike and that match scores are statistical, not definitive"
];

Object.assign(window, {
  SEARCHES, SCAN_TYPES, TOPUP_PACKS, PACK_METER, PRIVACY_TIERS, ACTIVITY_LINES,
  PROFILE_IMAGES, PLATFORM_LOGOS, NOTIFICATIONS, SUPPORT_FAQ,
  FACE_MATCHES, FACE_TIERS, FACE_MATCH_CATEGORIES, FACE_WAIVER_TERMS,
  formatTokens, SCAN_NAME_ACCENT, SOCIAL_LOGOS
});
