import React from 'react';
import { motion, useReducedMotion } from 'framer-motion';

const fadeUpPreset = (delay = 0, duration = 0.8) => ({
  initial: { opacity: 0, y: 20 },
  whileInView: { opacity: 1, y: 0 },
  viewport: { once: true, amount: 0.3 },
  transition: { delay, duration, ease: "easeOut" }
});

const EnterpriseSection = () => {
  const shouldReduceMotion = useReducedMotion();

  if (shouldReduceMotion) {
    return (
      <section className="section-padding bg-nest-red text-white relative overflow-hidden">
        <div className="absolute left-0 top-0 w-1/3 h-full opacity-20">
          <div className="w-full h-full bg-gradient-to-r from-white/10 to-transparent"></div>
        </div>
        
        <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
          <div className="max-w-3xl ml-auto">
            <h2 className="text-4xl md:text-5xl font-bold mb-6">
              The open source platform designed for the future. Build enterprise.
            </h2>
            <p className="text-xl text-red-100 mb-8 leading-relaxed">
              A complete development kit for building scalable server-side apps. Contact us to find out more about expertise consulting, on-site enterprise support, trainings, and private sessions.
            </p>
            <button className="bg-white text-nest-red px-8 py-3 rounded-full font-medium hover:bg-gray-100 transition-colors">
              Learn more about support offerings
            </button>
          </div>
        </div>
      </section>
    );
  }

  return (
    <motion.section 
      {...fadeUpPreset(0.1, 1.0)}
      className="section-padding bg-nest-red text-white relative overflow-hidden"
    >
      <div className="absolute left-0 top-0 w-1/3 h-full opacity-20">
        <div className="w-full h-full bg-gradient-to-r from-white/10 to-transparent"></div>
      </div>
      
      <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
        <motion.div 
          {...fadeUpPreset(0.2, 0.8)}
          className="max-w-3xl ml-auto"
        >
          <h2 className="text-4xl md:text-5xl font-bold mb-6">
            The open source platform designed for the future. Build enterprise.
          </h2>
          <p className="text-xl text-red-100 mb-8 leading-relaxed">
            A complete development kit for building scalable server-side apps. Contact us to find out more about expertise consulting, on-site enterprise support, trainings, and private sessions.
          </p>
          <button className="bg-white text-nest-red px-8 py-3 rounded-full font-medium hover:bg-gray-100 transition-colors">
            Learn more about support offerings
          </button>
        </motion.div>
      </div>
    </motion.section>
  );
};

export default EnterpriseSection;