"use client";

import { Skeleton } from "@/components/ui/skeleton";
import { Button } from "@/components/ui/button";
import { ArrowLeft } from "lucide-react";
import Link from "next/link";
import { PACKAGE_DETAIL } from "@/lib/strings";

/**
 * Reusable skeleton for the package detail page (gallery + tabs + booking sidebar).
 */
export function PackageDetailSkeleton() {
  return (
    <div className="min-h-screen bg-gradient-to-br from-purple-50 via-white to-blue-50">
      <main className="container mx-auto p-4 md:p-6 lg:p-8">
        <div className="mb-6">
          <Button variant="outline" asChild className="gap-2 bg-transparent">
            <Link href="/fixed-packages">
              <ArrowLeft className="h-4 w-4" />
              {PACKAGE_DETAIL.BACK_TO_PACKAGES}
            </Link>
          </Button>
        </div>

        <div className="grid grid-cols-1 gap-6 lg:grid-cols-[7fr_3fr]">
          <div className="min-w-0 space-y-6 order-1">
            <div className="rounded-xl border border-gray-200 bg-white shadow-lg overflow-hidden">
              <div className="flex items-center justify-between px-4 md:px-6 py-3">
                <Skeleton className="h-7 w-2/3" />
                <Skeleton className="h-7 w-24 rounded" />
              </div>
              <div className="grid grid-cols-1 lg:grid-cols-[1.4fr_1fr] gap-2 p-4 pt-2 md:p-6 md:pt-2">
                <Skeleton className="w-full min-h-[280px] md:min-h-[360px] rounded-xl" />
                <div className="grid grid-cols-2 grid-rows-2 gap-2 min-h-[280px] lg:min-h-[360px]">
                  <Skeleton className="rounded-xl" />
                  <Skeleton className="rounded-xl" />
                  <Skeleton className="rounded-xl" />
                  <Skeleton className="rounded-xl" />
                </div>
              </div>
            </div>

            <div className="rounded-xl border border-gray-200 bg-white shadow-lg overflow-hidden">
              <div className="flex gap-0 border-b border-gray-200 px-4 py-3">
                <Skeleton className="h-8 w-20" />
                <Skeleton className="h-8 w-20 ml-4" />
                <Skeleton className="h-8 w-20 ml-4" />
                <Skeleton className="h-8 w-16 ml-4" />
                <Skeleton className="h-8 w-28 ml-4" />
              </div>
              <div className="p-4 md:p-6 space-y-4">
                <Skeleton className="h-24 w-full rounded-xl" />
                <div className="flex gap-4">
                  <Skeleton className="h-10 w-20 rounded-lg" />
                  <Skeleton className="h-10 w-20 rounded-lg" />
                  <Skeleton className="h-10 w-20 rounded-lg" />
                </div>
                <Skeleton className="h-20 w-full rounded-xl" />
                <Skeleton className="h-20 w-full rounded-xl" />
              </div>
            </div>
          </div>

          <div className="order-2 space-y-6">
            <div className="hidden lg:block rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden">
              <div className="flex items-center justify-between px-4 py-4">
                <Skeleton className="h-5 w-24" />
                <Skeleton className="h-8 w-32" />
              </div>
            </div>

            <div className="rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden">
              <div className="flex items-center justify-between border-b border-gray-100 px-4 py-3">
                <Skeleton className="h-6 w-40" />
                <Skeleton className="h-8 w-32 rounded" />
              </div>
              <div className="p-4 space-y-4">
                <Skeleton className="h-16 w-full rounded-xl" />
                <Skeleton className="h-16 w-full rounded-xl" />
              </div>
            </div>

            <div className="rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden">
              <div className="border-b border-gray-100 px-4 py-3">
                <Skeleton className="h-6 w-40" />
              </div>
              <div className="p-4 space-y-4">
                <Skeleton className="h-10 w-full rounded" />
                <Skeleton className="h-4 w-full" />
                <Skeleton className="h-4 w-full" />
                <Skeleton className="h-4 w-2/3" />
                <div className="border-t border-gray-200 pt-4">
                  <Skeleton className="h-6 w-full" />
                </div>
                <Skeleton className="h-12 w-full rounded-lg" />
              </div>
            </div>
          </div>
        </div>
      </main>
    </div>
  );
}
