export interface ProfileOverviewDriverSummaryViewModel {
  id: string;
  name: string;
  country: string;
  avatarUrl: string;
  iracingId: string | null;
  joinedAt: string;
  rating: number | null;
  globalRank: number | null;
  consistency: number | null;
  bio: string | null;
  totalDrivers: number | null;
}

export interface ProfileOverviewStatsViewModel {
  totalRaces: number;
  wins: number;
  podiums: number;
  dnfs: number;
  avgFinish: number | null;
  bestFinish: number | null;
  worstFinish: number | null;
  finishRate: number | null;
  winRate: number | null;
  podiumRate: number | null;
  percentile: number | null;
  rating: number | null;
  consistency: number | null;
  overallRank: number | null;
}

export interface ProfileOverviewFinishDistributionViewModel {
  totalRaces: number;
  wins: number;
  podiums: number;
  topTen: number;
  dnfs: number;
  other: number;
}

export interface ProfileOverviewTeamMembershipViewModel {
  teamId: string;
  teamName: string;
  teamTag: string | null;
  role: string;
  joinedAt: string;
  isCurrent: boolean;
}

export interface ProfileOverviewSocialFriendSummaryViewModel {
  id: string;
  name: string;
  country: string;
  avatarUrl: string;
}

export interface ProfileOverviewSocialSummaryViewModel {
  friendsCount: number;
  friends: ProfileOverviewSocialFriendSummaryViewModel[];
}

export type ProfileOverviewSocialPlatform = 'twitter' | 'youtube' | 'twitch' | 'discord';

export type ProfileOverviewAchievementRarity = 'common' | 'rare' | 'epic' | 'legendary';

export interface ProfileOverviewAchievementViewModel {
  id: string;
  title: string;
  description: string;
  icon: 'trophy' | 'medal' | 'star' | 'crown' | 'target' | 'zap';
  rarity: ProfileOverviewAchievementRarity;
  earnedAt: string;
}

export interface ProfileOverviewSocialHandleViewModel {
  platform: ProfileOverviewSocialPlatform;
  handle: string;
  url: string;
}

export interface ProfileOverviewExtendedProfileViewModel {
  socialHandles: ProfileOverviewSocialHandleViewModel[];
  achievements: ProfileOverviewAchievementViewModel[];
  racingStyle: string;
  favoriteTrack: string;
  favoriteCar: string;
  timezone: string;
  availableHours: string;
  lookingForTeam: boolean;
  openToRequests: boolean;
}

export interface ProfileOverviewViewModel {
  currentDriver: ProfileOverviewDriverSummaryViewModel | null;
  stats: ProfileOverviewStatsViewModel | null;
  finishDistribution: ProfileOverviewFinishDistributionViewModel | null;
  teamMemberships: ProfileOverviewTeamMembershipViewModel[];
  socialSummary: ProfileOverviewSocialSummaryViewModel;
  extendedProfile: ProfileOverviewExtendedProfileViewModel | null;
}