export interface SpotifyTrack {
  id: string;
  name: string;
  artists: SpotifyArtist[];
  album: SpotifyAlbum;
  duration_ms: number;
  external_urls: {
    spotify: string;
  };
  preview_url?: string;
  popularity: number;
}

export interface SpotifyArtist {
  id: string;
  name: string;
  external_urls: {
    spotify: string;
  };
}

export interface SpotifyAlbum {
  id: string;
  name: string;
  images: SpotifyImage[];
  external_urls: {
    spotify: string;
  };
}

export interface SpotifyImage {
  url: string;
  height: number;
  width: number;
}

export interface SpotifyUser {
  id: string;
  display_name: string;
  email: string;
  images: SpotifyImage[];
  external_urls: {
    spotify: string;
  };
}

export interface SpotifyPlaylist {
  id: string;
  name: string;
  description: string;
  images: SpotifyImage[];
  tracks: {
    total: number;
    items: SpotifyPlaylistTrack[];
  };
  external_urls: {
    spotify: string;
  };
}

export interface SpotifyPlaylistTrack {
  track: SpotifyTrack;
}

export interface RecentlyPlayedItem {
  track: SpotifyTrack;
  played_at: string;
}

export interface UserState {
  user: SpotifyUser | null;
  accessToken: string | null;
  refreshToken: string | null;
  isAuthenticated: boolean;
  recentlyPlayed: RecentlyPlayedItem[];
  topTracks: SpotifyTrack[];
  topArtists: SpotifyArtist[];
}

export interface AppState {
  currentUser: UserState | null;
  partnerUser: UserState | null;
  isLoading: boolean;
  error: string | null;
  currentTrack: SpotifyTrack | null;
  isPlaying: boolean;
}

export interface MixedPlaylist {
  id: string;
  name: string;
  description: string;
  tracks: SpotifyTrack[];
  createdAt: Date;
  createdBy: string;
}

export interface MemoryLaneItem {
  id: string;
  type: 'shared_track' | 'playlist_created' | 'milestone';
  title: string;
  description: string;
  track?: SpotifyTrack;
  playlist?: SpotifyPlaylist;
  date: Date;
  users: string[];
}
