import { Button } from "@/components/atoms";
import {
  Tv,
  Film,
  Music,
  Trophy,
  Newspaper,
  Sparkles,
  MoreHorizontal,
  GraduationCap,
  Globe,
} from "lucide-react";

export default function TVServicesPage() {
  return (
    <div className="max-w-6xl mx-auto px-4">
      {/* Header */}
      <div className="text-center mb-16 pt-8">
        <h1 className="text-4xl sm:text-5xl font-extrabold text-foreground mb-6 tracking-tight">
          TV Services
        </h1>
        <p className="text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed">
          Providing a variety of options for our customers such as Satellite TV, Cable TV and
          Optical Fiber TV.
        </p>
      </div>

      {/* Intro */}
      <div className="max-w-3xl mx-auto text-center mb-16">
        <h2 className="text-2xl font-bold text-foreground mb-4">Service Lineup</h2>
        <p className="text-muted-foreground leading-relaxed mb-6">
          We are proud to act as agents for Japan's major paid TV service providers, and we will
          arrange your services on your behalf (no service fee required for us to arrange your
          services). Usually each building has their pre-assigned main TV service providers. To find
          out which TV service you can apply for, please feel free to contact us anytime.
        </p>
        <Button as="a" href="/contact" size="lg">
          Check Availability
        </Button>
      </div>

      {/* Services List */}
      <div className="space-y-16 mb-20">
        {/* Sky PerfecTV Premium Hikari */}
        <TVServiceSection
          title="Sky PerfecTV Premium Hikari (Optical Fiber TV)"
          fees={[
            { type: "Apartment Type", initial: "Free", monthly: "4,567 JPY" },
            {
              type: "Home Type",
              initial: "14,630 JPY (6,680 JPY if simultaneous installation)",
              monthly: "5,392 JPY",
            },
          ]}
          note="*Prices shown above are including tax (10%)"
        >
          <ChannelPackage title="Basic Package">
            <ChannelCategory
              title="Movie"
              channels={[
                "The Cinema HD",
                "Movie Plus HD",
                "Channel NECO HD",
                "Japanese Movie HD",
                "Fox Movie Premium HD",
                "Cinefil Wowow HD",
                "NTV G HD",
                "EX Sports",
                "Dance Channel",
              ]}
            />
            <ChannelCategory
              title="Sports"
              channels={[
                "Golf Network HD",
                "GAORA HD",
                "J Sports 1 HD",
                "J Sports 2 HD",
                "J Sports 3 HD",
                "Sky A Sports HD",
              ]}
            />
            <ChannelCategory
              title="Music"
              channels={[
                "Music Japan TV HD",
                "MTV HD",
                "Music ON! TV HD",
                "Space Shower TV HD",
                "Space Shower TV Plus HD",
                "Kayou Pops HD",
                "Music Air HD",
                "Music Graffiti TV",
              ]}
            />
            <ChannelCategory
              title="Kids"
              channels={[
                "Cartoon Network HD",
                "Disney Channel HD",
                "Disney XD HD",
                "Kids Station HD",
                "Animax HD",
                "Lala HD",
                "Asia Dramatic TV HD",
                "KBS World HD",
              ]}
            />
            <ChannelCategory
              title="Foreign Drama"
              channels={[
                "Super Drama TV HD",
                "AXN Mystery HD",
                "AXN HD",
                "FOX HD",
                "FOX CLASSICS HD",
              ]}
            />
            <ChannelCategory
              title="Documentary"
              channels={[
                "History Channel HD",
                "National Geographic HD",
                "Discovery HD",
                "Nat Geo Wild HD",
                "Animal Planet HD",
              ]}
            />
            <ChannelCategory
              title="News & Business"
              channels={[
                "TBS News Bird HD",
                "Nikkei CNBC HD",
                "BBC World News HD",
                "CNNj HD",
                "NTV News 24",
                "SORA Weather Channel",
                "E-tenki.net",
                "Entametele HD",
                "Nittele Plus HD",
              ]}
            />
            <ChannelCategory
              title="Entertainment"
              channels={[
                "Fox Sports HD",
                "FujiTV One HD",
                "FujiTV Two HD",
                "TBS Channel 1 HD",
                "TBS Channel 2 HD",
                "TV Asahi Channel 1 HD",
                "TV Asahi Channel 2 HD",
              ]}
            />
            <ChannelCategory
              title="Others"
              channels={[
                "Mondo TV HD",
                "Family Theater HD",
                "Home Drama HD",
                "Samurai Drama HD",
                "TABI Channel HD",
                "Tsuri Vision HD",
                "Igo/Shogi Channel HD",
              ]}
            />
          </ChannelPackage>
        </TVServiceSection>

        {/* Sky PerfecTV Premium (Satellite) */}
        <TVServiceSection
          title="Sky PerfecTV Premium (Satellite)"
          fees={[{ type: "Standard", initial: "Free", monthly: "4,514 JPY" }]}
          note="*Prices shown above are including tax (10%)"
        >
          <ChannelPackage title="Basic Package">
            <ChannelCategory
              title="Movie"
              channels={[
                "Imagica BS HD",
                "The Cinema HD",
                "Movie Plus HD",
                "Channel NECO HD",
                "Japanese Movie HD",
                "Fox Movie Premium HD",
                "Cinefil Wowow HD",
              ]}
            />
            <ChannelCategory
              title="Sports"
              channels={[
                "J Sports 3 HD",
                "Sky A Sports HD",
                "NTV G HD",
                "EX Sports",
                "Dance Channel",
              ]}
            />
            <ChannelCategory
              title="Music"
              channels={[
                "Music Japan TV HD",
                "MTV HD",
                "Music ON! TV HD",
                "Space Shower TV HD",
                "Space Shower TV Plus HD",
                "Kayou Pops HD",
                "Music Air HD",
                "Music Graffiti TV",
              ]}
            />
            <ChannelCategory
              title="Kids"
              channels={[
                "Cartoon Network HD",
                "Disney Channel HD",
                "Disney XD HD",
                "Kids Station HD",
                "Animax HD",
                "Disney Junior",
                "Asia Dramatic TV HD",
                "KBS World HD",
              ]}
            />
            <ChannelCategory
              title="Foreign Drama"
              channels={[
                "Super Drama TV HD",
                "AXN Mystery HD",
                "AXN HD",
                "FOX HD",
                "FOX CLASSICS HD",
                "Lala HD",
              ]}
            />
            <ChannelCategory
              title="Documentary"
              channels={[
                "History Channel HD",
                "National Geographic HD",
                "Discovery HD",
                "Nat Geo Wild HD",
                "Animal Planet HD",
              ]}
            />
            <ChannelCategory
              title="News & Business"
              channels={[
                "TBS News Bird HD",
                "Nikkei CNBC HD",
                "BBC World News HD",
                "CNNj HD",
                "NTV News 24",
                "CCTV Daifu",
                "SORA Weather Channel",
                "Entametele HD",
                "NTV Plus HD",
                "Channel Ginga",
              ]}
            />
            <ChannelCategory
              title="Entertainment"
              channels={[
                "Fox Sports HD",
                "FujiTV One HD",
                "FujiTV Two HD",
                "TBS Channel 1 HD",
                "TBS Channel 2 HD",
                "TV Asahi Channel 1 HD",
                "TV Asahi Channel 2 HD",
                "Yose Channel",
              ]}
            />
            <ChannelCategory
              title="Others"
              channels={[
                "IGO & Shogi",
                "Mondo 21 HD",
                "Family Theater HD",
                "Home Drama HD",
                "Samurai Drama HD",
                "TABI Channel HD",
                "Railyway Channel HD",
              ]}
            />
          </ChannelPackage>
        </TVServiceSection>

        {/* Sky PerfecTV (Satellite) */}
        <TVServiceSection
          title="Sky PerfecTV (Satellite)"
          fees={[
            { type: "Apartment Type", initial: "Free", monthly: "4,389 JPY" },
            {
              type: "Home Type",
              initial: "11,330 JPY (6,680 JPY if simultaneous installation)",
              monthly: "5,214 JPY",
            },
          ]}
          note="*Prices shown above are including tax (10%)"
        >
          <ChannelPackage title="Basic Package">
            <ChannelCategory
              title="Movie"
              channels={[
                "Movie Plus HD",
                "Japanese Movie HD (BS)",
                "The Cinema",
                "Channel NECO",
                "Cinefil Wowow HD",
              ]}
            />
            <ChannelCategory
              title="Sports"
              channels={["Nittele G HD", "Sky A Sports HD", "GAORA Sports HD", "Fox Sports HD"]}
            />
            <ChannelCategory
              title="Music"
              channels={[
                "MTV HD",
                "Music ON! TV HD",
                "Space Shower TV",
                "Music Air",
                "Space Shower TV Plus",
                "Kayo Pops",
              ]}
            />
            <ChannelCategory
              title="Kids"
              channels={[
                "Kids Station HD",
                "BS Animax HD (BS)",
                "Disney (BS)",
                "Cartoon Network",
                "Disney Junior",
              ]}
            />
            <ChannelCategory
              title="Foreign Drama"
              channels={["Lala HD", "Super Drama TV HD", "AXN", "AXN Mystery", "FOX"]}
            />
            <ChannelCategory
              title="Documentary"
              channels={["History Channel", "National Geographic", "Discovery", "Animal Planet"]}
            />
            <ChannelCategory
              title="News & Business"
              channels={[
                "TBS News Bird",
                "BBC World News",
                "CNNj",
                "NTV News 24",
                "TBS Channel 1 HD",
                "TBS Channel 2",
                "NTV Plus",
                "Channel Ginga",
              ]}
            />
            <ChannelCategory
              title="Entertainment"
              channels={[
                "Fuji TV One HD",
                "Fuji TV Two HD",
                "TV Asahi Channel 1 HD",
                "TV Asahi Channel 2 HD",
                "Igo/Shogi Channel",
                "Mondo TV HD",
              ]}
            />
            <ChannelCategory
              title="Others"
              channels={[
                "Tsuri Vision HD (BS)",
                "Family Gekijo HD",
                "Samurai Drama HD",
                "Home Drama Channel",
              ]}
            />
          </ChannelPackage>
        </TVServiceSection>

        {/* iTSCOM (CATV) */}
        <TVServiceSection
          title="iTSCOM (CATV)"
          fees={[{ type: "Big Package", initial: "11,000 JPY", monthly: "5,280 JPY" }]}
          note="*Prices shown above are including tax (10%)"
        >
          <ChannelPackage title="Big Package">
            <ChannelCategory
              title="Movie"
              channels={[
                "Movie Plus HD",
                "Japanese Movie HD",
                "Channel NECO HD",
                "FOX Movie Premium HD",
              ]}
            />
            <ChannelCategory
              title="Sports"
              channels={[
                "Golf Network HD",
                "Nittele G HD",
                "Sky A Sports HD",
                "GAORA HD",
                "J Sports 1 HD",
                "J Sports 2 HD",
                "J Sports 3 HD",
              ]}
            />
            <ChannelCategory
              title="Music"
              channels={["MTV HD", "Music ON! TV HD", "Space Shower TV", "Music Air"]}
            />
            <ChannelCategory
              title="Kids"
              channels={[
                "Animax HD",
                "Kids Station HD",
                "Disney XD",
                "Cartoon Network",
                "Baby TV",
                "Disney Junior",
              ]}
            />
            <ChannelCategory
              title="Foreign Drama"
              channels={[
                "AXN HD",
                "FOX HD",
                "Asia Dramatic TV HD",
                "Super Drama TV HD",
                "AXN Mystery HD",
                "Family Theater HD",
              ]}
            />
            <ChannelCategory
              title="Documentary"
              channels={[
                "Discovery HD",
                "National Geographic",
                "Animal Planet HD",
                "History Channel HD",
              ]}
            />
            <ChannelCategory
              title="News & Business"
              channels={[
                "BBC World News HD",
                "CNNj HD",
                "Nikkei CNBC HD",
                "TBS News Bird HD",
                "TV Asahi Channel 2",
                "NTV News 24",
                "NHK World Japan",
                "Disney Channel HD",
              ]}
            />
            <ChannelCategory
              title="Entertainment"
              channels={[
                "LaLa TV HD",
                "Channel Ginga HD",
                "Dlife HD",
                "FOX Sports HD",
                "TBS Channel 1 HD",
                "TBS Channel 2",
                "NTV Plus",
              ]}
            />
            <ChannelCategory
              title="Others"
              channels={[
                "Japanet Channel DX HD",
                "Jewelly Gem Shopping HD",
                "Samurai Drama HD",
                "TABI Channel",
                "QVC",
                "Shop Channel",
                "Igo/Shogi Channel",
              ]}
            />
          </ChannelPackage>
        </TVServiceSection>

        {/* JCOM (CATV) */}
        <TVServiceSection
          title="JCOM (CATV)"
          fees={[{ type: "Standard Package", initial: "9,900 JPY", monthly: "6,074 JPY" }]}
          note="*Prices shown above are including tax (10%)"
        >
          <ChannelPackage title="Standard Package">
            <ChannelCategory
              title="Movie"
              channels={[
                "Movie Plus HD",
                "The Cinema HD",
                "Channel NECO HD",
                "Japanese Movie HD",
                "Fox Movies",
                "Cinefil Wowow HD",
                "Fox Sports & Entertainment",
              ]}
            />
            <ChannelCategory
              title="Sports"
              channels={[
                "J Sports 1 HD",
                "J Sports 2 HD",
                "J Sports 3 HD",
                "Sky A Sports HD",
                "Golf Network HD",
                "GAORA HD",
              ]}
            />
            <ChannelCategory
              title="Music"
              channels={["MTV HD", "Music ON! TV HD", "Space Shower TV", "Kayou Pops"]}
            />
            <ChannelCategory
              title="Kids"
              channels={[
                "Animax HD",
                "Kids Station HD",
                "Cartoon Network HD",
                "Disney CHannel HD",
                "Disney XD HD",
                "Disney Junior HD",
                "AXN Mystery HD",
              ]}
            />
            <ChannelCategory
              title="Foreign Drama"
              channels={[
                "Super Drama TV HD",
                "FOX HD",
                "FOX Classics HD",
                "AXN HD",
                "Lala HD",
                "KBS World HD",
              ]}
            />
            <ChannelCategory
              title="Documentary"
              channels={[
                "Histroy Channel HD",
                "National Geographic HD",
                "Discovery Channel HD",
                "Animal Planet HD",
              ]}
            />
            <ChannelCategory
              title="News & Business"
              channels={[
                "TBS News Bird HD",
                "Nikkei CNBC HD",
                "TV Asahi Channel 2 HD",
                "CNNj",
                "NTV News 24",
                "NHK World Japan",
                "KBS World",
                "NTV Plus",
                "Act On TV",
              ]}
            />
            <ChannelCategory
              title="Entertainment"
              channels={[
                "FujiTV One HD",
                "FujiTV Two HD",
                "TBS Channel 1 HD",
                "TBS Channel 2 HD",
                "Channel Ginga HD",
                "TV Asahi Channel 1",
                "Housou University TV",
              ]}
            />
            <ChannelCategory
              title="Others"
              channels={[
                "Family Theater HD",
                "Samurai Drama HD",
                "Home Drama Channel HD",
                "Mondo TV HD",
                "Tsuri Vision HD",
                "Igo/Shogi Channel",
              ]}
            />
          </ChannelPackage>
        </TVServiceSection>
      </div>

      {/* FAQ */}
      <div className="max-w-4xl mx-auto mb-16">
        <h2 className="text-3xl font-bold text-foreground mb-8 text-center">
          Frequently Asked Questions
        </h2>
        <div className="space-y-6">
          <div className="bg-card rounded-2xl border border-border/60 p-8">
            <h3 className="text-xl font-bold text-foreground mb-3">
              Is Assist Solutions directly providing the TV service?
            </h3>
            <p className="text-muted-foreground leading-relaxed">
              As partners, we are able to refer you to each cable TV company available at your home.
              However, once the service starts, the cable TV service itself will be directly
              provided by each cable TV company.
            </p>
          </div>

          <div className="bg-card rounded-2xl border border-border/60 p-8">
            <h3 className="text-xl font-bold text-foreground mb-3">
              Would I be able to choose any cable TV service that Assist Solutions is partnered
              with?
            </h3>
            <p className="text-muted-foreground leading-relaxed">
              In Japan, most cable TV companies have predetermined service areas. We will be able to
              check which services are available for your home. Please contact us for a free
              consultation.
            </p>
          </div>
        </div>
      </div>

      {/* CTA */}
      <div className="text-center py-12 bg-muted/20 rounded-3xl">
        <h2 className="text-2xl font-bold text-foreground mb-4">
          Find the best TV service for you
        </h2>
        <Button as="a" href="/contact" size="lg">
          Contact Us
        </Button>
      </div>
    </div>
  );
}

