// Gamification Types

export type AchievementType =
  | 'first_bet'
  | 'first_win'
  | 'win_streak_3'
  | 'win_streak_5'
  | 'win_streak_10'
  | 'whale_bet'
  | 'high_roller'
  | 'consistent'
  | 'underdog'
  | 'sharpshooter'
  | 'veteran'
  | 'legend'
  | 'profit_master'
  | 'comeback_king'
  | 'early_bird'
  | 'social_butterfly'
  | 'tier_up'
  | 'max_tier'

export type LootBoxRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary'

export type LootBoxRewardType =
  | 'bonus_cash'
  | 'xp_boost'
  | 'fee_reduction'
  | 'free_bet'
  | 'avatar_frame'
  | 'badge'
  | 'nothing'

export interface TierInfo {
  tier: number
  min_xp: number
  house_fee: number
  name: string
}

export interface UserStats {
  id: number
  user_id: number
  xp: number
  tier: number
  tier_name: string
  house_fee: number
  xp_to_next_tier: number
  tier_progress_percent: number
  total_wagered: number
  total_won: number
  total_lost: number
  net_profit: number
  biggest_win: number
  biggest_bet: number
  current_win_streak: number
  current_loss_streak: number
  best_win_streak: number
  worst_loss_streak: number
  bets_today: number
  bets_this_week: number
  bets_this_month: number
  consecutive_days_betting: number
  unique_opponents: number
}

export interface Achievement {
  id: number
  type: AchievementType
  name: string
  description: string
  icon: string
  xp_reward: number
  rarity: string
}

export interface UserAchievement {
  id: number
  achievement: Achievement
  earned_at: string
  notified: boolean
}

export interface LootBox {
  id: number
  rarity: LootBoxRarity
  source: string
  opened: boolean
  reward_type?: LootBoxRewardType
  reward_value?: string
  created_at: string
  opened_at?: string
}

export interface LootBoxOpenResult {
  reward_type: LootBoxRewardType
  reward_value: string
  message: string
}

export interface ActivityFeedItem {
  id: number
  user_id: number
  username: string
  activity_type: string
  message: string
  amount?: number
  created_at: string
}

export interface LeaderboardEntry {
  rank: number
  user_id: number
  username: string
  display_name?: string
  avatar_url?: string
  tier: number
  tier_name: string
  value: number
}

export interface WhaleBet {
  id: number
  username: string
  display_name?: string
  avatar_url?: string
  tier: number
  tier_name: string
  event_title: string
  amount: number
  side: string
  created_at: string
}

export interface RecentWin {
  id: number
  username: string
  display_name?: string
  avatar_url?: string
  event_title: string
  amount_won: number
  settled_at: string
}

export interface DailyReward {
  day_streak: number
  reward_type: string
  reward_value: string
  message: string
  next_reward_available: string
}
