import React from 'react';

interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
  size?: 'sm' | 'md' | 'lg';
}

export function Button({ children, variant = 'primary', size = 'md', className = "", ...props }: ButtonProps) {
  const base = "inline-flex items-center justify-center font-semibold rounded-xl transition-all focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed";
  
  const variants = {
    primary: "bg-rima-primary text-white hover:opacity-90 shadow-lg shadow-rima-primary/20",
    secondary: "bg-rima-surface border border-rima-border text-rima-text hover:bg-rima-border/50",
    danger: "bg-rima-danger/10 text-rima-danger hover:bg-rima-danger/20 border border-rima-danger/20",
    ghost: "bg-transparent text-rima-muted hover:text-rima-text hover:bg-rima-surface",
  };

  const sizes = {
    sm: "px-3 py-1.5 text-xs",
    md: "px-4 py-2.5 text-sm",
    lg: "px-6 py-3 text-base",
  };

  return (
    <button className={`${base} ${variants[variant]} ${sizes[size]} ${className}`} {...props}>
      {children}
    </button>
  );
}
