// data.jsx — Mock data for TeamCaddy

const TEAM = {
  name: 'Riverside Strikers',
  age: 'U11 Boys',
  season: 'Spring 2026',
  record: { w: 5, l: 1, d: 2 },
  badge: '⚡', // placeholder
};

const COACH = { name: 'Coach Marco', role: 'Head Coach', initials: 'MR' };
const ADMIN_USER = { name: 'Marco Ruiz', role: 'Head Coach', initials: 'MR', kid: null };
const PARENT_USER = { name: 'Jess Patel', role: 'Parent of Arjun', initials: 'JP', kid: 'Arjun Patel' };

// Multi-player / multi-team account model
// An account has N players (kids). Each player plays on N teams.
const ACCOUNT = {
  name: 'Jess Patel',
  initials: 'JP',
  hue: 280,
  players: [
    {
      id: 'arjun',
      name: 'Arjun Patel',
      age: 11,
      initials: 'AP',
      hue: 12,
      teams: [
        { id: 'strikers',  name: 'Riverside Strikers', sport: 'Soccer',    level: 'U11 Boys',   accent: '#5856D6', emoji: '⚡', unread: 3 },
        { id: 'allstars',  name: 'Mission All-Stars',  sport: 'Futsal',    level: 'U11 Select', accent: '#FF9500', emoji: '✦',  unread: 0 },
      ],
    },
    {
      id: 'maya',
      name: 'Maya Patel',
      age: 9,
      initials: 'MP',
      hue: 330,
      teams: [
        { id: 'sharks',    name: 'Bay Sharks',         sport: 'Swim',      level: 'U10 Girls',  accent: '#0A84FF', emoji: '🌊', unread: 1 },
      ],
    },
  ],
};

// Cross-team upcoming — merged feed across all players
const CROSS_EVENTS = [
  { id:'x1', playerId:'arjun', playerName:'Arjun',  teamId:'strikers', teamName:'Riverside Strikers', teamAccent:'#5856D6', type:'game',     title:'vs. Oak Valley FC',  date:'Sat Apr 18', time:'10:30 AM', loc:'Riverside F3',    rsvp:'in',  dayKey:0 },
  { id:'x2', playerId:'maya',  playerName:'Maya',   teamId:'sharks',   teamName:'Bay Sharks',         teamAccent:'#0A84FF', type:'practice', title:'Swim Practice',       date:'Sat Apr 18', time:'2:00 PM',  loc:'Ortega Pool',     rsvp:'in',  dayKey:0, conflictWarn:false },
  { id:'x3', playerId:'arjun', playerName:'Arjun',  teamId:'allstars', teamName:'Mission All-Stars',  teamAccent:'#FF9500', type:'practice', title:'Futsal Practice',     date:'Sun Apr 19', time:'4:00 PM',  loc:'Mission Rec',     rsvp:'?',   dayKey:1 },
  { id:'x4', playerId:'arjun', playerName:'Arjun',  teamId:'strikers', teamName:'Riverside Strikers', teamAccent:'#5856D6', type:'practice', title:'Practice',            date:'Tue Apr 21', time:'5:30 PM',  loc:'Mission Park',    rsvp:'in',  dayKey:3 },
  { id:'x5', playerId:'maya',  playerName:'Maya',   teamId:'sharks',   teamName:'Bay Sharks',         teamAccent:'#0A84FF', type:'game',     title:'Bay League Meet',     date:'Wed Apr 22', time:'6:00 PM',  loc:'Aquatic Center',  rsvp:'?',   dayKey:4 },
  { id:'x6', playerId:'arjun', playerName:'Arjun',  teamId:'strikers', teamName:'Riverside Strikers', teamAccent:'#5856D6', type:'practice', title:'Practice',            date:'Thu Apr 23', time:'5:30 PM',  loc:'Mission Park',    rsvp:'?',   dayKey:5 },
  { id:'x7', playerId:'arjun', playerName:'Arjun',  teamId:'allstars', teamName:'Mission All-Stars',  teamAccent:'#FF9500', type:'game',     title:'vs. SoMa Futsal',     date:'Fri Apr 24', time:'7:00 PM',  loc:'Mission Rec',     rsvp:'in',  dayKey:6, conflictWarn:true },
  { id:'x8', playerId:'arjun', playerName:'Arjun',  teamId:'strikers', teamName:'Riverside Strikers', teamAccent:'#5856D6', type:'game',     title:'@ Bayside United',    date:'Sat Apr 25', time:'2:00 PM',  loc:'Bayside Complex', rsvp:'?',   dayKey:7 },
  { id:'x9', playerId:'maya',  playerName:'Maya',   teamId:'sharks',   teamName:'Bay Sharks',         teamAccent:'#0A84FF', type:'practice', title:'Swim Practice',       date:'Sat Apr 25', time:'9:00 AM',  loc:'Ortega Pool',     rsvp:'in',  dayKey:7 },
  { id:'xa', playerId:'arjun', playerName:'Arjun',  teamId:'strikers', teamName:'Riverside Strikers', teamAccent:'#5856D6', type:'social',   title:'Team Pizza Night',    date:'Sun Apr 26', time:'6:00 PM',  loc:'Tony\u2019s',           rsvp:'in',  dayKey:8 },
];

