// data.jsx — mock data + shared helpers for IMS redesign
const AV = { mohamed: 'images/img1.jpg', sonia: 'images/img2.jpg', felipe: 'images/img3.jpg', george: 'images/img4.jpg', heba: 'images/img5.jpg' };
const HERO = 'images/img6.jpg';

const CATEGORIES = [
  { name: 'Technology', color: '#0a66ff' },
  { name: 'Business',   color: '#15a564' },
  { name: 'Marketing',  color: '#f4623a' },
  { name: 'Design',     color: '#6d5cf0' },
  { name: 'Operations', color: '#e8930c' },
];
const catColor = (n) => (CATEGORIES.find(c => c.name === n) || CATEGORIES[0]).color;

const IDEA_TITLES = [
  'Annual investment portal', 'AI triage for support tickets', 'Carbon-neutral delivery',
  'Gamified onboarding flow', 'Internal knowledge wiki', 'Predictive stock reordering',
  'Customer health dashboard', 'Voice-first expense entry', 'Zero-waste packaging',
  'Cross-team idea jams', 'Smart meeting summaries', 'Referral rewards revamp',
];
const NAMES = [
  { name: 'Mohamed Ali', role: 'UX / UI Designer', av: AV.mohamed },
  { name: 'Sonia C. Connor', role: 'Product Manager', av: AV.sonia },
  { name: 'Margie C. Martin', role: 'Data Analyst', av: AV.heba },
  { name: 'George L. Farr', role: 'Frontend Dev', av: AV.george },
  { name: 'Scott C. Bilbo', role: 'Backend Dev', av: AV.felipe },
  { name: 'Felipe S. Lee', role: 'Marketing Lead', av: AV.felipe },
  { name: 'Robert B. Darwin', role: 'Researcher', av: AV.george },
  { name: 'Heba Ali', role: 'UX / UI Designer', av: AV.heba },
];
const DESC = 'A streamlined approach that reduces friction across the workflow while improving clarity and measurable outcomes for every team involved.';

const IDEAS = Array.from({ length: 12 }).map((_, i) => {
  const p = NAMES[i % NAMES.length];
  const statuses = ['published', 'pending', 'published', 'review', 'published', 'rejected'];
  return {
    id: i + 1,
    rank: i + 1,
    author: p.name, role: p.role, avatar: p.av,
    title: IDEA_TITLES[i % IDEA_TITLES.length],
    category: CATEGORIES[i % CATEGORIES.length].name,
    desc: DESC,
    status: statuses[i % statuses.length],
    date: `${10 + (i % 18)}.05.2025`,
    up: 100 + i * 13, down: 20 + (i % 5) * 4, comments: 24 - (i % 6), views: 240 + i * 31,
  };
});

const STATS_HOME = [
  { key: 'total', icon: 'bulb', label: 'Total ideas', value: '1,000', trend: -27, tint: '#0a66ff' },
  { key: 'yours', icon: 'paper', label: 'Your ideas', value: '350', trend: 12, tint: '#f4623a' },
  { key: 'interact', icon: 'hand', label: 'Interactions on your ideas', value: '700', trend: 8, tint: '#6d5cf0' },
  { key: 'users', icon: 'users', label: 'Interacting users', value: '500', trend: -4, tint: '#15a564' },
];

const COMMENTS = [
  { id: 1, name: 'Jenny Wilson', av: AV.sonia, ago: '3 days ago', up: 100, down: 20, replies: 15,
    text: 'This is exactly the kind of cross-functional thinking we need. The framing around measurable outcomes makes it easy to pitch upward — strong concept overall.' },
  { id: 2, name: 'Robert B. Darwin', av: AV.george, ago: '3 days ago', up: 42, down: 4, replies: 3,
    text: 'Love the direction. One question: how do you see this scaling once more teams adopt it in parallel?' },
  { id: 3, name: 'Margie C. Martin', av: AV.heba, ago: '5 days ago', up: 88, down: 7, replies: 0,
    text: 'Could pair nicely with the predictive reordering idea from last quarter. Worth connecting the two threads.' },
];

