"use client";

import Link from "next/link";
import Image from "next/image";

const PHONE = "0651621512";
const WA = "212651621512";

export default function Footer() {
  return (
    <footer
      id="contact"
      style={{
        background: "#0d1018",
        color: "white",
        padding: "3.5rem 1.5rem 2rem",
        borderTop: "1px solid #2a3050",
      }}
    >
      <div style={{ maxWidth: 1100, margin: "0 auto" }}>
        <div
          style={{
            display: "grid",
            gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))",
            gap: "2.5rem",
            marginBottom: "2.5rem",
          }}
        >
          {/* Brand */}
          <div>
            <div style={{ marginBottom: "1rem" }}>
              <Image
                src="/logo.png"
                alt="Setocars — Location de voitures Marrakech"
                width={160}
                height={80}
                unoptimized
                style={{ width: "auto", height: "68px", display: "block" }}
              />
            </div>
            <p style={{ fontFamily: "var(--font-montserrat)", fontSize: "0.85rem", color: "rgba(255,255,255,0.6)", lineHeight: 1.7, textTransform: "none", letterSpacing: 0 }}>
              Votre partenaire de confiance pour la location de voitures à Marrakech. Flotte récente, prix compétitifs, service 24h/7j.
            </p>

            {/* Social icons */}
            <div style={{ display: "flex", gap: "0.6rem", marginTop: "1.25rem" }}>
              {[
                { label: "Facebook", path: "M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z" },
                { label: "Instagram", path: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37zM17.5 6.5h.01M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5z" },
              ].map(({ label, path }) => (
                <a
                  key={label}
                  href="#"
                  aria-label={label}
                  style={{
                    width: 34,
                    height: 34,
                    borderRadius: "50%",
                    background: "rgba(255,255,255,0.07)",
                    border: "1px solid rgba(232,92,26,0.3)",
                    display: "flex",
                    alignItems: "center",
                    justifyContent: "center",
                    transition: "all 0.2s",
                    textDecoration: "none",
                    color: "white",
                  }}
                  onMouseEnter={(e) => {
                    (e.currentTarget as HTMLElement).style.background = "#e85c1a";
                    (e.currentTarget as HTMLElement).style.borderColor = "#e85c1a";
                  }}
                  onMouseLeave={(e) => {
                    (e.currentTarget as HTMLElement).style.background = "rgba(255,255,255,0.07)";
                    (e.currentTarget as HTMLElement).style.borderColor = "rgba(232,92,26,0.3)";
                  }}
                >
                  <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
                    <path d={path} />
                  </svg>
                </a>
              ))}
            </div>
          </div>

          {/* Quick links */}
          <div>
            <h3 style={{ fontFamily: "var(--font-oswald)", fontSize: "1rem", color: "#e85c1a", marginBottom: "1.1rem", letterSpacing: "0.06em" }}>
              NAVIGATION
            </h3>
            <ul style={{ listStyle: "none", display: "flex", flexDirection: "column", gap: "0.55rem" }}>
              {[
                { label: "Accueil", href: "/" },
                { label: "Notre flotte", href: "#flotte" },
                { label: "Services", href: "#services" },
                { label: "Dacia Logan", href: "/cars/dacia-logan" },
                { label: "Dacia Duster", href: "/cars/dacia-duster" },
                { label: "Aéroport Marrakech", href: "/locations/marrakech-airport" },
              ].map((link) => (
                <li key={link.href}>
                  <Link
                    href={link.href}
                    style={{
                      color: "rgba(255,255,255,0.6)",
                      textDecoration: "none",
                      fontFamily: "var(--font-montserrat)",
                      fontSize: "0.84rem",
                      textTransform: "none",
                      letterSpacing: 0,
                      transition: "color 0.2s",
                      display: "flex",
                      alignItems: "center",
                      gap: "0.35rem",
                    }}
                    onMouseEnter={(e) => ((e.target as HTMLElement).style.color = "#e85c1a")}
                    onMouseLeave={(e) => ((e.target as HTMLElement).style.color = "rgba(255,255,255,0.6)")}
                  >
                    → {link.label}
                  </Link>
                </li>
              ))}
            </ul>
          </div>

          {/* Services */}
          <div>
            <h3 style={{ fontFamily: "var(--font-oswald)", fontSize: "1rem", color: "#e85c1a", marginBottom: "1.1rem", letterSpacing: "0.06em" }}>
              NOS SERVICES
            </h3>
            <ul style={{ listStyle: "none", display: "flex", flexDirection: "column", gap: "0.55rem" }}>
              {[
                "Assurance tous risques",
                "Kilométrage illimité",
                "Réservation facile",
                "Assistance 24/7",
                "Livraison aéroport",
                "Location longue durée",
              ].map((s) => (
                <li
                  key={s}
                  style={{
                    color: "rgba(255,255,255,0.6)",
                    fontFamily: "var(--font-montserrat)",
                    fontSize: "0.84rem",
                    textTransform: "none",
                    letterSpacing: 0,
                    display: "flex",
                    alignItems: "center",
                    gap: "0.35rem",
                  }}
                >
                  <span style={{ color: "#e85c1a", fontSize: "0.65rem" }}>◆</span> {s}
                </li>
              ))}
            </ul>
          </div>

          {/* Contact */}
          <div>
            <h3 style={{ fontFamily: "var(--font-oswald)", fontSize: "1rem", color: "#e85c1a", marginBottom: "1.1rem", letterSpacing: "0.06em" }}>
              CONTACT
            </h3>
            <div style={{ display: "flex", flexDirection: "column", gap: "0.85rem" }}>
              {[
                { icon: "📞", text: PHONE, href: `tel:${PHONE}` },
                { icon: "📧", text: "contact@setocar.com", href: "mailto:contact@setocar.com" },
                { icon: "📍", text: "Marrakech – Centre de Guéliz, Derrière Carré Eden", href: "#" },
              ].map((item, i) => (
                <a
                  key={i}
                  href={item.href}
                  style={{
                    display: "flex",
                    gap: "0.6rem",
                    color: "rgba(255,255,255,0.6)",
                    textDecoration: "none",
                    fontFamily: "var(--font-montserrat)",
                    fontSize: "0.84rem",
                    textTransform: "none",
                    letterSpacing: 0,
                    alignItems: "flex-start",
                    transition: "color 0.2s",
                    lineHeight: 1.5,
                  }}
                  onMouseEnter={(e) => ((e.currentTarget as HTMLElement).style.color = "white")}
                  onMouseLeave={(e) => ((e.currentTarget as HTMLElement).style.color = "rgba(255,255,255,0.6)")}
                >
                  <span style={{ flexShrink: 0 }}>{item.icon}</span>
                  {item.text}
                </a>
              ))}
            </div>

            {/* WhatsApp CTA */}
            <a
              href={`https://wa.me/${WA}?text=Bonjour%20Setocar!`}
              target="_blank"
              rel="noopener noreferrer"
              style={{
                display: "inline-flex",
                alignItems: "center",
                gap: "0.5rem",
                marginTop: "1.25rem",
                padding: "0.6rem 1.25rem",
                background: "#25d366",
                borderRadius: "0.4rem",
                color: "white",
                textDecoration: "none",
                fontFamily: "var(--font-montserrat)",
                fontWeight: 700,
                fontSize: "0.82rem",
                textTransform: "none",
                letterSpacing: 0,
                boxShadow: "0 4px 14px rgba(37,211,102,0.3)",
                transition: "all 0.2s",
              }}
            >
              <svg width="16" height="16" viewBox="0 0 24 24" fill="white">
                <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/>
              </svg>
              WhatsApp
            </a>
          </div>
        </div>

        {/* Bottom bar */}
        <div
          style={{
            borderTop: "1px solid rgba(255,255,255,0.07)",
            paddingTop: "1.25rem",
            display: "flex",
            flexWrap: "wrap",
            gap: "1rem",
            alignItems: "center",
            justifyContent: "space-between",
          }}
        >
          <p style={{ fontFamily: "var(--font-montserrat)", color: "rgba(255,255,255,0.35)", fontSize: "0.78rem", textTransform: "none", letterSpacing: 0 }}>
            © 2025 Setocar — Location de voiture Marrakech. Tous droits réservés.
          </p>
          <div style={{ display: "flex", gap: "1.5rem" }}>
            {["CGU", "Confidentialité", "Mentions légales"].map((item) => (
              <a
                key={item}
                href="#"
                style={{
                  color: "rgba(255,255,255,0.35)",
                  textDecoration: "none",
                  fontFamily: "var(--font-montserrat)",
                  fontSize: "0.76rem",
                  textTransform: "none",
                  letterSpacing: 0,
                  transition: "color 0.2s",
                }}
                onMouseEnter={(e) => ((e.target as HTMLElement).style.color = "#e85c1a")}
                onMouseLeave={(e) => ((e.target as HTMLElement).style.color = "rgba(255,255,255,0.35)")}
              >
                {item}
              </a>
            ))}
          </div>
        </div>
      </div>
    </footer>
  );
}