const ROSTER = [
  { id: 1,  name: 'Arjun Patel',     num: 7,  pos: 'FWD', initials: 'AP', parent: 'Jess Patel',     avail: 'in',  hue: 12 },
  { id: 2,  name: 'Leo Nakamura',    num: 10, pos: 'MID', initials: 'LN', parent: 'Aya Nakamura',   avail: 'in',  hue: 200 },
  { id: 3,  name: 'Diego Alvarez',   num: 9,  pos: 'FWD', initials: 'DA', parent: 'Marco Ruiz',     avail: 'in',  hue: 30 },
  { id: 4,  name: 'Finn O\u2019Brien',    num: 3,  pos: 'DEF', initials: 'FO', parent: 'Kate O\u2019Brien',   avail: 'out', hue: 340 },
  { id: 5,  name: 'Kai Okafor',      num: 4,  pos: 'DEF', initials: 'KO', parent: 'Ada Okafor',     avail: 'in',  hue: 260 },
  { id: 6,  name: 'Sam Reyes',       num: 8,  pos: 'MID', initials: 'SR', parent: 'Lia Reyes',      avail: '?',   hue: 100 },
  { id: 7,  name: 'Mateo Silva',     num: 11, pos: 'MID', initials: 'MS', parent: 'Joao Silva',     avail: 'in',  hue: 160 },
  { id: 8,  name: 'Jonah Weiss',     num: 5,  pos: 'DEF', initials: 'JW', parent: 'Dan Weiss',      avail: 'in',  hue: 50 },
  { id: 9,  name: 'Noah Kim',        num: 6,  pos: 'DEF', initials: 'NK', parent: 'Min Kim',        avail: '?',   hue: 220 },
  { id: 10, name: 'Ezra Ahmed',      num: 2,  pos: 'GK',  initials: 'EA', parent: 'Rami Ahmed',     avail: 'in',  hue: 290 },
  { id: 11, name: 'Theo Marquez',    num: 14, pos: 'FWD', initials: 'TM', parent: 'Sofia Marquez',  avail: 'in',  hue: 170 },
  { id: 12, name: 'Wes Lindqvist',   num: 12, pos: 'MID', initials: 'WL', parent: 'Erik Lindqvist', avail: 'out', hue: 80 },
  { id: 13, name: 'Omar Haddad',     num: 13, pos: 'DEF', initials: 'OH', parent: 'Nadia Haddad',   avail: 'in',  hue: 0 },
  { id: 14, name: 'Cruz Rivera',     num: 15, pos: 'FWD', initials: 'CR', parent: 'Ana Rivera',     avail: 'in',  hue: 320 },
];

// Next game — referenced as "today" for the mock
const NEXT_GAME = {
  id: 'evt-1',
  type: 'game',
  title: 'vs. Oak Valley FC',
  date: 'Saturday, Apr 18',
  time: '10:30 AM',
  arrive: '10:00 AM',
  duration: '90 min',
  location: 'Riverside Field 3',
  address: '2400 Mission Bay Blvd, San Francisco',
  weather: { temp: 62, cond: 'Partly Cloudy', icon: 'cloud-sun' },
  kit: 'Home kit (red)',
  rsvpIn: 11, rsvpOut: 2, rsvpMaybe: 1,
};

