"use client";

import { Link, useTranslation } from "@/i18n/navigation";

const days = [
  { day: 1, icon: "👋", color: "bg-sky-500" },
  { day: 2, icon: "💡", color: "bg-cyan-500" },
  { day: 3, icon: "💰", color: "bg-teal-500" },
  { day: 4, icon: "🛠️", color: "bg-emerald-500" },
  { day: 5, icon: "📋", color: "bg-amber-500" },
  { day: 6, icon: "🗺️", color: "bg-orange-500" },
  { day: 7, icon: "🚀", color: "bg-rose-500" },
];

export default function Roadmap() {
  const { t } = useTranslation("roadmap");
  return (
    <section id="roadmap" className="bg-slate-50 py-20 sm:py-28">
      <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div className="text-center">
          <h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
            {t("title")} <span className="gradient-text">{t("titleHighlight")}</span>
          </h2>
          <p className="mx-auto mt-4 max-w-2xl text-lg text-slate-600">
            {t("subtitle")}
          </p>
        </div>

        <div className="mt-14 grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
          {days.map((d) => (
            <Link
              key={d.day}
              href={`/day/${d.day}`}
              className="card-hover group flex flex-col rounded-2xl border border-slate-100 bg-white p-5 shadow-sm transition-all hover:border-sky-200 hover:shadow-md"
            >
              <div className="flex items-center gap-3">
                <div
                  className={`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-xs font-bold text-white ${d.color}`}
                >
                  DAY {d.day}
                </div>
                <span className="text-xl">{d.icon}</span>
                <h3 className="text-base font-bold text-slate-900 group-hover:text-sky-600">
                  {t(`days.${d.day}.title`)}
                </h3>
              </div>
              <p className="mt-3 flex-1 text-sm leading-relaxed text-slate-600">
                {t(`days.${d.day}.desc`)}
              </p>
              <span className="mt-3 inline-flex items-center text-sm font-medium text-sky-600">
                {t("viewDetails")}
              </span>
            </Link>
          ))}
          <Link
            href="/ebook"
            className="card-hover group flex flex-col rounded-2xl border border-slate-100 bg-white p-5 shadow-sm transition-all hover:border-sky-200 hover:shadow-md"
          >
            <div className="flex items-center gap-3">
              <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gradient-to-r from-sky-500 to-cyan-500 text-xs font-bold text-white">
                📖
              </div>
              <h3 className="text-base font-bold text-slate-900 group-hover:text-sky-600">
                {t("ebook.title")}
              </h3>
            </div>
            <p className="mt-3 flex-1 text-sm leading-relaxed text-slate-600">
              {t("ebook.desc")}
            </p>
            <span className="mt-3 inline-flex items-center text-sm font-medium text-sky-600">
              {t("ebook.cta")}
            </span>
          </Link>
        </div>

        <div className="mt-16 overflow-hidden rounded-2xl border border-amber-200 bg-gradient-to-r from-amber-50 to-orange-50 p-8 text-center sm:p-10">
          <div className="mb-2 text-sm font-semibold text-amber-600">
            {t("course.tag")}
          </div>
          <h3 className="text-2xl font-bold text-slate-900">
            {t("course.title")}
          </h3>
          <p className="mx-auto mt-3 max-w-xl text-slate-600">
            {t("course.desc")}
          </p>
          <Link
            href="/course"
            className="mt-6 inline-flex items-center gap-2 rounded-full bg-amber-500 px-8 py-3 font-semibold text-white transition-colors hover:bg-amber-600"
          >
            {t("course.cta")}
          </Link>
        </div>
      </div>
    </section>
  );
}
