import { UserAuth } from './UserAuth';

interface HeaderProps {
  selectedBodyName?: string;
  bodyCount: number;
  user?: any;
  onOpenAuth?: () => void;
  onLogout?: () => void;
  onNavigateToAdmin?: () => void;
}

export function Header({ 
  selectedBodyName, 
  bodyCount,
  user,
  onOpenAuth,
  onLogout,
  onNavigateToAdmin
}: HeaderProps) {
  return (
    <header className="absolute top-0 left-0 right-0 z-50 pointer-events-none">
      <div className="px-6 py-4 bg-gradient-to-b from-black/90 via-black/60 to-transparent flex items-start justify-between">
        {/* Left: Branding */}
        <div className="flex items-center gap-4 pointer-events-auto inline-flex">
          <div className="flex items-center gap-3">
            <span className="text-4xl">🌌</span>
            <div>
              <h1 className="text-2xl font-bold text-white tracking-tight drop-shadow-md">Cosmo</h1>
              <p className="text-xs text-gray-400 font-medium tracking-wide">DEEP SPACE EXPLORER</p>
            </div>
          </div>

          {/* Status Info */}
          <div className="ml-4 px-3 py-1 bg-white/10 backdrop-blur-md rounded-full border border-white/10">
            <p className="text-xs text-gray-300">
              {selectedBodyName ? (
                <>
                  <span className="text-cyan-400 animate-pulse">●</span> 聚焦: <span className="text-white font-bold ml-1">{selectedBodyName}</span>
                </>
              ) : (
                <>
                  <span className="text-green-400">●</span> {bodyCount} 个天体在线
                </>
              )}
            </p>
          </div>
        </div>

        {/* Right: User Auth */}
        {onOpenAuth && (
          <UserAuth 
            user={user} 
            onOpenAuth={onOpenAuth} 
            onLogout={onLogout!} 
            onNavigateToAdmin={onNavigateToAdmin!} 
          />
        )}
      </div>
    </header>
  );
}