const UPCOMING = [
  { id:'evt-1', type:'game',     title:'vs. Oak Valley FC',      date:'Sat Apr 18', time:'10:30 AM', loc:'Riverside F3',  rsvp:'in' },
  { id:'evt-2', type:'practice', title:'Practice',                date:'Tue Apr 21', time:'5:30 PM',  loc:'Mission Park',   rsvp:'in' },
  { id:'evt-3', type:'practice', title:'Practice',                date:'Thu Apr 23', time:'5:30 PM',  loc:'Mission Park',   rsvp:'?' },
  { id:'evt-4', type:'game',     title:'@ Bayside United',        date:'Sat Apr 25', time:'2:00 PM',  loc:'Bayside Complex', rsvp:'?' },
  { id:'evt-5', type:'social',   title:'Team Pizza Night',        date:'Sun Apr 26', time:'6:00 PM',  loc:'Tony\u2019s Coal Fired', rsvp:'in' },
  { id:'evt-6', type:'game',     title:'vs. Coastal Galaxy',      date:'Sat May 2',  time:'10:30 AM', loc:'Riverside F1',  rsvp:null },
];

const MESSAGES = [
  { id:'m1', who:'Coach Marco', initials:'MR', hue:12,  time:'9:41 AM', text:'Reminder: wear home kit Saturday. Cleats + shin guards. Be there 30 min early for warm up.', me:false, reactions:[{e:'👍', n:8},{e:'⚽', n:3}] },
  { id:'m2', who:'Aya Nakamura', initials:'AN', hue:200, time:'9:44 AM', text:'Can anyone carpool from the Sunset? Leo can take 2 extra.', me:false },
  { id:'m3', who:'me', initials:'JP', hue:280, time:'9:52 AM', text:'We can hop in! Will swing by at 9:30.', me:true },
  { id:'m4', who:'Ada Okafor', initials:'AO', hue:260, time:'10:03 AM', text:'Kai has the snack slot — bringing oranges + goldfish 🍊', me:false, reactions:[{e:'🙏', n:5}] },
  { id:'m5', who:'Coach Marco', initials:'MR', hue:12,  time:'10:20 AM', text:'Lineup sheet posted in the event — take a look and let me know if anything\u2019s off.', me:false },
];

const ANNOUNCEMENTS = [
  { id:'a1', title:'Saturday Game — Kit Reminder', body:'Home kit (red). Arrive 10:00 AM sharp.', time:'2h ago', pin:true, read:22, total:24 },
  { id:'a2', title:'Snack Rotation — May', body:'Sign-up sheet is live. Please claim your week by Friday.', time:'yesterday', read:20, total:24 },
];

const PHOTOS = Array.from({ length: 18 }, (_, i) => ({
  id: 'p' + i,
  hue: (i * 37) % 360,
  tilt: ((i * 13) % 7) - 3,
  w: i % 5 === 0 ? 2 : 1,
  h: i % 7 === 0 ? 2 : 1,
  caption: ['Goal!','Halftime','Team huddle','Warm up','Post-game','Bench','Saves'][i % 7],
}));

// 30-day calendar — April 2026 layout: Apr 1 is Wed
const CAL_EVENTS = {
  2:  [{ t:'practice', label:'Practice' }],
  4:  [{ t:'game', label:'vs. Bayside' }],
  7:  [{ t:'practice', label:'Practice' }],
  9:  [{ t:'practice', label:'Practice' }],
  11: [{ t:'game', label:'@ Coastal' }],
  14: [{ t:'practice', label:'Practice' }],
  16: [{ t:'practice', label:'Practice' }],
  18: [{ t:'game', label:'vs. Oak Valley' }],
  21: [{ t:'practice', label:'Practice' }],
  23: [{ t:'practice', label:'Practice' }],
  25: [{ t:'game', label:'@ Bayside Utd' }],
  26: [{ t:'social', label:'Pizza Night' }],
  28: [{ t:'practice', label:'Practice' }],
  30: [{ t:'practice', label:'Practice' }],
};

Object.assign(window, {
  TEAM, COACH, ADMIN_USER, PARENT_USER, ACCOUNT, CROSS_EVENTS,
  ROSTER, NEXT_GAME, UPCOMING, MESSAGES, ANNOUNCEMENTS, PHOTOS, CAL_EVENTS,
});