const SIMILAR = [
  { name: 'Heba Ali', av: AV.heba, ago: '3 hr', tags: ['Technology', 'Idea'], text: 'A lightweight intake form that routes ideas to the right reviewer automatically.' },
  { name: 'Scott C. Bilbo', av: AV.felipe, ago: '5 hr', tags: ['Technology'], text: 'Connecting the rewards ledger to published ideas so contributors see impact.' },
  { name: 'George L. Farr', av: AV.george, ago: '8 hr', tags: ['Idea'], text: 'Surface similar ideas at submission time to reduce duplicate proposals.' },
];

const AWARDS = [
  { id: 1, title: 'A full day off from work', cost: 50, emoji: '🌴' },
  { id: 2, title: 'Free flight ticket to Istanbul', cost: 300, emoji: '✈️' },
  { id: 3, title: 'iPhone 15 Pro Max', cost: 1050, emoji: '📱' },
  { id: 4, title: 'Free flight ticket to Cairo', cost: 250, emoji: '🛫' },
  { id: 5, title: 'Samsung smart refrigerator', cost: 2000, emoji: '🧊' },
  { id: 6, title: 'Premium standing desk', cost: 600, emoji: '🪑' },
];

const TRANSACTIONS = [
  { id: 1, label: 'Idea published — "Carbon-neutral delivery"', date: 'May 14, 2025', amount: +150, kind: 'earn' },
  { id: 2, label: 'Redeemed — Free flight ticket to Cairo', date: 'May 10, 2025', amount: -250, kind: 'spend' },
  { id: 3, label: 'Upvotes milestone bonus', date: 'May 7, 2025', amount: +80, kind: 'earn' },
  { id: 4, label: 'Idea published — "Smart meeting summaries"', date: 'May 2, 2025', amount: +150, kind: 'earn' },
  { id: 5, label: 'Redeemed — A full day off from work', date: 'Apr 28, 2025', amount: -50, kind: 'spend' },
];

const DEVICES = [
  { name: 'Mac', pct: 50, color: '#0a66ff' },
  { name: 'Android', pct: 20, color: '#e8930c' },
  { name: 'iOS', pct: 15, color: '#15a564' },
  { name: 'Windows', pct: 10, color: '#e23b56' },
  { name: 'Others', pct: 5, color: '#313b4d' },
];

const TOP_USERS = [
  { name: 'Mohamed Ali', role: 'UX / UI Designer', av: AV.mohamed, ideas: 48 },
  { name: 'Sonia C. Connor', role: 'Product Manager', av: AV.sonia, ideas: 41 },
  { name: 'Scott C. Bilbo', role: 'Backend Developer', av: AV.felipe, ideas: 37 },
  { name: 'Heba Ali', role: 'Graphic Designer', av: AV.heba, ideas: 33 },
];

const PROFILE_STATS = [
  { label: 'All ideas', value: 50 },
  { label: 'Ideas under review', value: 10 },
  { label: 'Published ideas', value: 30 },
  { label: 'Rejected ideas', value: 10 },
  { label: 'Ideas views', value: 1081 },
];

const fmt = (n) => n.toLocaleString('en-US');

const NOTIFS = [
  { id: 1, type: 'vote', who: 'Sonia C. Connor', av: AV.sonia, text: 'upvoted your idea "Smart meeting summaries"', ago: '12m', unread: true },
  { id: 2, type: 'comment', who: 'George L. Farr', av: AV.george, text: 'commented on "Carbon-neutral delivery"', ago: '1h', unread: true },
  { id: 3, type: 'status', who: 'Admin', av: AV.heba, text: 'approved your idea "Mentorship matching"', ago: '3h', unread: true },
  { id: 4, type: 'reward', who: 'IdeaMint', av: AV.felipe, text: 'awarded you +150 USD for a published idea', ago: '1d', unread: false },
  { id: 5, type: 'follow', who: 'Scott C. Bilbo', av: AV.felipe, text: 'started following you', ago: '2d', unread: false },
];
const NOTIF_ICON = { vote: 'thumbUp', comment: 'comment', status: 'checkCircle', reward: 'coins', follow: 'users' };
const NOTIF_TINT = { vote: '#0a66ff', comment: '#6d5cf0', status: '#15a564', reward: '#e8930c', follow: '#f4623a' };

Object.assign(window, {
  AV, HERO, CATEGORIES, catColor, IDEAS, STATS_HOME, COMMENTS, SIMILAR,
  AWARDS, TRANSACTIONS, DEVICES, TOP_USERS, PROFILE_STATS, NAMES, DESC, fmt,
  NOTIFS, NOTIF_ICON, NOTIF_TINT,
});
