export interface BilingualText {
  zh: string;
  en: string;
}

export interface BilingualArray {
  zh: string[];
  en: string[];
}

export interface BrandData {
  name: BilingualText;
  slogan: BilingualText;
  logo?: string;
  author: string;
  github: string;
  email: string;
  icp?: string;
  policeRecord?: string;
}

export interface NavItem {
  id: string;
  label: BilingualText;
  hash: string;
}

export interface Category {
  id: string;
  label: BilingualText;
  icon: string;
}

export interface StatusDef {
  label: BilingualText;
  color: string;
}

export interface Download {
  platform: string;
  arch: string;
  url: string;
  size: string;
  sha256: string;
}

export interface RoadmapItem {
  done: string[];
  doing: string[];
  planned: string[];
}

export interface ChangelogEntry {
  version: string;
  date: string;
  changes: BilingualArray;
}

export interface Project {
  id: string;
  name: string;
  displayName: BilingualText;
  slogan: BilingualText;
  description: BilingualText;
  type: string[];
  status: string;
  platforms: string[];
  techStack: string[];
  features: BilingualArray;
  tags: string[];
  icon: string;
  repoUrl: string;
  docsUrl?: string;
  npmUrl?: string;
  latestVersion: string;
  releaseDate: string;
  license: string;
  stars: number;
  forks: number;
  language: string;
  lastUpdated: string;
  recommended: boolean;
  featured: boolean;
  order: number;
  color: string;
  downloads: Download[];
  roadmap?: RoadmapItem;
  changelog?: ChangelogEntry[];
  architecture?: BilingualText;
  screenshots?: string[];
}

export interface AboutData {
  bio: BilingualText;
  focus: BilingualArray;
  techStack: string[];
  github: string;
}

export interface SiteData {
  brand: BrandData;
  nav: NavItem[];
  categories: Category[];
  statuses: Record<string, StatusDef>;
  platforms: Record<string, string>;
  projects: Project[];
  about: AboutData;
  i18n: {
    zh: Record<string, string>;
    en: Record<string, string>;
  };
}

export interface AppContextType {
  lang: 'zh' | 'en';
  theme: 'dark' | 'light';
  mobileMenuOpen: boolean;
  toggleTheme: () => void;
  toggleLang: () => void;
  openMobileMenu: () => void;
  closeMobileMenu: () => void;
}
