"use client";

import { motion } from "framer-motion";
import { Button } from "@/components/ui/button";
import { Heart, Users, Sparkles, Calendar } from "lucide-react";

const services = [
  {
    icon: Heart,
    title: "Terapia Individual",
    description:
      "Sesiones uno a uno enfocadas en ansiedad, depresión, trauma o crecimiento personal.",
    image: "/services/icons/t_ind.png",
    duration: "60 min",
    modalidad: "Presencial o Virtual",
  },
  {
    icon: Users,
    title: "Terapia de Pareja",
    description: "Espacios para mejorar la comunicación, resolver conflictos y reconectar.",
    image: "/services/icons/t_pareja.png",
    duration: "60-90 min",
    modalidad: "Presencial o Virtual",
  },
  {
    icon: Sparkles,
    title: "Talleres y Grupos",
    description: "Experiencias colectivas de sanación y aprendizaje emocional.",
    image: "/services/icons/t_fam.png",
    duration: "2-3 horas",
    modalidad: "Presencial",
  },
  {
    icon: Calendar,
    title: "Crisis y Emergencia",
    description: "Atención inmediata para situaciones de crisis emocional.",
    image: "/services/icons/t_ind.png",
    duration: "Variable",
    modalidad: "Virtual",
  },
];

export default function ServicesPage() {
  return (
    <div className="min-h-screen bg-background">
      <div className="container mx-auto px-4 py-12 sm:px-6 lg:px-8">
        <motion.div
          className="mb-12 text-center"
          initial={{ opacity: 0, y: -20 }}
          animate={{ opacity: 1, y: 0 }}
          transition={{ duration: 0.6 }}
        >
          <h1 className="mb-4 font-serif text-4xl font-bold text-primary sm:text-5xl">Servicios</h1>
          <p className="mx-auto max-w-2xl text-lg text-secondary">
            Ofrezco distintos enfoques terapéuticos adaptados a tus necesidades
          </p>
          <motion.div
            className="mx-auto h-1 w-24 bg-accent"
            initial={{ width: 0 }}
            animate={{ width: 96 }}
            transition={{ duration: 0.8, delay: 0.3 }}
          />
        </motion.div>

        <div className="grid gap-8 md:grid-cols-2 lg:gap-12">
          {services.map((service, index) => {
            const Icon = service.icon;
            return (
              <motion.div
                key={service.title}
                initial={{ opacity: 0, y: 30 }}
                animate={{ opacity: 1, y: 0 }}
                transition={{ duration: 0.6, delay: index * 0.1 }}
              >
                <motion.div
                  whileHover={{ y: -8 }}
                  transition={{ type: "spring", stiffness: 300, damping: 20 }}
                >
                  <div className="rounded-2xl border-t-4 border-t-accent bg-white shadow-lg transition-shadow hover:shadow-xl">
                    <div className="p-8">
                      <div className="mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-background">
                        <img
                          src={service.image}
                          alt={service.title}
                          className="h-12 w-12 object-contain"
                        />
                      </div>

                      <h3 className="mb-3 text-center font-serif text-2xl font-semibold text-primary">
                        {service.title}
                      </h3>

                      <p className="mb-6 text-center leading-relaxed text-secondary">
                        {service.description}
                      </p>

                      <div className="space-y-3">
                        <div className="flex items-center justify-between border-b py-3">
                          <span className="text-sm font-medium text-primary">Duración</span>
                          <span className="text-sm text-secondary">{service.duration}</span>
                        </div>
                        <div className="flex items-center justify-between border-b py-3">
                          <span className="text-sm font-medium text-primary">Modalidad</span>
                          <span className="text-sm text-secondary">{service.modalidad}</span>
                        </div>
                        <div className="flex items-center justify-between py-3">
                          <span className="text-sm font-medium text-primary">Inversión</span>
                          <span className="text-sm font-semibold text-accent">Variable</span>
                        </div>
                      </div>

                      <Button
                        onClick={() => {
                          const element = document.querySelector("#agendar");
                          if (element) element.scrollIntoView({ behavior: "smooth" });
                        }}
                        className="mt-6 w-full bg-accent text-primary hover:bg-accent/90"
                      >
                        Agendar Sesión
                      </Button>
                    </div>
                  </div>
                </motion.div>
              </motion.div>
            );
          })}
        </div>

        <motion.div
          className="mt-12 rounded-2xl bg-white p-8 shadow-lg"
          initial={{ opacity: 0, y: 30 }}
          animate={{ opacity: 1, y: 0 }}
          transition={{ duration: 0.6, delay: 0.4 }}
        >
          <h2 className="mb-4 font-serif text-2xl font-bold text-primary">
            ¿Tienes dudas sobre qué servicio es para ti?
          </h2>
          <p className="mb-6 text-secondary">
            Agenda una sesión de evaluación gratuita para que podamos identificar juntos tus
            necesidades y definir el mejor camino de sanación.
          </p>
          <Button
            size="lg"
            onClick={() => {
              const element = document.querySelector("#agendar");
              if (element) element.scrollIntoView({ behavior: "smooth" });
            }}
            className="w-full bg-primary text-white hover:bg-primary/90 sm:w-auto"
          >
            Agenda tu Sesión de Evaluación
          </Button>
        </motion.div>
      </div>
    </div>
  );
}