// Helper Components

function TVServiceSection({
  title,
  fees,
  note,
  children,
}: {
  title: string;
  fees: { type: string; initial: string; monthly: string }[];
  note?: string;
  children?: React.ReactNode;
}) {
  return (
    <div className="border border-border/60 rounded-2xl overflow-hidden bg-card shadow-sm">
      <div className="bg-primary/5 p-6 border-b border-border/60">
        <div className="flex items-center gap-3">
          <div className="h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center text-primary">
            <Tv className="h-6 w-6" />
          </div>
          <h2 className="text-2xl font-bold text-foreground">{title}</h2>
        </div>
      </div>

      <div className="p-6 md:p-8">
        <div className="mb-8">
          <h3 className="text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-4">
            Service Fees
          </h3>
          <div className="overflow-x-auto">
            <table className="w-full text-sm text-left">
              <thead className="bg-muted/50 text-muted-foreground font-medium">
                <tr>
                  <th className="px-4 py-3 rounded-l-lg">Type</th>
                  <th className="px-4 py-3">Initial Cost</th>
                  <th className="px-4 py-3 rounded-r-lg">Monthly Cost</th>
                </tr>
              </thead>
              <tbody className="divide-y divide-border/60">
                {fees.map((fee, i) => (
                  <tr key={i}>
                    <td className="px-4 py-3 font-medium text-foreground">{fee.type}</td>
                    <td className="px-4 py-3">{fee.initial}</td>
                    <td className="px-4 py-3">{fee.monthly}</td>
                  </tr>
                ))}
              </tbody>
            </table>
          </div>
          {note && <p className="text-xs text-muted-foreground mt-2">{note}</p>}
        </div>

        {children}
      </div>
    </div>
  );
}

