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

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

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

  if (shouldReduceMotion) {
    return (
      <section className="relative h-screen flex items-center justify-start" style={{
        backgroundImage: "url('https://www.bulls-bikes.com/fileadmin/_processed_/2/8/csm_BULLS_Grinder_3_Lifestyle_2024_01_b5c8a5e5a7.jpg')",
        backgroundSize: 'cover',
        backgroundPosition: 'center',
        backgroundRepeat: 'no-repeat'
      }}>
        <div className="absolute inset-0 bg-black bg-opacity-40"></div>
        <div className="relative z-10 container-max">
          <div className="max-w-2xl">
            <h1 className="hero-text text-hero-sm md:text-hero mb-4">
              READY FOR 2026
            </h1>
            <h2 className="hero-text text-2xl md:text-4xl mb-6">
              ONE OF OUR HIGHLIGHTS:
            </h2>
            <h3 className="hero-text text-4xl md:text-6xl font-black">
              THE GRINDER 3
            </h3>
          </div>
        </div>
      </section>
    );
  }

  return (
    <motion.section 
      {...fadeUpPreset(0.1, 0.8)}
      className="relative h-screen flex items-center justify-start" 
      style={{
        backgroundImage: "url('https://www.bulls-bikes.com/fileadmin/_processed_/2/8/csm_BULLS_Grinder_3_Lifestyle_2024_01_b5c8a5e5a7.jpg')",
        backgroundSize: 'cover',
        backgroundPosition: 'center',
        backgroundRepeat: 'no-repeat'
      }}
    >
      <div className="absolute inset-0 bg-black bg-opacity-40"></div>
      <div className="relative z-10 container-max">
        <div className="max-w-2xl">
          <motion.h1 
            {...fadeUpPreset(0.2, 0.8)}
            className="hero-text text-hero-sm md:text-hero mb-4"
          >
            READY FOR 2026
          </motion.h1>
          <motion.h2 
            {...fadeUpPreset(0.4, 0.8)}
            className="hero-text text-2xl md:text-4xl mb-6"
          >
            ONE OF OUR HIGHLIGHTS:
          </motion.h2>
          <motion.h3 
            {...fadeUpPreset(0.6, 0.8)}
            className="hero-text text-4xl md:text-6xl font-black"
          >
            THE GRINDER 3
          </motion.h3>
        </div>
      </div>
    </motion.section>
  );
};

export default Hero;