export type PlatformNativeProfile = {
  appId: string;
  name: string;
  platform: string;
  deviceClass: "web" | "mobile" | "tablet" | "tv" | "smart-tv";
  layoutMode: string;
  inputModel: string[];
  navigationModel: string[];
  nativeFeatures: string[];
  responsiveRules: string[];
  shellRequirements: string[];
  certificationGates: string[];
  previewMode: "responsive_web_preview" | "tv_remote_preview" | "device_lab_required";
  notWebviewOnly: true;
};

const profiles: PlatformNativeProfile[] = [
  {
    appId: "web-pwa",
    name: "Primary Web / PWA",
    platform: "Web/PWA",
    deviceClass: "web",
    layoutMode: "Responsive browser/PWA layout with installable app shell, desktop/mobile/tablet breakpoints and offline/error surface.",
    inputModel: ["mouse", "keyboard", "touch"],
    navigationModel: ["top navigation", "keyboard focus", "browser back/forward", "install prompt"],
    nativeFeatures: ["PWA manifest", "offline page", "installable shell", "responsive safe viewport"],
    responsiveRules: ["desktop grid", "tablet two-column", "mobile stacked", "minimum tap target 44px"],
    shellRequirements: ["manifest", "icons", "theme color", "offline/error fallback", "no native store signing required"],
    certificationGates: ["PWA installability", "Lighthouse/PWA checks", "keyboard accessibility"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "android-mobile",
    name: "Android Mobile",
    platform: "Android",
    deviceClass: "mobile",
    layoutMode: "Android phone-first layout with Material-style bottom reachability, portrait-first navigation, Android back behavior and fullscreen player handoff.",
    inputModel: ["touch", "Android back", "keyboard optional"],
    navigationModel: ["bottom-safe touch navigation", "system back", "deep links", "intent/share targets"],
    nativeFeatures: ["TWA/WebView shell", "Android back stack", "orientation handling", "status/navigation bar safe areas", "Play data-safety readiness"],
    responsiveRules: ["portrait-first", "one-hand tap zones", "bottom nav or reachable top controls", "safe under display cutouts"],
    shellRequirements: ["package ID", "signing key", "Play Console app", "privacy/data safety", "fullscreen video policy"],
    certificationGates: ["Android vitals", "crash-free launch", "back button behavior", "Play review"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "ios-mobile",
    name: "iOS Mobile",
    platform: "iOS",
    deviceClass: "mobile",
    layoutMode: "iPhone-safe layout with iOS safe areas, WKWebView/PWA behavior, swipe/back expectations, privacy labels and App Store review flow.",
    inputModel: ["touch", "iOS gestures", "hardware keyboard optional"],
    navigationModel: ["safe-area top/bottom", "swipe/back compatible flow", "tab-bar friendly hierarchy"],
    nativeFeatures: ["WKWebView/PWA shell", "safe area insets", "App Store privacy labels", "account deletion/support links"],
    responsiveRules: ["Dynamic Island/notch safe", "portrait-first", "large tap targets", "iOS scroll physics tolerance"],
    shellRequirements: ["bundle ID", "signing profile", "App Store Connect", "privacy labels", "review notes"],
    certificationGates: ["App Store review", "privacy nutrition labels", "crash-free launch", "account deletion route"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "android-tablet",
    name: "Android Tablet",
    platform: "Android Tablet",
    deviceClass: "tablet",
    layoutMode: "Tablet-native two-pane Android layout with adaptive columns, landscape support, keyboard/touch hybrid interaction and Play tablet assets.",
    inputModel: ["touch", "keyboard", "mouse/pointer", "Android back"],
    navigationModel: ["two-pane master/detail", "landscape primary", "split-screen support", "keyboard shortcuts"],
    nativeFeatures: ["large-screen breakpoints", "resizable activity", "tablet screenshots", "Play large-screen quality"],
    responsiveRules: ["two-column at tablet widths", "landscape rail navigation", "minimum content width", "no stretched phone UI"],
    shellRequirements: ["tablet screenshots", "resizable declaration", "package ID", "signing key", "Play Console tablet distribution"],
    certificationGates: ["large-screen quality", "split-screen behavior", "keyboard navigation", "orientation testing"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "ipados",
    name: "iPadOS",
    platform: "iPadOS",
    deviceClass: "tablet",
    layoutMode: "iPad-native adaptive layout with Stage Manager readiness, pointer/keyboard support, split view and landscape-first media browsing.",
    inputModel: ["touch", "Apple Pencil optional", "pointer", "keyboard"],
    navigationModel: ["sidebar/detail layout", "split view", "keyboard shortcuts", "safe-area aware modals"],
    nativeFeatures: ["WKWebView/PWA shell", "iPad screenshots", "Stage Manager/split view tolerance", "safe areas"],
    responsiveRules: ["sidebar at wide width", "modal sheets not phone-sized", "landscape-friendly grids", "pointer hover states"],
    shellRequirements: ["bundle ID", "App Store Connect", "iPad screenshots", "privacy labels", "review notes"],
    certificationGates: ["iPad App Store review", "multitasking behavior", "keyboard/pointer accessibility"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "chromeos-tablet",
    name: "ChromeOS Tablet",
    platform: "ChromeOS Tablet",
    deviceClass: "tablet",
    layoutMode: "ChromeOS adaptive tablet/desktop hybrid layout with resizable window behavior and keyboard/touch/pointer parity.",
    inputModel: ["touch", "keyboard", "mouse/pointer"],
    navigationModel: ["resizable window", "tablet mode", "desktop mode", "keyboard shortcuts"],
    nativeFeatures: ["PWA/Android container compatibility", "resizable shell", "keyboard shortcut support"],
    responsiveRules: ["window-size adaptive", "tablet mode touch targets", "desktop pointer hover", "no fixed phone viewport"],
    shellRequirements: ["PWA or Android wrapper", "ChromeOS compatibility", "window resizing tests"],
    certificationGates: ["Chromebook compatibility", "input parity", "resizable layout"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "fire-tablet",
    name: "Amazon Fire Tablet",
    platform: "Fire Tablet",
    deviceClass: "tablet",
    layoutMode: "Fire OS tablet layout with Amazon Appstore readiness, touch-first tablet grids and no Google Play Services dependency.",
    inputModel: ["touch", "keyboard optional"],
    navigationModel: ["tablet touch navigation", "Android-compatible back", "Amazon Appstore flow"],
    nativeFeatures: ["Fire OS WebView wrapper", "Amazon Appstore metadata", "no Google Play Services dependency"],
    responsiveRules: ["tablet breakpoints", "Fire tablet screenshots", "landscape/portrait tolerance"],
    shellRequirements: ["Amazon developer account", "package signing", "Fire tablet assets", "privacy policy"],
    certificationGates: ["Amazon Appstore review", "Fire OS playback behavior", "no unsupported Google APIs"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "windows-tablet",
    name: "Windows Tablet / Surface",
    platform: "Windows Tablet",
    deviceClass: "tablet",
    layoutMode: "Windows tablet/PWA/WebView2 adaptive layout with touch, keyboard, pointer and resizable Surface-style interaction.",
    inputModel: ["touch", "keyboard", "mouse/pointer"],
    navigationModel: ["resizable window", "keyboard shortcuts", "pointer hover", "tablet mode"],
    nativeFeatures: ["PWA/WebView2 shell", "Microsoft Store/enterprise readiness", "window controls"],
    responsiveRules: ["desktop/tablet adaptive", "touch targets", "resizable windows", "pointer hover states"],
    shellRequirements: ["PWA/WebView2 package", "Microsoft Partner Center if store distribution", "privacy policy"],
    certificationGates: ["Windows package validation", "resizable layout", "keyboard/touch QA"],
    previewMode: "responsive_web_preview",
    notWebviewOnly: true
  },
  {
    appId: "android-tv",
    name: "Android TV / Google TV",
    platform: "Android TV",
    deviceClass: "tv",
    layoutMode: "10-foot Android TV layout with D-pad focus, remote-first rows, oversized typography and lean-back navigation.",
    inputModel: ["D-pad", "select", "back", "home/menu"],
    navigationModel: ["focus graph", "row/rail navigation", "remote back/exit", "no pointer dependency"],
    nativeFeatures: ["TV launcher assets", "leanback intent", "D-pad focus engine", "TV-safe overscan", "fullscreen player controls"],
    responsiveRules: ["10-foot typography", "safe overscan margins", "focus ring visible", "row-based browsing"],
    shellRequirements: ["Android TV package", "TV launcher banner", "remote key handling", "Play TV listing"],
    certificationGates: ["Android TV quality", "D-pad navigation", "TV playback controls", "Play review"],
    previewMode: "tv_remote_preview",
    notWebviewOnly: true
  },
  {
    appId: "fire-tv",
    name: "Fire TV",
    platform: "Fire TV",
    deviceClass: "tv",
    layoutMode: "Fire TV 10-foot layout with Amazon remote behavior, focus-safe rows and Fire OS media shell.",
    inputModel: ["Fire TV remote", "D-pad", "select", "back/menu/play-pause"],
    navigationModel: ["focus graph", "row/rail navigation", "remote media keys", "back/exit flow"],
    nativeFeatures: ["Fire TV package", "Amazon remote key map", "TV launcher art", "fullscreen player handoff"],
    responsiveRules: ["10-foot UI", "overscan safe", "remote-only usability", "no hover/touch dependency"],
    shellRequirements: ["Amazon developer account", "Fire TV assets", "package signing", "remote key mapping"],
    certificationGates: ["Amazon Fire TV review", "remote navigation", "crash-free playback"],
    previewMode: "tv_remote_preview",
    notWebviewOnly: true
  },
  {
    appId: "gaiaos",
    name: "GAIAOS / CVTE",
    platform: "GAIAOS",
    deviceClass: "tv",
    layoutMode: "GAIAOS TV partner/OEM layout with remote-first 10-foot UX, OEM runtime constraints, China-market readiness and waiting-for-partner private checklist.",
    inputModel: ["TV remote", "D-pad", "select", "back/exit/menu"],
    navigationModel: ["remote focus graph", "row/rail layout", "no pointer-only UI", "OEM key mapping waiting"],
    nativeFeatures: ["GAIAOS/OEM web runtime", "remote focus behavior", "China-market no-Google-services assumption", "partner/OEM distribution"],
    responsiveRules: ["10-foot typography", "overscan safe", "remote-only navigation", "reduced memory pressure", "TV browser constraints waiting"],
    shellRequirements: ["GAIAOS/CVTE partner contact", "official runtime specs", "OEM app ID", "remote key map", "certification checklist waiting"],
    certificationGates: ["partner/OEM review waiting", "GAIAOS runtime specs waiting", "remote navigation QA", "China-market compliance review"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  },
  {
    appId: "roku",
    name: "Roku Channel",
    platform: "Roku",
    deviceClass: "tv",
    layoutMode: "Roku channel layout with SceneGraph/BrightScript-style remote focus and Roku channel certification behavior.",
    inputModel: ["Roku remote", "D-pad", "OK", "Back", "Home", "Play/Pause"],
    navigationModel: ["SceneGraph focus", "row/rail navigation", "remote media keys", "deep linking"],
    nativeFeatures: ["Roku channel package", "manifest", "deep linking", "remote media keys", "certification checklist"],
    responsiveRules: ["10-foot safe area", "visible focus", "row-based browsing", "no browser-only assumptions"],
    shellRequirements: ["Roku developer account", "channel manifest", "SceneGraph wrapper", "RPK packaging"],
    certificationGates: ["Roku certification", "deep-link tests", "remote navigation", "crash-free playback"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  },
  {
    appId: "tvos",
    name: "tvOS / Apple TV",
    platform: "tvOS",
    deviceClass: "tv",
    layoutMode: "tvOS focus-engine layout with Siri Remote behavior, top-shelf readiness and Apple TV review constraints.",
    inputModel: ["Siri Remote", "D-pad/clickpad", "play/pause", "menu/back"],
    navigationModel: ["tvOS focus engine", "parallax/focus states", "top shelf optional", "remote media keys"],
    nativeFeatures: ["tvOS app shell", "focus engine", "Top Shelf policy", "Apple TV screenshots"],
    responsiveRules: ["10-foot typography", "focus-safe cards", "overscan safe", "remote-only UX"],
    shellRequirements: ["tvOS bundle ID", "signing profile", "App Store Connect", "Apple TV assets"],
    certificationGates: ["tvOS App Store review", "focus engine QA", "privacy labels", "crash-free launch"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  },
  {
    appId: "samsung-tizen",
    name: "Samsung Tizen",
    platform: "Tizen",
    deviceClass: "smart-tv",
    layoutMode: "Samsung Tizen TV layout with remote key handling, TV browser/runtime constraints and Seller Office certification readiness.",
    inputModel: ["Samsung remote", "D-pad", "select", "back/exit", "color/media keys optional"],
    navigationModel: ["focus graph", "row/rail navigation", "remote back/exit", "Tizen key map"],
    nativeFeatures: ["Tizen package", "Samsung Seller Office metadata", "remote key mapping", "TV memory/runtime constraints"],
    responsiveRules: ["10-foot UI", "overscan safe", "focus visible", "Tizen browser constraints"],
    shellRequirements: ["Seller Office account", "Tizen package", "TV app ID", "icons/screenshots", "certification checklist"],
    certificationGates: ["Samsung certification", "remote key QA", "memory/performance", "playback controls"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  },
  {
    appId: "lg-webos",
    name: "LG webOS",
    platform: "webOS",
    deviceClass: "smart-tv",
    layoutMode: "LG webOS TV layout with Magic Remote/pointer tolerance, D-pad fallback and LG Seller Lounge checklist.",
    inputModel: ["LG Magic Remote", "pointer", "D-pad", "back/exit"],
    navigationModel: ["pointer plus focus fallback", "row/rail navigation", "remote back/exit", "fullscreen player handoff"],
    nativeFeatures: ["webOS package", "LG Seller Lounge metadata", "Magic Remote compatibility", "self-checklist"],
    responsiveRules: ["10-foot UI", "pointer-safe cards", "focus fallback", "overscan safe"],
    shellRequirements: ["LG Seller Lounge account", "webOS package", "app metadata", "UX scenario/self-checklist"],
    certificationGates: ["LG QA review", "Magic Remote behavior", "D-pad fallback", "playback controls"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  },
  {
    appId: "vizio",
    name: "VIZIO",
    platform: "VIZIO",
    deviceClass: "smart-tv",
    layoutMode: "VIZIO partner smart-TV layout with remote-first 10-foot UX and partner checklist waiting.",
    inputModel: ["VIZIO remote", "D-pad", "select", "back/exit"],
    navigationModel: ["remote focus graph", "row/rail layout", "partner key map waiting"],
    nativeFeatures: ["VIZIO partner runtime waiting", "remote focus behavior", "TV-safe layout"],
    responsiveRules: ["10-foot UI", "remote-only navigation", "overscan safe", "partner constraints waiting"],
    shellRequirements: ["VIZIO partner portal/contact", "runtime specs waiting", "OEM distribution requirements waiting"],
    certificationGates: ["VIZIO partner review waiting", "device QA", "remote navigation", "playback behavior"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  },
  {
    appId: "vidaa",
    name: "VIDAA / Hisense",
    platform: "VIDAA",
    deviceClass: "smart-tv",
    layoutMode: "VIDAA/Hisense smart-TV layout with remote-first TV UX and VIDAA partner requirements waiting.",
    inputModel: ["VIDAA remote", "D-pad", "select", "back/exit"],
    navigationModel: ["remote focus graph", "row/rail layout", "partner key map waiting"],
    nativeFeatures: ["VIDAA runtime waiting", "remote focus behavior", "TV-safe layout", "partner distribution"],
    responsiveRules: ["10-foot UI", "remote-only navigation", "overscan safe", "VIDAA runtime constraints waiting"],
    shellRequirements: ["VIDAA partner portal/contact", "runtime specs waiting", "certification checklist waiting"],
    certificationGates: ["VIDAA review waiting", "device QA", "remote navigation", "playback behavior"],
    previewMode: "device_lab_required",
    notWebviewOnly: true
  }
];

export function getPlatformProfile(appId: string): PlatformNativeProfile {
  return profiles.find((profile) => profile.appId === appId) || profiles[0];
}

export function getPlatformProfiles(): PlatformNativeProfile[] {
  return profiles;
}
