import { X } from 'lucide-react';
import type { ReactNode } from 'react';

type SignInModalFrameProps = {
  onClose: () => void;
  children: ReactNode;
};

export function SignInModalFrame({ onClose, children }: SignInModalFrameProps) {
  return (
    <div className="fixed inset-0 z-50 flex items-center justify-center p-4">
      <div className="absolute inset-0 bg-black/60 backdrop-blur-sm" onClick={onClose} />
      <div className="relative w-full max-w-lg bg-slate-900 rounded-2xl shadow-2xl shadow-black/50 border border-slate-700/50 overflow-hidden animate-in fade-in zoom-in-95 duration-200">
        <div className="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-violet-500 via-amber-400 to-emerald-500" />
        <button
          type="button"
          onClick={onClose}
          className="absolute top-4 right-4 p-1.5 rounded-lg hover:bg-slate-800 text-slate-400 hover:text-white transition-colors z-10"
          aria-label="Close sign in dialog"
        >
          <X size={18} />
        </button>
        <div className="p-6 pt-8">{children}</div>
      </div>
    </div>
  );
}