function ChannelPackage({ title, children }: { title: string; children: React.ReactNode }) {
  return (
    <div>
      <h3 className="text-lg font-bold text-foreground mb-4 border-l-4 border-primary pl-3">
        {title}
      </h3>
      <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">{children}</div>
    </div>
  );
}

function ChannelCategory({ title, channels }: { title: string; channels: string[] }) {
  return (
    <div className="bg-muted/30 rounded-lg p-4">
      <h4 className="font-semibold text-foreground mb-3 flex items-center gap-2">
        {title === "Movie" && <Film className="h-4 w-4 text-primary" />}
        {title === "Music" && <Music className="h-4 w-4 text-primary" />}
        {title === "Sports" && <Trophy className="h-4 w-4 text-primary" />}
        {title === "News & Business" && <Newspaper className="h-4 w-4 text-primary" />}
        {title === "Entertainment" && <Sparkles className="h-4 w-4 text-primary" />}
        {title === "Kids" && <Sparkles className="h-4 w-4 text-primary" />}
        {title === "Foreign Drama" && <Globe className="h-4 w-4 text-primary" />}
        {title === "Documentary" && <GraduationCap className="h-4 w-4 text-primary" />}
        {title === "Others" && <MoreHorizontal className="h-4 w-4 text-primary" />}
        {title}
      </h4>
      <ul className="space-y-1">
        {channels.map(channel => (
          <li key={channel} className="text-sm text-muted-foreground">
            {channel}
          </li>
        ))}
      </ul>
    </div>
  );
}
