'use client';

import { usePathname } from 'next/navigation';
import { SubsectionNav } from '@/components/shared/SubsectionNav';

const navItems = [
  { label: 'Master Key', href: '/admin/master/' },
  { label: 'API Keys', href: '/admin/apikeys/' },
];

export default function AdminLayout({ children }: { children: React.ReactNode }) {
  const pathname = usePathname();

  return (
    <div className="min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950">
      {/* Animated gradient background */}
      <div className="fixed inset-0 overflow-hidden pointer-events-none">
        <div className="absolute top-1/4 -left-1/4 w-96 h-96 bg-purple-600/10 rounded-full blur-3xl animate-pulse"></div>
        <div className="absolute bottom-1/4 -right-1/4 w-96 h-96 bg-cyan-600/10 rounded-full blur-3xl animate-pulse delay-700"></div>
      </div>

      {/* Subsection Navigation */}
      <SubsectionNav items={navItems} currentPath={pathname} />

      {/* Page Content */}
      <div className="relative z-10">{children}</div>
    </div>
  );
}
