'use client';

import React from 'react';
import Link from 'next/link';
import Image from 'next/image';
import { useLanguage } from '@/context/LanguageContext';

export default function Footer() {
  const { t } = useLanguage();

  const links = [
    { key: 'nav.about', href: '/about' },
    { key: 'nav.treatments', href: '/treatments' },
    { key: 'nav.promo', href: '/promo' },
    { key: 'nav.locations', href: '/locations' },
    { key: 'nav.blog', href: '/blog' },
    { key: 'nav.liputan', href: '/liputan' },
    { key: 'nav.faq', href: '/faq' },
    { key: 'nav.contact', href: '/contact' },
  ];

  return (
    <footer className="bg-ivory border-t border-blush">
      <div className="container-custom py-12 md:py-16 flex flex-col gap-8">
        <div className="text-center">
          <Link href="/" className="inline-block mb-2">
            <Image src="/images/Logo-Carla.png" alt="Carla Skin Clinic" width={260} height={90} priority className="h-16 md:h-20 w-auto mx-auto" />
          </Link>
          <p className="text-sm text-grey-dark mb-6 italic">&ldquo;Age Differently, Age Gracefully&rdquo;</p>
          <div className="flex flex-wrap justify-center gap-6 md:gap-12">
            {links.map((link) => (
              <Link key={link.key} href={link.href} className="text-sm uppercase tracking-widest font-medium text-espresso hover:text-gold transition duration-300">
                {t(link.key)}
              </Link>
            ))}
          </div>
        </div>

        <hr className="border-blush" />

        <div className="grid md:grid-cols-3 gap-8 items-start">
          <div className="text-center md:text-left">
            <h6 className="text-sm uppercase tracking-widest text-espresso mb-4 font-semibold">{t('footer.social')}</h6>
            <div className="flex justify-center md:justify-start gap-4">
              <a href="https://www.instagram.com/carlaskinclinic/" target="_blank" rel="noopener noreferrer"
                className="w-10 h-10 bg-blush rounded-full flex items-center justify-center hover:bg-gold hover:text-white transition-all duration-300 group">
                <svg className="w-5 h-5 text-espresso group-hover:text-white transition-colors" viewBox="0 0 24 24" fill="currentColor">
                  <path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>
                </svg>
              </a>
              <a href="https://www.tiktok.com/@carlaskinclinic" target="_blank" rel="noopener noreferrer"
                className="w-10 h-10 bg-blush rounded-full flex items-center justify-center hover:bg-gold hover:text-white transition-all duration-300 group">
                <svg className="w-5 h-5 text-espresso group-hover:text-white transition-colors" viewBox="0 0 24 24" fill="currentColor">
                  <path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/>
                </svg>
              </a>
              <a href="https://www.facebook.com/carlaskinclinic.fb" target="_blank" rel="noopener noreferrer"
                className="w-10 h-10 bg-blush rounded-full flex items-center justify-center hover:bg-gold hover:text-white transition-all duration-300 group">
                <svg className="w-5 h-5 text-espresso group-hover:text-white transition-colors" viewBox="0 0 24 24" fill="currentColor">
                  <path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
                </svg>
              </a>
              <a href="https://www.youtube.com/@CarlaSkinClinic" target="_blank" rel="noopener noreferrer"
                className="w-10 h-10 bg-blush rounded-full flex items-center justify-center hover:bg-gold hover:text-white transition-all duration-300 group">
                <svg className="w-5 h-5 text-espresso group-hover:text-white transition-colors" viewBox="0 0 24 24" fill="currentColor">
                  <path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
                </svg>
              </a>
            </div>
          </div>

          <div className="text-center">
            <h6 className="text-sm uppercase tracking-widest text-espresso mb-4 font-semibold">{t('footer.download')}</h6>
            <div className="flex justify-center gap-3">
              <a href="https://play.google.com/store/apps/details?id=com.herca.carla" target="_blank" rel="noopener noreferrer" className="flex items-center gap-1.5 h-10 px-4 bg-espresso text-white text-sm rounded hover:bg-gold transition-colors duration-300">
                <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor">
                  <path d="M5 3L19 12L5 21V3Z"/>
                </svg>
                GOOGLE PLAY
              </a>
              <a href="https://apps.apple.com/id/app/carla-skin-clinic/id6739197168?l=id" target="_blank" rel="noopener noreferrer" className="flex items-center gap-1.5 h-10 px-4 bg-espresso text-white text-sm rounded hover:bg-gold transition-colors duration-300">
                <svg className="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor">
                  <path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/>
                </svg>
                APP STORE
              </a>
            </div>
          </div>

          <div className="text-center md:text-right">
            <h6 className="text-sm uppercase tracking-widest text-espresso mb-4 font-semibold">{t('footer.marketplace')}</h6>
            <div className="flex justify-center md:justify-end gap-2">
              <a href="https://www.tokopedia.com/carlaskinclinic" target="_blank" rel="noopener noreferrer"
                className="flex items-center justify-center h-10 px-4 bg-blush rounded text-sm text-espresso hover:bg-gold hover:text-white transition-colors duration-300">
                TOKOPEDIA
              </a>
              <a href="https://shopee.co.id/carlaskinclinic" target="_blank" rel="noopener noreferrer"
                className="flex items-center justify-center h-10 px-4 bg-blush rounded text-sm text-espresso hover:bg-gold hover:text-white transition-colors duration-300">
                SHOPEE
              </a>
            </div>
          </div>
        </div>

        <div className="text-center pt-4 border-t border-blush">
          <p className="text-base text-espresso tracking-wider font-medium">{t('footer.copyright')}</p>
        </div>
      </div>
    </footer>
  );
}
