import { CheckCircle2 } from 'lucide-react';

import type { SignInModalState } from '@/components/sign-in-modal/types';

type SignInModalHeaderProps = {
  state: SignInModalState;
};

export function SignInModalHeader({ state }: SignInModalHeaderProps) {
  const { mode, signupStep } = state;

  return (
    <div className="text-center mb-6">
      <div className="w-14 h-14 rounded-2xl bg-gradient-to-br from-violet-500 to-amber-400 flex items-center justify-center mx-auto mb-3 shadow-lg shadow-violet-500/30">
        <span className="text-white font-bold text-xl">F</span>
      </div>
      {mode === 'signin' ? (
        <>
          <h2 className="text-xl font-bold text-white">Welcome Back</h2>
          <p className="text-sm text-slate-400 mt-1">Sign in to access your campus dashboard</p>
        </>
      ) : (
        <>
          <h2 className="text-xl font-bold text-white">
            {signupStep === 1 && 'Create Your Account'}
            {signupStep === 2 && 'Select Your Role'}
            {signupStep === 3 && 'Choose Your Campus'}
          </h2>
          <p className="text-sm text-slate-400 mt-1">
            {signupStep === 1 && 'Enter your credentials to get started'}
            {signupStep === 2 && 'What is your position?'}
            {signupStep === 3 && 'Select your campus mascot'}
          </p>
          <div className="flex items-center justify-center gap-2 mt-4">
            {[1, 2, 3].map((step) => (
              <div key={step} className="flex items-center gap-2">
                <div className={`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300 ${
                  signupStep >= step
                    ? 'bg-gradient-to-r from-violet-500 to-amber-500 text-white shadow-lg shadow-violet-500/30'
                    : 'bg-slate-800 text-slate-500 border border-slate-700'
                }`}>
                  {signupStep > step ? <CheckCircle2 size={14} /> : step}
                </div>
                {step < 3 && (
                  <div className={`w-8 h-0.5 rounded-full transition-all duration-300 ${
                    signupStep > step ? 'bg-violet-500' : 'bg-slate-700'
                  }`} />
                )}
              </div>
            ))}
          </div>
        </>
      )}
    </div>
  );
}
