/**
 * Plan definitions -- safe to import from any context (client, server, edge).
 * Does NOT import Stripe SDK.
 *
 * Price IDs are resolved server-side from env vars in the checkout route.
 * Client sends plan key (e.g. "pro"), not price ID — no Stripe IDs leak to browser.
 */

const API_KEY_LIMITS = { free: 2, pro: 10, team: 50, enterprise: 100 } as const;

export const PLANS = {
  free: {
    name: "Free",
    price: 0,
    description: "Local inference, no limits",
    cta: "pip install llmhosts",
    apiKeyLimit: API_KEY_LIMITS.free,
    features: [
      "Local proxy (OpenAI + Anthropic)",
      "Basic three-tier router",
      "Exact-match cache",
      "TUI dashboard",
      "2 API keys",
    ],
  },
  pro: {
    name: "Pro",
    price: 29,
    description: "Cut cloud costs 60%+ with smart routing",
    cta: "Start free trial",
    apiKeyLimit: API_KEY_LIMITS.pro,
    features: [
      "Cloud cost intelligence",
      "Global router data",
      "Multi-device mesh (up to 5)",
      "10 API keys",
      "Priority support",
    ],
  },
  team: {
    name: "Team",
    price: 99,
    description: "Pool GPUs across your team",
    cta: "Start free trial",
    apiKeyLimit: API_KEY_LIMITS.team,
    features: [
      "Everything in Pro",
      "Hive Mode (shared GPU pool)",
      "RBAC + team management",
      "50 API keys",
      "Shared configurations",
      "Per-developer cost breakdown",
    ],
  },
  enterprise: {
    name: "Enterprise",
    price: 299,
    description: "Full compliance + dedicated support",
    cta: "Talk to us",
    apiKeyLimit: API_KEY_LIMITS.enterprise,
    features: [
      "Everything in Team",
      "100 API keys",
      "SOC2 compliance",
      "SLA guarantee",
      "Audit logs",
      "SSO (SAML)",
      "Dedicated support",
    ],
  },
} as const;

export { API_KEY_LIMITS };

export type PlanKey = keyof typeof PLANS;
