'use client';

import { useTranslator } from '@/contexts/TranslatorContext';
import { Card } from '@/components/ui/card';
import { Award, MailX, MailCheck, Bug } from 'lucide-react';

const WhyChooseUs = () => {
  const { translations } = useTranslator();

  const features = [
    {
      icon: Award,
      title: translations['featureBrandReputationTitle'],
      description: translations['featureBrandReputationDesc'],
    },
    {
      icon: MailX,
      title: translations['featureUnauthorizedEmailTitle'],
      description: translations['featureUnauthorizedEmailDesc'],
    },
    {
      icon: MailCheck,
      title: translations['featureEmailDeliverabilityTitle'],
      description: translations['featureEmailDeliverabilityDesc'],
    },
    {
      icon: Bug,
      title: translations['featureRealTimeThreatMonitoringTitle'],
      description: translations['featureRealTimeThreatMonitoringDesc'],
    },
  ];

  return (
    <section className='w-full py-12 md:py-24 lg:py-32 bg-white'>
      <div
        className='container px-4 md:px-6 relative z-10 h-full w-full'
        style={{
          backgroundImage: 'url("/images/geometric-pattern.png")',
          backgroundSize: 'contain',
          backgroundPosition: 'left top',
          backgroundRepeat: 'no-repeat',
        }}>
        <div
          className='container px-4 md:px-6 relative z-10 h-32 w-64 ml-auto'
          style={{
            backgroundImage: 'url("/images/geometric-pattern.png")',
            backgroundSize: 'contain',
            backgroundPosition: 'right top',
            backgroundRepeat: 'no-repeat',
          }}></div>

        <div className='flex flex-col items-center justify-center space-y-4 text-center mb-12'>
          <h2 className='text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl text-[#2B1F51]'>
            {translations['whyChooseUsTitle']}
          </h2>
        </div>

        <div className='grid gap-6 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2'>
          {features.map((feature, index) => (
            <Card
              key={index}
              className='card-hover flex flex-col items-end p-6 rounded-xl shadow-md text-right'>
              <div className='flex items-center justify-center w-12 h-12 rounded-full bg-v0-blue-light mb-4'>
                <feature.icon className='w-12 h-12 text-blue-600' />
              </div>
              <h3 className='text-xl font-bold text-v0-blue-dark mb-2'>
                {feature.title}
              </h3>
              <p className='text-muted-foreground'>{feature.description}</p>
            </Card>
          ))}
        </div>
      </div>
    </section>
  );
};

export default WhyChooseUs;
