'use client';

import { Phone, MapPin, Clock, MessageCircle, ExternalLink } from 'lucide-react';
import Button from '@/components/ui/Button';
import Logo from '@/components/ui/Logo';
import {
  SITE_ADDRESS,
  SITE_PHONE_DISPLAY,
  SITE_HOURS,
  WHATSAPP_URL,
  MAPS_URL,
} from '@/lib/constants';
import { useTranslation } from '@/hooks/useTranslation';

export default function ContactPreview() {
  const { t } = useTranslation();
  const telHref = `tel:+46725855050`;

  return (
    <section className="bg-brand-950 py-20 text-white">
      <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div className="grid gap-12 lg:grid-cols-2 lg:gap-16">
          <div>
            <span className="mb-2 inline-block text-sm font-semibold uppercase tracking-wider text-gold-400">
              {t('contact.label')}
            </span>
            <h2 className="mb-8 font-display text-3xl font-bold md:text-4xl">
              {t('contact.title')}
            </h2>

            <ul className="mb-8 space-y-5">
              <li className="flex gap-4">
                <MapPin className="mt-0.5 h-5 w-5 shrink-0 text-gold-400" />
                <div>
                  <p className="text-xs font-semibold uppercase tracking-wider text-gold-400">
                    {t('contact.addressLabel')}
                  </p>
                  <p className="text-brand-100">{SITE_ADDRESS}</p>
                </div>
              </li>
              <li className="flex gap-4">
                <Phone className="mt-0.5 h-5 w-5 shrink-0 text-gold-400" />
                <div>
                  <p className="text-xs font-semibold uppercase tracking-wider text-gold-400">
                    {t('contact.phoneLabel')}
                  </p>
                  <a href={telHref} className="text-brand-100 hover:text-white">
                    {SITE_PHONE_DISPLAY}
                  </a>
                </div>
              </li>
              <li className="flex gap-4">
                <Clock className="mt-0.5 h-5 w-5 shrink-0 text-gold-400" />
                <div>
                  <p className="text-xs font-semibold uppercase tracking-wider text-gold-400">
                    {t('contact.hoursLabel')}
                  </p>
                  <p className="text-brand-100">
                    {t('contact.hoursValue', { hours: SITE_HOURS })}
                  </p>
                </div>
              </li>
            </ul>

            <div className="flex flex-col gap-3 sm:flex-row">
              <Button
                href="/about#contact"
                variant="secondary"
                size="lg"
                className="w-full border-white/30 bg-white/10 text-white hover:border-gold-400/50 hover:bg-white/15 sm:w-auto"
              >
                {t('contact.learnMore')}
              </Button>
              <Button href={WHATSAPP_URL} external variant="gold" size="lg" className="w-full sm:w-auto">
                <MessageCircle className="h-4 w-4" />
                {t('contact.writeUs')}
              </Button>
              <Button
                href={telHref}
                variant="secondary"
                size="lg"
                className="w-full border-white/30 bg-white/10 text-white hover:border-gold-400/50 hover:bg-white/15 sm:w-auto"
              >
                <Phone className="h-4 w-4" />
                {t('contact.callUs')}
              </Button>
            </div>
          </div>

          <div className="flex flex-col justify-center">
            <a
              href={MAPS_URL}
              target="_blank"
              rel="noopener noreferrer"
              className="card-premium group flex flex-col items-center gap-4 bg-brand-900/50 p-8 text-center transition-all hover:bg-brand-900/70"
            >
              <Logo size="lg" className="ring-gold-400/30" />
              <div>
                <p className="font-display text-xl font-bold">{t('site.name')}</p>
                <p className="mt-1 text-sm text-brand-200">{SITE_ADDRESS}</p>
              </div>
              <span className="inline-flex items-center gap-2 text-sm font-semibold text-gold-400 transition-colors group-hover:text-gold-300">
                {t('contact.openMaps')}
                <ExternalLink className="h-4 w-4" />
              </span>
            </a>
          </div>
        </div>
      </div>
    </section>
  );
}