import { motion } from 'framer-motion';
import type { ReactNode } from 'react';

type Props = {
  children: ReactNode;
  className?: string;
  hover?: boolean;
};

export function GlassCard({ children, className = '', hover = true }: Props) {
  return (
    <motion.div
      initial={{ opacity: 0, y: 16 }}
      whileInView={{ opacity: 1, y: 0 }}
      viewport={{ once: true, margin: '-40px' }}
      transition={{ duration: 0.5 }}
      whileHover={
        hover
          ? {
              y: -4,
              boxShadow: '0 0 40px rgba(34, 211, 238, 0.12), 0 0 0 1px rgba(34, 211, 238, 0.2)',
            }
          : undefined
      }
      className={`glass rounded-2xl p-6 md:p-8 border-glow transition-shadow duration-300 ${className}`}
    >
      {children}
    </motion.div>
  );
}
