import Link from "next/link";
import { ScrollReveal, StaggerChildren } from "@/animations/Reveal";

const PLANS = [
  {
    price: "On Quote",
    priceNote: "per shipment",
    name: "Starter Air",
    features: [
      { active: true, text: "Standard air cargo booking" },
      { active: true, text: "Real-time milestone tracking" },
      { active: false, text: "Priority customs clearance" },
      { active: false, text: "Temperature-controlled handling" },
      { active: false, text: "Dedicated account manager" },
    ],
  },
  {
    price: "On Quote",
    priceNote: "per shipment",
    name: "Express Air",
    features: [
      { active: true, text: "Next-flight-out scheduling" },
      { active: true, text: "Real-time milestone tracking" },
      { active: true, text: "Priority customs clearance" },
      { active: false, text: "Temperature-controlled handling" },
      { active: false, text: "Dedicated account manager" },
    ],
  },
  {
    price: "On Quote",
    priceNote: "per shipment",
    name: "Cold Chain",
    features: [
      { active: true, text: "Next-flight-out scheduling" },
      { active: true, text: "Real-time milestone tracking" },
      { active: true, text: "Priority customs clearance" },
      { active: true, text: "Temperature-controlled handling" },
      { active: false, text: "Dedicated account manager" },
    ],
  },
  {
    price: "Custom",
    priceNote: "enterprise pricing",
    name: "Charter & Enterprise",
    featured: true,
    features: [
      { active: true, text: "Full-aircraft charter allocation" },
      { active: true, text: "Real-time milestone tracking" },
      { active: true, text: "Priority customs clearance" },
      { active: true, text: "Temperature-controlled handling" },
      { active: true, text: "Dedicated account manager" },
    ],
  },
];

