'use client'

import { motion } from 'framer-motion'

interface CTAButtonProps {
  children: React.ReactNode
  variant?: 'primary' | 'ghost'
  href?: string
  className?: string
  onClick?: () => void
}

export default function CTAButton({ children, variant = 'primary', href, className = '', onClick }: CTAButtonProps) {
  const baseClass = 'inline-flex items-center gap-2 px-6 py-3 rounded-xl font-semibold text-sm transition-all duration-200'

  const variantClass = variant === 'primary'
    ? 'bg-accent-electric text-white glow-blue hover:bg-blue-500'
    : 'border border-white/[0.12] text-white/80 hover:bg-white/[0.06] hover:text-white'

  const Component = href ? motion.a : motion.button

  return (
    <Component
      href={href}
      onClick={onClick}
      whileHover={{ scale: 1.03 }}
      whileTap={{ scale: 0.97 }}
      className={`${baseClass} ${variantClass} ${className}`}
    >
      {children}
    </Component>
  )
}
