import Image from 'next/image'

interface FullPageLoaderProps {
  message?: string
  variant?: 'light' | 'dark'
}

/**
 * FullPageLoader component that displays a centered loading screen
 * with the BALI RSV logo and optional message.
 */
export default function FullPageLoader({
  message = 'Loading...',
  variant = 'light',
}: FullPageLoaderProps) {
  const isDark = variant === 'dark'

  return (
    <div
      className={`fixed inset-0 z-50 flex items-center justify-center ${
        isDark ? 'bg-gray-900' : 'bg-white'
      }`}
    >
      <div className="text-center">
        {/* Logo */}
        <div className="mb-8">
          <Image
            src={
              isDark
                ? '/images/logo/balirsv-hs-white.png'
                : '/images/logo/balirsv-hs-blue.png'
            }
            alt="BALI RSV Logo"
            width={200}
            height={50}
            className="mx-auto opacity-90"
            priority
          />
        </div>

        {/* Loading Spinner */}
        <div className="mb-6">
          <div className="relative">
            <div className="loader mx-auto"></div>
          </div>
        </div>

        {/* Loading Message */}
        <div className={isDark ? 'text-gray-300' : 'text-gray-600'}>
          <p className="text-sm font-medium tracking-wide">{message}</p>
        </div>

        {/* BES Branding */}
        <div className="mt-8">
          <p
            className={`text-xs tracking-widest font-medium ${
              isDark ? 'text-gray-500' : 'text-gray-400'
            }`}
          >
            BOOKING ENGINE SYSTEM
          </p>
        </div>
      </div>
    </div>
  )
}
