interface Props {
  open: boolean;
  title?: string;
  children: React.ReactNode;
  onClose: () => void;
}

export default function InfoModal({
  open,
  title = '정보',
  children,
  onClose,
}: Props) {
  if (!open) return null;

  return (
    <div className="fixed inset-0 z-50 flex items-center justify-center bg-wing-overlay" onClick={onClose}>
      <div
        className="bg-wing-surface rounded-xl shadow-2xl p-6 max-w-lg w-full mx-4"
        onClick={(e) => e.stopPropagation()}
      >
        <h3 className="text-lg font-semibold text-wing-text mb-4">{title}</h3>
        <div className="text-wing-muted text-sm mb-6">{children}</div>
        <div className="flex justify-end">
          <button
            onClick={onClose}
            className="px-4 py-2 text-sm font-medium text-wing-text bg-wing-card rounded-lg hover:bg-wing-hover transition-colors"
          >
            닫기
          </button>
        </div>
      </div>
    </div>
  );
}
