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

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

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

  if (shouldReduceMotion) {
    return (
      <section className="section-padding bg-gray-50">
        <div className="container-custom">
          <div className="text-center mb-16">
            <h2 className="text-4xl md:text-5xl font-bold text-gray-900 mb-4">
              Explore our services
            </h2>
          </div>
          
          <div className="grid md:grid-cols-2 gap-16 items-center">
            {/* Web Development */}
            <div>
              <h3 className="text-2xl font-bold text-gray-900 mb-4">Web Development</h3>
              <p className="text-gray-600 mb-6">
                Modern, responsive websites built with cutting-edge technologies. 
                From simple landing pages to complex web applications.
              </p>
              <div className="w-full h-64 bg-gradient-to-br from-blue-100 to-purple-100 rounded-2xl flex items-center justify-center">
                <div className="text-6xl">🌐</div>
              </div>
            </div>
            
            {/* Mobile Development */}
            <div>
              <h3 className="text-2xl font-bold text-gray-900 mb-4">Mobile Development</h3>
              <p className="text-gray-600 mb-6">
                Native and cross-platform mobile applications that deliver 
                exceptional user experiences on iOS and Android.
              </p>
              <div className="w-full h-64 bg-gradient-to-br from-green-100 to-blue-100 rounded-2xl flex items-center justify-center">
                <div className="text-6xl">📱</div>
              </div>
            </div>
          </div>
          
          <div className="mt-16 text-center">
            <div className="bg-white rounded-2xl p-8 shadow-lg max-w-2xl mx-auto">
              <h3 className="text-xl font-semibold text-gray-900 mb-4">
                Get the same high-quality service for a smaller task
              </h3>
              <p className="text-gray-600">
                Whether you need a quick fix or a complete overhaul, 
                we bring the same level of expertise to every project.
              </p>
            </div>
          </div>
        </div>
      </section>
    );
  }

  return (
    <motion.section 
      {...fadeUpPreset(0.1, 0.8)}
      className="section-padding bg-gray-50"
    >
      <div className="container-custom">
        <motion.div 
          {...fadeUpPreset(0.2, 0.6)}
          className="text-center mb-16"
        >
          <h2 className="text-4xl md:text-5xl font-bold text-gray-900 mb-4">
            Explore our services
          </h2>
        </motion.div>
        
        <div className="grid md:grid-cols-2 gap-16 items-center">
          {/* Web Development */}
          <motion.div {...fadeUpPreset(0.3, 0.8)}>
            <h3 className="text-2xl font-bold text-gray-900 mb-4">Web Development</h3>
            <p className="text-gray-600 mb-6">
              Modern, responsive websites built with cutting-edge technologies. 
              From simple landing pages to complex web applications.
            </p>
            <div className="w-full h-64 bg-gradient-to-br from-blue-100 to-purple-100 rounded-2xl flex items-center justify-center">
              <div className="text-6xl">🌐</div>
            </div>
          </motion.div>
          
          {/* Mobile Development */}
          <motion.div {...fadeUpPreset(0.4, 0.8)}>
            <h3 className="text-2xl font-bold text-gray-900 mb-4">Mobile Development</h3>
            <p className="text-gray-600 mb-6">
              Native and cross-platform mobile applications that deliver 
              exceptional user experiences on iOS and Android.
            </p>
            <div className="w-full h-64 bg-gradient-to-br from-green-100 to-blue-100 rounded-2xl flex items-center justify-center">
              <div className="text-6xl">📱</div>
            </div>
          </motion.div>
        </div>
        
        <motion.div 
          {...fadeUpPreset(0.5, 0.8)}
          className="mt-16 text-center"
        >
          <div className="bg-white rounded-2xl p-8 shadow-lg max-w-2xl mx-auto">
            <h3 className="text-xl font-semibold text-gray-900 mb-4">
              Get the same high-quality service for a smaller task
            </h3>
            <p className="text-gray-600">
              Whether you need a quick fix or a complete overhaul, 
              we bring the same level of expertise to every project.
            </p>
          </div>
        </motion.div>
      </div>
    </motion.section>
  );
};

export default Services;