'use client';

import { useTranslator } from '@/contexts/TranslatorContext';
import Image from 'next/image';

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

  const features = [
    {
      icon: (
        <Image
          src='/images/icon/email-service.svg'
          alt='Email Overview'
          width={40}
          height={40}
          className='w-8 h-8 sm:w-9 sm:h-9 md:w-10 md:h-10 object-contain'
        />
      ),
      title: translations['featureEmailOverviewTitle'],
      description: translations['featureEmailOverviewDescription'],
    },
    {
      icon: (
        <Image
          src='/images/icon/Phishing.svg'
          alt='Top Threats'
          width={40}
          height={40}
          className='w-8 h-8 sm:w-9 sm:h-9 md:w-10 md:h-10 object-contain'
        />
      ),
      title: translations['featureTopThreatsTitle'],
      description: translations['featureTopThreatsDescription'],
    },
    {
      icon: (
        <Image
          src='/images/icon/security.svg'
          alt='SPF and DKIM'
          width={40}
          height={40}
          className='w-8 h-8 sm:w-9 sm:h-9 md:w-10 md:h-10 object-contain'
        />
      ),
      title: translations['featureSPFDKIMTitle'],
      description: translations['featureSPFDKIMDescription'],
    },
    {
      icon: (
        <Image
          src='/images/icon/trust.svg'
          alt='PowerDMARC Platform'
          width={40}
          height={40}
          className='w-8 h-8 sm:w-9 sm:h-9 md:w-10 md:h-10 object-contain'
        />
      ),
      title: translations['featurePowerDMARCPlatformTitle'],
      description: translations['featurePowerDMARCPlatformDescription'],
    },
  ];

  return (
    <section className='w-full -mt-10 md:-mt-14 lg:-mt-16 py-12 md:py-20 lg:py-24 bg-white'>
      <div className='container px-4 sm:px-6 lg:px-8 mx-auto'>
        {/* Header */}
        <div className='flex flex-col items-center text-center space-y-2 mb-8'>
          <h2 className='text-xl sm:text-2xl md:text-3xl font-semibold text-[#2B1F51]'>
            {translations['overviewMainTitle']}
          </h2>
          <p className='text-[11px] sm:text-xs md:text-sm max-w-[680px] text-gray-600 leading-relaxed'>
            {translations['overviewMainDescription']}
          </p>
        </div>

        {/* Features Grid */}
        <div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 md:gap-10'>
          {features.map((feature, index) => (
            <div
              key={index}
              className='flex flex-col items-center text-center space-y-1.5'>
              <div className='flex items-center justify-center'>
                {feature.icon}
              </div>
              <h3 className='text-xs sm:text-sm md:text-base font-semibold text-[#2B1F51]'>
                {feature.title}
              </h3>
              <p className='text-[10px] sm:text-[11px] md:text-xs text-gray-600 leading-relaxed max-w-[200px]'>
                {feature.description}
              </p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
};

export default OverviewSection;
