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 Hero = () => {
  const shouldReduce = useReducedMotion();
  
  if (shouldReduce) {
    return (
      <section className="relative h-screen flex items-center justify-start bg-cover bg-center" style={{
        backgroundImage: "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://www.bulls-bikes.com/media/image/bulls-grinder-3-hero-2026.jpg')"
      }}>
        <div className="container mx-auto px-4 pt-24">
          <div className="max-w-2xl">
            <h1 className="text-5xl md:text-6xl lg:text-7xl font-bold text-white mb-4 text-shadow">
              READY FOR 2026
            </h1>
            <h2 className="text-2xl md:text-3xl lg:text-4xl font-bold text-white mb-6 text-shadow">
              ONE OF OUR HIGHLIGHTS:
            </h2>
            <h3 className="text-6xl md:text-7xl lg:text-8xl font-bold text-white text-shadow">
              THE GRINDER 3
            </h3>
          </div>
        </div>
      </section>
    );
  }

  return (
    <motion.section 
      {...fadeUpPreset(0.1, 1.0)}
      className="relative h-screen flex items-center justify-start bg-cover bg-center" 
      style={{
        backgroundImage: "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://www.bulls-bikes.com/media/image/bulls-grinder-3-hero-2026.jpg')"
      }}
    >
      <div className="container mx-auto px-4 pt-24">
        <div className="max-w-2xl">
          <motion.h1 
            {...fadeUpPreset(0.2, 1.0)}
            className="text-5xl md:text-6xl lg:text-7xl font-bold text-white mb-4 text-shadow"
          >
            READY FOR 2026
          </motion.h1>
          <motion.h2 
            {...fadeUpPreset(0.4, 1.0)}
            className="text-2xl md:text-3xl lg:text-4xl font-bold text-white mb-6 text-shadow"
          >
            ONE OF OUR HIGHLIGHTS:
          </motion.h2>
          <motion.h3 
            {...fadeUpPreset(0.6, 1.0)}
            className="text-6xl md:text-7xl lg:text-8xl font-bold text-white text-shadow"
          >
            THE GRINDER 3
          </motion.h3>
        </div>
      </div>
    </motion.section>
  );
};

export default Hero;