// API 요청 파라미터 타입
export interface GameDataRequest {
  game_alias: string;
  lang_code: string;
  q?: string;
  qc?: string;
}

// API 응답 데이터 타입
export interface GameDataResponse {
  code: number;
  message: string;
  value: GameDataValue;
}

// API 응답의 value 객체 타입
export interface GameDataValue {
  game_id: string;
  game_code: number;
  s3_folder_name: string;
  default_lang_code: string;
  ga_code: string;
  favicon_path: string;
  design_theme: number;
  key_color_codes: string[];
  lang_codes: string[];
  use_game_font: boolean;
  footer_dev_ci_img_yn: boolean;
  game_font: GameDataFont;
  global: GameDataGlobal;
  gnb: GameDataGnb;
  quick_menus: GameDataQuickMenu[];
  stove_gnb: GameDataStoveGnb;
  comm_img: GameDataCommImg;
  meta_tag: GameDataMetaTag;
  youtube: GameDataYoutube;
  sns: GameDataSns;
  market: GameDataMarket;
  footer: GameDataFooter;
}

// Global 설정 타입
export interface GameDataGlobal {
  system_font: GameDataFont;
  lang: GameDataLang;
}

// 폰트 타입
export interface GameDataFont {
  "font-family": string;
}

// 언어 설정 타입
export interface GameDataLang {
  dir: string;
  iso: string;
  code: string;
  name: string;
}

// GNB 설정 타입
export interface GameDataGnb {
  game_gnb_ver: string;
  display_start_dt: number;
  theme_type: string;
  bi_path: string;
  lang_codes: string[];
  buttons: any[];
  menus: GameDataMenu[];
}

// 메뉴 타입
export interface GameDataMenu {
  path_code: string;
  depth: number;
  sort_order: number;
  menu_name: string;
  click_action_type: number;
  url_path: string;
  link_target: string;
  tracking: GameDataTracking;
}

// 트래킹 타입
export interface GameDataTracking {
  viewType: string;
  actionType: string;
  clickSarea: string;
}

// 퀵 메뉴 타입
export interface GameDataQuickMenu {
  banner_seq: number;
  promotion_name: string;
  thumbnail: string;
  page_url_type: number;
  page_url: string;
  link_type: number;
  display_start_dt: string;
  display_end_dt: string;
  sort_order: number;
  banner_title: string;
}

// Stove GNB 타입
export interface GameDataStoveGnb {
  skin_type: string;
  stove_install_button_visible: string;
}

// 공통 이미지 타입
export interface GameDataCommImg {
  groups: GameDataCommImgGroup[];
}

// 공통 이미지 그룹 타입
export interface GameDataCommImgGroup {
  img_path: GameDataImgPath;
  required: boolean;
  img_scope: string;
  group_code: string;
  group_label: string;
}

// 이미지 경로 타입
export interface GameDataImgPath {
  comm: string;
}

// 메타 태그 타입
export interface GameDataMetaTag {
  x_desc: string;
  og_desc: string;
  x_image: string;
  x_title: string;
  og_image: string;
  og_title: string;
  page_desc: string;
  page_title: string;
}

// YouTube 설정 타입
export interface GameDataYoutube {
  use_yn: number;
  api_key: string;
}

// SNS 설정 타입
export interface GameDataSns {
  kakao: GameDataSnsItem;
  tiktok: GameDataSnsItem;
  discord: GameDataSnsItem;
  twitter: GameDataSnsItem;
  youtube: GameDataSnsItem;
  facebook: GameDataSnsItem;
  instagram: GameDataSnsItem;
}

// SNS 아이템 타입
export interface GameDataSnsItem {
  url: string | null;
  use_yn: number;
}

// 마켓 설정 타입
export interface GameDataMarket {
  pc: GameDataMarketItem;
  app_store: GameDataMarketItem;
  google_play: GameDataMarketItem;
}

// 마켓 아이템 타입
export interface GameDataMarketItem {
  url: string | null;
  use_yn: number;
}

// 푸터 설정 타입
export interface GameDataFooter {
  dev_ci_url: string;
  use_dev_ci_url: boolean;
  fund_display_yn: boolean;
  use_game_rating: boolean;
  fund_display_url: string;
  game_rating_info: GameDataGameRatingInfo;
}

// 게임 등급 정보 타입
export interface GameDataGameRatingInfo {
  title: string;
  reg_no: string;
  prod_date: string;
  rating_type: string;
  company_name: string;
  content_info: string;
  rating_grade: string;
  rating_class_no: string;
}

// API 에러 응답 타입
export interface GameDataErrorResponse {
  code: number;
  message: string;
  error?: string;
}

// API 응답 래퍼 타입 (성공/실패 통합)
export type GameDataApiResponse = GameDataResponse | GameDataErrorResponse;

// API 호출 옵션 타입
export interface GameDataApiOptions {
  gameAlias: string;
  langCode: string;
  q: string;
  qc: string;
  baseUrl?: string;
}

// API 상태 타입
export type GameDataApiStatus = "idle" | "loading" | "success" | "error";

// API 결과 타입 (상태와 데이터를 함께 관리)
export interface GameDataApiResult {
  status: GameDataApiStatus;
  data: GameDataResponse | null;
  error: string | null;
}

// 기존 gameData 타입과의 호환성을 위한 별칭
export type gameData = GameDataValue;
