/**
 * FinalCTA.jsx - Afsluitende call-to-action sectie
 *
 * Coral-500 achtergrond met witte tekst.
 * Bevat datum, locatie en CTA button die naar Mollie betaalpagina linkt.
 */

import { Link } from 'react-router-dom';
import { PAYMENT_CONFIG } from '../config/payment';
import { WORKSHOP_CONFIG } from '../config/workshop';

function FinalCTA() {
  const { availableSpots, isSoldOut, date, dateShort, timeStart, timeEnd, location, maxParticipants, email } = WORKSHOP_CONFIG;

  return (
    <section className="py-16 lg:py-24 bg-coral-500 relative overflow-hidden">
      {/* Decoratieve elementen */}
      <div
        className="absolute top-0 left-0 w-64 h-64 bg-coral-400 rounded-full blur-3xl opacity-50"
        aria-hidden="true"
      />
      <div
        className="absolute bottom-0 right-0 w-96 h-96 bg-coral-600 rounded-full blur-3xl opacity-30"
        aria-hidden="true"
      />

      <div className="container-page relative">
        <div className="max-w-3xl mx-auto text-center">
          {/* Headline */}
          <h2 className="font-display text-3xl md:text-4xl font-bold text-white mb-6">
            Op {dateShort} werk je anders
          </h2>

          {/* Closing text */}
          <p className="text-xl text-coral-100 mb-8 leading-relaxed">
            De volgende workshop is op{' '}
            <span className="text-white font-semibold">{date}</span>
            {' '}in {location}. We starten om {timeStart}, rond {timeEnd} ga je naar huis met
            je eigen werkende project.
          </p>

          {/* Highlights */}
          <div className="flex flex-wrap justify-center gap-6 mb-10 text-coral-100">
            <div className="flex items-center gap-2">
              <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" />
              </svg>
              <span>Maximaal {maxParticipants} deelnemers per workshop</span>
            </div>
            <div className="flex items-center gap-2 font-semibold text-white">
              <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
              </svg>
              <span>Er zijn nog {availableSpots} {availableSpots === 1 ? 'plek' : 'plekken'} beschikbaar</span>
            </div>
            <div className="flex items-center gap-2">
              <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
              </svg>
              <span>Persoonlijke begeleiding</span>
            </div>
            <div className="flex items-center gap-2">
              <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
              </svg>
              <span>Handen uit de mouwen</span>
            </div>
          </div>

          {/* CTA Button - naar inschrijfpagina of wachtlijst */}
          <Link
            to={isSoldOut ? PAYMENT_CONFIG.WAITLIST_URL : PAYMENT_CONFIG.SIGNUP_URL}
            className="inline-flex items-center gap-2 px-8 py-4 bg-white text-coral-600 font-semibold text-lg rounded-xl shadow-lg hover:bg-coral-50 hover:shadow-xl active:bg-coral-100 transition-all duration-200"
          >
            {isSoldOut ? 'Zet me op de wachtlijst' : `Doe mee op ${dateShort}`}
            <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 8l4 4m0 0l-4 4m4-4H3" />
            </svg>
          </Link>

          {/* Contact info */}
          <p className="mt-8 text-coral-200">
            Vragen? Mail naar{' '}
            <a href={`mailto:${email}`} className="text-white underline hover:no-underline">
              Frank
            </a>
            . Ik help je graag.
          </p>
        </div>
      </div>
    </section>
  );
}

export default FinalCTA;
