import {
  Building2,
  Code,
  Lock,
  Server,
  Settings,
  Shield,
  Smartphone,
  Wifi,
  Wrench,
} from "lucide-react";
import type { ServiceCardAccentColor } from "@/components/molecules";

// =============================================================================
// TYPES
// =============================================================================

export type ServiceCategory = "personal" | "business";

export type CarouselAccent =
  | "blue"
  | "emerald"
  | "violet"
  | "amber"
  | "indigo"
  | "cyan"
  | "rose"
  | "slate";

export interface ServiceItem {
  title: string;
  icon: React.ReactNode;
  href: string;
}

export interface ConversionServiceCard {
  title: string;
  problemHook: string;
  keyBenefit: string;
  description: string;
  accent: CarouselAccent;
  badge?: string;
  icon: React.ReactNode;
  href: string;
  ctaLabel: string;
}

// =============================================================================
// SERVICE DATA
// =============================================================================

const ICON_CLASS_LG = "h-8 w-8 text-primary";
const ICON_CLASS_MD = "h-7 w-7";

const HREF_INTERNET = "/services/internet";
const HREF_SIM = "/services/sim";
const HREF_VPN = "/services/vpn";
const HREF_ONSITE = "/services/onsite";
const HREF_BUSINESS = "/services/business";

const CTA_VIEW_PLANS = "View Plans";
const CTA_GET_QUOTE = "Get a Quote";
const TITLE_ONSITE_SUPPORT = "Onsite Support";

export const personalServices: ServiceItem[] = [
  { title: "Internet Plan", icon: <Wifi className={ICON_CLASS_LG} />, href: HREF_INTERNET },
  { title: "Phone Plan", icon: <Smartphone className={ICON_CLASS_LG} />, href: HREF_SIM },
  { title: "VPN Service", icon: <Lock className={ICON_CLASS_LG} />, href: HREF_VPN },
  { title: TITLE_ONSITE_SUPPORT, icon: <Wrench className={ICON_CLASS_LG} />, href: HREF_ONSITE },
];

export const businessServices: ServiceItem[] = [
  {
    title: "Office LAN Setup",
    icon: <Server className={ICON_CLASS_LG} />,
    href: HREF_BUSINESS,
  },
  {
    title: "Onsite & Remote Tech Support",
    icon: <Wrench className={ICON_CLASS_LG} />,
    href: HREF_ONSITE,
  },
  {
    title: "Dedicated Internet Access",
    icon: <Building2 className={ICON_CLASS_LG} />,
    href: HREF_BUSINESS,
  },
  {
    title: "Data Center Service",
    icon: <Shield className={ICON_CLASS_LG} />,
    href: HREF_BUSINESS,
  },
  {
    title: "Website Construction",
    icon: <Code className={ICON_CLASS_LG} />,
    href: HREF_BUSINESS,
  },
  {
    title: "Website Maintenance",
    icon: <Settings className={ICON_CLASS_LG} />,
    href: HREF_BUSINESS,
  },
];

// =============================================================================
// CONVERSION CARD DATA (for ServicesCarousel)
// =============================================================================

export const personalConversionCards: ConversionServiceCard[] = [
  {
    title: "Internet Plans",
    problemHook: "Need reliable internet?",
    keyBenefit: "NTT Fiber up to 10Gbps",
    description:
      "High-speed NTT fiber with full English installation support. No Japanese paperwork — we handle everything for you.",
    accent: "blue",
    icon: <Wifi className={ICON_CLASS_MD} />,
    href: HREF_INTERNET,
    ctaLabel: CTA_VIEW_PLANS,
  },
  {
    title: "Phone Plans",
    problemHook: "Need a SIM card?",
    keyBenefit: "Docomo network coverage",
    description:
      "SIM cards on Japan's best network. Foreign credit cards accepted, no hanko required. Get connected in days.",
    accent: "emerald",
    badge: "1st month free",
    icon: <Smartphone className={ICON_CLASS_MD} />,
    href: HREF_SIM,
    ctaLabel: CTA_VIEW_PLANS,
  },
  {
    title: "VPN Service",
    problemHook: "Missing shows from home?",
    keyBenefit: "Stream US & UK content",
    description:
      "Stream your favorite shows from home. Pre-configured router — just plug in and watch US & UK content.",
    accent: "violet",
    icon: <Lock className={ICON_CLASS_MD} />,
    href: HREF_VPN,
    ctaLabel: CTA_VIEW_PLANS,
  },
  {
    title: TITLE_ONSITE_SUPPORT,
    problemHook: "Need hands-on help?",
    keyBenefit: "English-speaking technicians",
    description:
      "English-speaking technicians at your door. Router setup, network troubleshooting, and device configuration.",
    accent: "amber",
    icon: <Wrench className={ICON_CLASS_MD} />,
    href: HREF_ONSITE,
    ctaLabel: "Learn More",
  },
];

