const Input = ({
  type = 'text',
  label,
  placeholder,
  value,
  onChange,
  error,
  disabled = false,
  required = false,
  className = '',
  ...props
}) => {
  return (
    <div className={`w-full ${className}`}>
      {label && (
        <label className="block text-lg font-black text-[#111827] mb-2 tracking-tight">
          {label}
          {required && <span className="text-[#E74C3C] ml-1">*</span>}
        </label>
      )}

      <input
        type={type}
        placeholder={placeholder}
        value={value}
        onChange={onChange}
        disabled={disabled}
        className={`
          w-full px-5 py-4 rounded-xl border-2 transition-all duration-200 font-bold text-lg
          bg-white text-[#111827] placeholder-gray-400
          ${error
            ? 'border-[#E74C3C] focus:border-[#C0392B]'
            : 'border-gray-200 focus:border-[#409CA4]'
          }
          disabled:opacity-50 disabled:cursor-not-allowed
          focus:outline-none focus:ring-4 focus:ring-opacity-10
          ${error ? 'focus:ring-[#E74C3C]' : 'focus:ring-[#409CA4]'}
          hover:border-[#409CA4]/60 transition-colors
        `}
        {...props}
      />

      {error && (
        <p className="text-[#E74C3C] text-sm mt-1 font-medium">{error}</p>
      )}
    </div>
  )
}

export default Input