export default function AirFreightBenefits() {
  return (
    <>
      <style dangerouslySetInnerHTML={{ __html: `
        .afpr-section {
          background: #ffffff;
          padding: 80px 20px;
        }
        .afpr-inner {
        }
        .afpr-header {
          margin-bottom: 60px;
        }
        .afpr-eyebrow {
          font-family: var(--font-manrope), "Manrope", sans-serif;
          font-size: 13px;
          font-weight: 700;
          letter-spacing: 0.1em;
          text-transform: uppercase;
          color: rgba(17,17,17,0.4);
          margin: 0 0 16px;
        }
        .logico-front-end .afpr-section h3.afpr-heading {
          font-family: var(--font-manrope), "Manrope", sans-serif;
          font-size: clamp(28px, 3.5vw, 52px);
          font-weight: 800;
          line-height: 1.1;
          letter-spacing: -0.03em;
          text-transform: uppercase;
          color: #1F1F1F;
          -webkit-text-fill-color: #1F1F1F;
          margin: 0;
          max-width: 560px;
        }
        .afpr-grid {
          display: grid;
          grid-template-columns: repeat(4, 1fr);
          gap: 20px;
        }
        .afpr-card {
          background: #ffffff;
          border: 1px solid rgba(17,17,17,0.1);
          border-radius: 20px;
          overflow: hidden;
          display: flex;
          flex-direction: column;
          transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.165,0.84,0.44,1);
        }
        .afpr-card:hover {
          border-color: #c01227;
          box-shadow: 0 20px 40px rgba(192,18,39,0.08);
          transform: translateY(-8px);
        }
        .afpr-card.afpr-featured {
          background: #1F1F1F;
          border-color: #1F1F1F;
        }
        .afpr-card.afpr-featured:hover {
          border-color: #c01227;
          box-shadow: 0 20px 40px rgba(192,18,39,0.2);
        }
        .afpr-card-top {
          padding: 32px 28px 20px;
          border-bottom: 1px solid rgba(17,17,17,0.08);
        }
        .afpr-card.afpr-featured .afpr-card-top {
          border-color: rgba(255,255,255,0.1);
        }
        .afpr-price {
          font-family: var(--font-manrope), "Manrope", sans-serif;
          font-size: clamp(28px, 2.5vw, 42px);
          font-weight: 800;
          color: #1F1F1F;
          line-height: 1;
          letter-spacing: -0.03em;
        }
        .afpr-card.afpr-featured .afpr-price {
          color: #FFFFFF;
        }
        .afpr-price-note {
          font-size: 12px;
          font-weight: 500;
          color: rgba(17,17,17,0.4);
          margin-top: 4px;
          display: block;
          text-transform: uppercase;
          letter-spacing: 0.05em;
        }
        .afpr-card.afpr-featured .afpr-price-note {
          color: rgba(255,255,255,0.4);
        }
        .afpr-plan-name {
          font-family: var(--font-manrope), "Manrope", sans-serif;
          font-size: 14px;
          font-weight: 700;
          letter-spacing: 0.06em;
          text-transform: uppercase;
          color: rgba(17,17,17,0.45);
          margin: 16px 0 0;
          display: block;
        }
        .afpr-card.afpr-featured .afpr-plan-name {
          color: rgba(255,255,255,0.4);
        }
        .afpr-card-body {
          padding: 24px 28px 28px;
          flex: 1;
          display: flex;
          flex-direction: column;
        }
        .afpr-features {
          list-style: none;
          padding: 0;
          margin: 0 0 28px;
          display: flex;
          flex-direction: column;
          gap: 12px;
          flex: 1;
        }
        .afpr-section .afpr-features li {
          display: flex;
          align-items: center;
          gap: 10px;
          font-size: 14px;
          font-weight: 500;
          color: rgba(17,17,17,0.65);
          line-height: 1.4;
        }
        .afpr-section .afpr-features li::before {
          content: none;
        }
        .afpr-card.afpr-featured .afpr-features li {
          color: rgba(255,255,255,0.55);
        }
        .afpr-feat-active {
          color: rgba(17,17,17,0.85) !important;
        }
        .afpr-card.afpr-featured .afpr-feat-active {
          color: rgba(255,255,255,0.9) !important;
        }
        .afpr-feat-dot {
          flex: 0 0 auto;
          width: 16px;
          height: 16px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
        }
        .afpr-feat-dot.on {
          background: rgba(192,18,39,0.1);
          border: 1px solid rgba(192,18,39,0.3);
          color: #c01227;
        }
        .afpr-feat-dot.off {
          background: rgba(17,17,17,0.04);
          border: 1px solid rgba(17,17,17,0.1);
          color: rgba(17,17,17,0.2);
        }
        .afpr-card.afpr-featured .afpr-feat-dot.off {
          background: rgba(255,255,255,0.04);
          border-color: rgba(255,255,255,0.1);
          color: rgba(255,255,255,0.2);
        }
        .afpr-feat-dot svg {
          width: 9px;
          height: 9px;
        }
        .logico-front-end .afpr-section .logico-alter-button {
          width: 100%;
          text-align: center;
          justify-content: center;
          display: flex;
          text-decoration: none;
        }
        .logico-front-end .afpr-card.afpr-featured .logico-alter-button {
          color: #FFFFFF !important;
          border-color: rgba(255,255,255,0.3) !important;
        }
        .logico-front-end .afpr-card.afpr-featured .logico-alter-button:hover {
          background: #FFFFFF !important;
          color: #1F1F1F !important;
          border-color: #FFFFFF !important;
        }
        @media (max-width: 1200px) {
          .afpr-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 600px) {
          .afpr-grid { grid-template-columns: 1fr; }
          .afpr-section { padding: 60px 20px; }
        }
      `}} />

      <section className="afpr-section">
        <div className="afpr-inner dm-section-container">
          <ScrollReveal delay={0.05}>
            <div className="afpr-header">
              <div className="afpr-eyebrow">/ Pricing Plans /</div>
              <h3 className="afpr-heading">Transparent pricing for every cargo need</h3>
            </div>
          </ScrollReveal>

          <StaggerChildren stagger={0.1} duration={0.75} yOffset={40} className="afpr-grid">
            {PLANS.map((plan) => (
              <div key={plan.name} className={`afpr-card${plan.featured ? " afpr-featured" : ""}`}>
                <div className="afpr-card-top">
                  <div className="afpr-price">{plan.price}</div>
                  <span className="afpr-price-note">{plan.priceNote}</span>
                  <span className="afpr-plan-name">{plan.name}</span>
                </div>
                <div className="afpr-card-body">
                  <ul className="afpr-features">
                    {plan.features.map((feat) => (
                      <li key={feat.text} className={feat.active ? "afpr-feat-active" : ""}>
                        <span className={`afpr-feat-dot ${feat.active ? "on" : "off"}`} aria-hidden="true">
                          {feat.active ? (
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round">
                              <polyline points="20 6 9 17 4 12" />
                            </svg>
                          ) : (
                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
                              <line x1="18" y1="6" x2="6" y2="18" />
                              <line x1="6" y1="6" x2="18" y2="18" />
                            </svg>
                          )}
                        </span>
                        {feat.text}
                      </li>
                    ))}
                  </ul>
                  <Link href="/contact" className="logico-alter-button">
                    Get started
                  </Link>
                </div>
              </div>
            ))}
          </StaggerChildren>
        </div>
      </section>
    </>
  );
}