export const businessConversionCards: ConversionServiceCard[] = [
  {
    title: "Office LAN Setup",
    problemHook: "Setting up an office?",
    keyBenefit: "Complete network infrastructure",
    description:
      "Complete network infrastructure for your Japan office. Professional installation with ongoing bilingual support.",
    accent: "slate",
    icon: <Server className={ICON_CLASS_MD} />,
    href: HREF_BUSINESS,
    ctaLabel: CTA_GET_QUOTE,
  },
  {
    title: "Tech Support",
    problemHook: "Need ongoing IT help?",
    keyBenefit: "Onsite & remote support",
    description:
      "Dedicated English-speaking IT team for your business. Onsite and remote support whenever you need it.",
    accent: "amber",
    icon: <Wrench className={ICON_CLASS_MD} />,
    href: HREF_ONSITE,
    ctaLabel: CTA_GET_QUOTE,
  },
  {
    title: "Dedicated Internet",
    problemHook: "Need guaranteed bandwidth?",
    keyBenefit: "Enterprise-grade connectivity",
    description:
      "Enterprise-grade connectivity with guaranteed bandwidth and SLA. Built for businesses that can't afford downtime.",
    accent: "indigo",
    icon: <Building2 className={ICON_CLASS_MD} />,
    href: HREF_BUSINESS,
    ctaLabel: CTA_GET_QUOTE,
  },
  {
    title: "Data Center",
    problemHook: "Need hosting in Japan?",
    keyBenefit: "Secure, reliable infrastructure",
    description:
      "Secure, reliable hosting infrastructure in Japan. Colocation and managed services for your critical systems.",
    accent: "cyan",
    icon: <Shield className={ICON_CLASS_MD} />,
    href: HREF_BUSINESS,
    ctaLabel: CTA_GET_QUOTE,
  },
  {
    title: "Website Services",
    problemHook: "Need a web presence?",
    keyBenefit: "Construction & maintenance",
    description:
      "Professional website construction and ongoing maintenance. Bilingual design that connects with your audience.",
    accent: "rose",
    icon: <Code className={ICON_CLASS_MD} />,
    href: HREF_BUSINESS,
    ctaLabel: CTA_GET_QUOTE,
  },
];

export const services = [
  {
    title: "Internet Plans",
    description:
      "High-speed NTT fiber with English installation support. No Japanese paperwork, we handle everything for you.",
    icon: <Wifi className={ICON_CLASS_LG} />,
    href: HREF_INTERNET,
  },
  {
    title: "Phone Plans",
    description:
      "SIM cards on Japan's best network. Foreign credit cards accepted, no hanko required. Get connected in days.",
    icon: <Smartphone className={ICON_CLASS_LG} />,
    href: HREF_SIM,
  },
  {
    title: "Business Solutions",
    description:
      "Enterprise IT for international companies. Dedicated internet, office networks, and bilingual tech support.",
    icon: <Building2 className={ICON_CLASS_LG} />,
    href: HREF_BUSINESS,
  },
  {
    title: "VPN",
    description:
      "Stream your favorite shows from home. Pre-configured router, just plug in and watch US/UK content.",
    icon: <Lock className={ICON_CLASS_LG} />,
    href: HREF_VPN,
  },
  {
    title: TITLE_ONSITE_SUPPORT,
    description:
      "English-speaking technicians at your home or office. Router setup, network issues, and device help.",
    icon: <Wrench className={ICON_CLASS_LG} />,
    href: HREF_ONSITE,
  },
];

export const supportDownloads = [
  {
    title: "Acronis Quick Assist",
    href: "https://www.acronis.com/en/products/cloud/quick-assist/download/",
    image: "/assets/images/arconis.png",
    description:
      "Secure remote desktop tool for quick troubleshooting. Our technicians can view your screen and resolve issues in real-time.",
    useCase: "Best for: General tech support & diagnostics",
  },
  {
    title: "TeamViewer QS",
    href: "https://get.teamviewer.com/tokyo",
    image: "/assets/images/teamviewer.png",
    description:
      "Industry-standard remote access software. Allows our team to securely connect to your device for hands-on assistance.",
    useCase: "Best for: Complex configurations & file transfers",
  },
];

// Mobile quick services (top 3 most popular)
export const mobileQuickServices = personalServices.slice(0, 3);

// =============================================================================
// LANDING PAGE SERVICES (for ServicesGrid — derived from `services`)
// =============================================================================

export type LandingServiceItem = (typeof services)[number] & {
  accentColor: ServiceCardAccentColor;
};

const landingAccentMap: Record<string, ServiceCardAccentColor> = {
  "/services/internet": "blue",
  "/services/sim": "green",
  "/services/vpn": "purple",
  "/services/business": "orange",
};

export const landingServices: LandingServiceItem[] = services
  .filter(s => s.href in landingAccentMap)
  .map(s => ({ ...s, accentColor: landingAccentMap[s.href]! }));
