import React from 'react';

// Declare the Service interface here
interface Service {
  name: string;
  url: string;
  image: string;
  icon: string;
  description: string;
  features: string[];
}

// Define interface directly in the component file
interface ServicesSectionProps {
  services: Service[];
  onServiceClick: (service: Service) => void;
}

export const ServicesSection: React.FC<ServicesSectionProps> = ({ services, onServiceClick }) => (
  <section id="services" className="relative z-2 py-12 sm:py-16 md:py-20 w-full max-w-6xl mx-auto px-4 sm:px-6 md:px-8">
    <div className="w-20 h-1 bg-gradient-to-r from-banquise-blue-lightest to-banquise-blue mx-auto mb-6 sm:mb-8 rounded-full"></div>
    <h2 className="text-banquise-gray text-2xl sm:text-3xl md:text-4xl mb-4 sm:mb-6 text-center font-heading font-bold tracking-tight px-2" style={{ textShadow: '0 2px 4px rgba(0, 0, 0, 0.2)' }}>
      Nos Services
    </h2>
    <p className="text-banquise-gray text-lg sm:text-xl opacity-90 mb-12 sm:mb-14 md:mb-16 max-w-4xl text-center mx-auto leading-relaxed px-2" style={{ textShadow: '0 1px 3px rgba(0, 0, 0, 0.2)' }}>
      Cliquez sur un service pour découvrir toutes ses fonctionnalités
    </p>
    
    <div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6 sm:gap-8 w-full">
      {services.map((service) => (
        <div
          key={service.name}
          className="group relative bg-gradient-to-br from-banquise-blue-dark/10 to-banquise-blue-dark/5 backdrop-blur-lg rounded-2xl p-6 sm:p-8 border border-banquise-blue-lightest/30 transition-all duration-300 cursor-pointer hover:-translate-y-4 hover:shadow-2xl hover:border-banquise-blue-lightest/50 hover:from-banquise-blue-dark/15 hover:to-banquise-blue-dark/8 active:scale-95"
          onClick={() => onServiceClick(service)}
        >
          {/* Icon */}
          <div className="mb-6 sm:mb-8 w-20 h-20 sm:w-24 sm:h-24 bg-gradient-to-br from-banquise-blue to-banquise-blue-light rounded-2xl flex items-center justify-center text-3xl sm:text-4xl shadow-lg group-hover:scale-110 transition-transform duration-300 mx-auto">
            {service.icon}
          </div>
          
          {/* Service name */}
          <h3 className="text-xl sm:text-2xl font-bold text-banquise-gray mb-4 sm:mb-6 font-heading text-center group-hover:text-banquise-blue-lightest transition-colors duration-300">
            {service.name}
          </h3>
          
          {/* Short teaser description */}
          <p className="text-banquise-gray/80 leading-relaxed mb-6 sm:mb-8 text-center text-sm sm:text-base">
            {service.description.split('.')[0]}.
          </p>
          
          {/* CTA */}
          <div className="flex items-center justify-center text-banquise-blue-light font-bold group-hover:text-banquise-blue-lightest transition-colors duration-300 text-sm sm:text-base">
            <span className="text-center">Découvrir toutes les fonctionnalités</span>
            <span className="ml-2 text-lg transition-transform duration-300 group-hover:translate-x-2">→</span>
          </div>
          
          {/* Subtle hover effect */}
          <div className="absolute inset-0 bg-gradient-to-br from-banquise-blue-lightest/10 to-banquise-blue/5 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none"></div>
        </div>
      ))}
    </div>
  </section>
);
