import { Skeleton } from '@/components/ui/skeleton';

/**
 * Full app shell skeleton shown during initial auth loading.
 * Mimics the sidebar + topbar + content layout.
 */
export function AppShellSkeleton() {
  return (
    <div className="h-screen w-full flex bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 overflow-hidden">
      {/* Sidebar skeleton */}
      <div className="hidden md:flex w-60 flex-col border-r border-slate-800/50 bg-slate-900/30 p-4">
        {/* Logo */}
        <div className="flex items-center gap-3 mb-8">
          <Skeleton className="h-10 w-10 rounded-xl bg-slate-800" />
          <div className="space-y-1.5">
            <Skeleton className="h-4 w-24 bg-slate-800" />
            <Skeleton className="h-3 w-16 bg-slate-800" />
          </div>
        </div>

        {/* Nav items */}
        <div className="space-y-2">
          {[1, 2, 3, 4, 5, 6, 7, 8].map((i) => (
            <Skeleton key={i} className="h-10 w-full rounded-lg bg-slate-800" />
          ))}
        </div>

        {/* Bottom section */}
        <div className="mt-auto space-y-2">
          <Skeleton className="h-3 w-16 bg-slate-800" />
          <Skeleton className="h-10 w-full rounded-lg bg-slate-800" />
        </div>
      </div>

      {/* Main content area */}
      <div className="flex-1 flex flex-col min-w-0">
        {/* TopBar skeleton */}
        <div className="h-16 border-b border-slate-800/50 bg-slate-900/30 flex items-center justify-between px-4">
          <Skeleton className="h-10 w-64 rounded-lg bg-slate-800" />
          <div className="flex items-center gap-4">
            <Skeleton className="h-8 w-24 rounded-full bg-slate-800" />
            <Skeleton className="h-8 w-8 rounded-full bg-slate-800" />
            <Skeleton className="h-10 w-10 rounded-full bg-slate-800" />
          </div>
        </div>

        {/* Content skeleton */}
        <div className="flex-1 p-6 space-y-6">
          {/* Page header */}
          <div className="space-y-2">
            <Skeleton className="h-8 w-48 bg-slate-800" />
            <Skeleton className="h-4 w-72 bg-slate-800" />
          </div>

          {/* Content cards */}
          <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
            {[1, 2, 3].map((i) => (
              <div key={i} className="rounded-lg border border-slate-800/50 bg-slate-900/30 p-4 space-y-3">
                <Skeleton className="h-5 w-3/4 bg-slate-800" />
                <Skeleton className="h-4 w-full bg-slate-800" />
                <Skeleton className="h-4 w-5/6 bg-slate-800" />
              </div>
            ))}
          </div>
        </div>
      </div>
    </div>
  );
}
