'use client';

import { useTranslator } from '@/contexts/TranslatorContext';
import HeroSection from '@/components/HeroSection/HeroSection';
import Pricing from '@/components/FullServers/Pricing';
import Features from '@/components/FullServers/Features';
import BenefitsSection from '@/components/Programmers/BenefitsSection';
import Asks from '@/components/DataCenter/Asks/Asks';
import { motion } from 'framer-motion';

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

  // Fallback values to ensure content always displays
  const heroTitle = translations?.['full_servers']?.['hero']?.['title'] || 
                    translations?.['full_servers.hero.title'] || 
                    'السيرفرات الكاملة المخصصة';
  const heroDescription = translations?.['full_servers']?.['hero']?.['description'] || 
                          translations?.['full_servers.hero.description'] || 
                          'احصل على أداء استثنائي وموارد مخصصة بالكامل لمشروعك مع سيرفراتنا الكاملة، مما يمنحك التحكم الكامل والمرونة التي تحتاجها للنمو.';
  const heroButton = translations?.['full_servers']?.['hero']?.['button'] || 
                     translations?.['full_servers.hero.button'] || 
                     'ابدأ الآن';

  return (
    <div className='overflow-x-hidden w-full' style={{ minWidth: '100vw', width: '100%' }}>
      <HeroSection
        title={heroTitle}
        description={heroDescription}
        primaryButtonText={heroButton}
        imageLeft='/images/Hero/full-servers/left-server.svg'
        imageLeftClass='[translate:-5px_-270px] z-[999]'
        imageCenter='/images/Hero/full-servers/center-server.svg'
        imageCenterClass='[translate:-110px_180px] z-[999]'
        imageRight='/images/Hero/full-servers/right-server.svg'
        imageRightClass='[translate:-40px_-70px] z-[999]'
        centerIconSrc='/images/Hero/full-servers/center-icon.svg'
        centerIconX={640}
        centerIconY={510}
        centerIconWidth={240}
        centerIconHeight={240}
        centerIconSrcClass='z-[1000] animate-float'
        leftIconSrc='/images/Hero/full-servers/left-icon.svg'
        leftIconX={370}
        leftIconY={680}
        leftIconWidth={164}
        leftIconHeight={168}
        leftIconSrcClass='z-[1000] animate-float animate-float-delay-2'
        rightIconSrc='/images/Hero/full-servers/right-icon.svg'
        rightIconX={980}
        rightIconY={670}
        rightIconWidth={164}
        rightIconHeight={168}
        rightIconSrcClass='z-[1000] animate-float animate-float-delay-1'
        mobileImage1Style={{ width: '40%' }}
      />
      <motion.div
        className='-mt-12 sm:-mt-24 md:-mt-32 relative z-10'
        initial={{ opacity: 0 }}
        whileInView={{ opacity: 1 }}
        transition={{ duration: 0.6 }}
        viewport={{ once: true, margin: '-50px' }}>
        <Pricing />
      </motion.div>
      <Features />
      <motion.div
        initial={{ opacity: 0 }}
        whileInView={{ opacity: 1 }}
        transition={{ duration: 0.6 }}
        viewport={{ once: true, margin: '-50px' }}>
        <BenefitsSection
          benefitsKeyPrefix="full_servers"
          customTitle={
            translations?.['full_servers']?.['benefits_title'] ||
            translations?.['full_servers.benefits_title'] ||
            translations?.['cloud_hosting.some_features'] ||
            'بعض الخصائص والمميزات'
          }
        />
      </motion.div>
      <motion.div
        initial={{ opacity: 0 }}
        whileInView={{ opacity: 1 }}
        transition={{ duration: 0.6 }}
        viewport={{ once: true, margin: '-50px' }}>
        <Asks faqsKey='full_servers.faqs' />
      </motion.div>
    </div>
  );
};

export default FullServersPage;
