import type { SubscriptionPlan, SubscriptionSettings } from "@/types";

// Central subscription configuration. Change the display name once here.
export const SUBSCRIPTION = {
  displayName: "Platform Subscription",
  shortName: "Subscription",
  navLabel: "Subscription",
  route: "/subscription" as const,
  accountRoute: "/account/subscription" as const,
  badge: { label: "Subscriber", color: "#8a62a8" },
  medal: { label: "Founding Subscriber", icon: "🌙" },
  durations: [
    { id: "1m", label: "1 month", days: 30, price: 4.99 },
    { id: "3m", label: "3 months", days: 90, price: 12.99, savingsPct: 13 },
    { id: "6m", label: "6 months", days: 180, price: 23.99, savingsPct: 20 },
    { id: "12m", label: "12 months", days: 365, price: 42.99, savingsPct: 28 },
  ],
  featureFlags: {
    lifetimeAvailable: true,
    giftingEnabled: true,
    autoRenewDefault: true,
  },
  benefits: {
    progression: [
      "Additional coin multiplier",
      "Additional MMR / XP multiplier",
      "Scheduled AFK reward multiplier",
      "Clan-point multiplier",
      "Additional daily progression rewards",
      "Subscriber-only missions",
    ],
    profile: [
      "Permanent subscription medal after first purchase",
      "Subscription badge next to nickname",
      "Extra showcase slots",
      "Subscriber profile backgrounds",
      "Custom profile accent",
      "Custom nickname color",
      "Badge ordering",
    ],
    chat: [
      "Subscription tag",
      "Custom tag color",
      "Custom nickname + chat accent",
      "Extra reactions and emojis",
      "Increased upload limits",
    ],
    marketplace: [
      "Increased daily buy / sell limits",
      "Reduced marketplace fee",
      "Extra favorites & saved searches",
      "Subscriber filters",
      "Price alerts and analytics",
    ],
    daily: [
      "Additional fortune-wheel spin",
      "Streak protection",
      "Additional daily reward",
      "Subscriber reward pool",
    ],
    platform: [
      "Subscription settings panel",
      "Badge visibility controls",
      "Extra notification settings",
      "Additional saved skin presets",
      "Additional favorite servers",
      "Priority support indicator",
      "Early-access placeholder",
      "Subscriber announcements",
      "Increased support attachment limits",
    ],
  },
  defaultSettings: {
    badgeVisibleProfile: true,
    badgeVisibleChat: true,
    badgeVisibleRankings: true,
    badgeVisibleScoreboard: true,
    nicknameColor: "#c9a5ff",
    chatAccent: "#8a62a8",
    tagColor: "#683c96",
    profileAccent: "#8a62a8",
    showMedal: true,
    badgeOrder: 1,
    profileBackground: "purple-mist",
    notifyDailyRewards: true,
    notifyMarketplace: true,
    notifyRenewal: true,
  } as SubscriptionSettings,
};

export const SUBSCRIPTION_PLANS: SubscriptionPlan[] = [
  { id: "1m", label: "1 month", durationDays: 30, price: 4.99, visible: true },
  { id: "3m", label: "3 months", durationDays: 90, price: 12.99, originalPrice: 14.97, savingsPct: 13, visible: true },
  { id: "6m", label: "6 months", durationDays: 180, price: 23.99, originalPrice: 29.94, savingsPct: 20, visible: true },
  { id: "12m", label: "12 months", durationDays: 365, price: 42.99, originalPrice: 59.88, savingsPct: 28, visible: true },
  { id: "lifetime", label: "Lifetime", durationDays: 36500, price: 149.99, lifetime: true, visible: true },
];