import { motion } from "framer-motion";
import { ABOUT_ORG } from "@/data/event-data";
import communityImg from "@/assets/community.jpg";
import { Instagram, Facebook, Youtube } from "lucide-react";
import { useTranslation } from "react-i18next";

const maskStyle = "radial-gradient(196.7px at 50% 264px, rgb(0, 0, 0) 99%, rgba(0, 0, 0, 0) 101%) calc(50% - 176px) 0px / 352px 100%, radial-gradient(196.7px at 50% -176px, rgba(0, 0, 0, 0) 99%, rgb(0, 0, 0) 101%) 50% 78px / 352px 100% repeat-x";

const OrgSection = () => {
  const { t } = useTranslation();

  return (
    <section
      className="section-padding bg-card pb-20 md:pb-28 pt-[80px] md:pt-[100px] -mt-[32px] relative z-20"
      style={{ WebkitMask: maskStyle, mask: maskStyle }}
    >
      <div className="container mx-auto">
        <div className="grid md:grid-cols-2 gap-12 items-center">
          {/* Texto */}
          <motion.div
            initial={{ opacity: 0, y: 30 }}
            whileInView={{ opacity: 1, y: 0 }}
            viewport={{ once: false, amount: 0.15 }}
            transition={{ duration: 0.6 }}
          >
            <h2 className="font-display text-4xl md:text-5xl lg:text-7xl break-words font-bold pt-4 pb-6 leading-normal mb-6 text-gradient">
              {t("about.orgTitle")}
            </h2>
            <div className="space-y-4 text-muted-foreground leading-relaxed">
              <p className="whitespace-pre-line">{t("about.orgDescription")}</p>
            </div>

          {/* Redes sociales */}
          <div className="flex gap-4 mt-8">
            {ABOUT_ORG.socials.instagram && (
              <a
                href={ABOUT_ORG.socials.instagram}
                target="_blank"
                rel="noopener noreferrer"
                className="bg-gradient-tropical p-3 rounded-full hover:opacity-80 transition-opacity"
                aria-label="Instagram"
              >
                <Instagram className="w-5 h-5 text-primary-foreground" />
              </a>
            )}
            {ABOUT_ORG.socials.facebook && (
              <a
                href={ABOUT_ORG.socials.facebook}
                target="_blank"
                rel="noopener noreferrer"
                className="bg-gradient-tropical p-3 rounded-full hover:opacity-80 transition-opacity"
                aria-label="Facebook"
              >
                <Facebook className="w-5 h-5 text-primary-foreground" />
              </a>
            )}
            {ABOUT_ORG.socials.youtube && (
              <a
                href={ABOUT_ORG.socials.youtube}
                target="_blank"
                rel="noopener noreferrer"
                className="bg-gradient-tropical p-3 rounded-full hover:opacity-80 transition-opacity"
                aria-label="YouTube"
              >
                <Youtube className="w-5 h-5 text-primary-foreground" />
              </a>
            )}
          </div>
          </motion.div>

        {/* Imagen */}
        <motion.div
          initial={{ opacity: 0, y: 30 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: false, amount: 0.15 }}
          transition={{ duration: 0.6, delay: 0.2 }}
        >
          <img
            src={communityImg}
            alt="Comunidad ZoukLambadaBCN"
            className="rounded-2xl shadow-elevated w-full h-auto object-contain bg-muted"
          />
        </motion.div>
        </div>
      </div>
    </section>
  );
};

export default OrgSection;
