"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen";
import MetricCardTwo from "@/components/sections/metrics/MetricCardTwo";
import FooterBaseCard from "@/components/sections/footer/FooterBaseCard";
import Link from "next/link";

const CheckoutPage = () => {
  const navItems = [
    { name: "Home", id: "home" },
    { name: "Categories", id: "categories" },
    { name: "Featured", id: "featured" },
    { name: "Deals", id: "deals" },
    { name: "About", id: "about" },
    { name: "Contact", id: "contact" },
  ];

  const footerColumns = [
    {
      title: "Shop",
      items: [
        { label: "All Products", href: "/categories" },
        { label: "Electronics", href: "/categories#electronics" },
        { label: "Fashion", href: "/categories#fashion" },
        { label: "Home & Garden", href: "/categories#home" },
        { label: "Food & Groceries", href: "/categories#food" },
      ],
    },
    {
      title: "Customer Service",
      items: [
        { label: "Contact Us", href: "/contact" },
        { label: "Track Order", href: "/account" },
        { label: "Returns & Exchanges", href: "#faq" },
        { label: "Shipping Info", href: "#faq" },
        { label: "FAQ", href: "#faq" },
      ],
    },
    {
      title: "Company",
      items: [
        { label: "About Us", href: "/about" },
        { label: "Blog", href: "/blog" },
        { label: "Careers", href: "/careers" },
        { label: "Partners", href: "/partners" },
        { label: "Press", href: "/press" },
      ],
    },
    {
      title: "Legal",
      items: [
        { label: "Privacy Policy", href: "#" },
        { label: "Terms of Service", href: "#" },
        { label: "Cookie Policy", href: "#" },
        { label: "Accessibility", href: "#" },
      ],
    },
  ];

  return (
    <ThemeProvider
      defaultButtonVariant="text-stagger"
      defaultTextAnimation="background-highlight"
      borderRadius="soft"
      contentWidth="mediumSmall"
      sizing="mediumLargeSizeMediumTitles"
      background="aurora"
      cardStyle="glass-depth"
      primaryButtonStyle="gradient"
      secondaryButtonStyle="solid"
      headingFontWeight="bold"
    >
      <div id="nav" data-section="nav">
        <NavbarStyleFullscreen
          navItems={navItems}
          brandName="Uzum Market"
          bottomLeftText="Global Marketplace Community"
          bottomRightText="support@uzummarket.com"
        />
      </div>

      <div id="checkout-benefits" data-section="checkout-benefits">
        <MetricCardTwo
          title="Why Shop with Uzum Market?"
          description="Complete your purchase with confidence. We guarantee secure payments, fast processing, and exceptional customer support."
          metrics={[
            {
              id: "metric-secure",
              value: "256-bit SSL",
              description: "Secure Encryption",
            },
            {
              id: "metric-payment",
              value: "6+ Ways",
              description: "Payment Methods",
            },
            {
              id: "metric-support",
              value: "24/7",
              description: "Customer Support",
            },
            {
              id: "metric-delivery",
              value: "2-7 Days",
              description: "Fast Delivery",
            },
          ]}
          gridVariant="uniform-all-items-equal"
          animationType="scale-rotate"
          textboxLayout="default"
          useInvertedBackground={true}
        />
      </div>

      <div id="checkout-form" data-section="checkout-form">
        <section className="mx-auto px-4 md:px-6 py-16 md:py-24">
          <div className="max-w-2xl mx-auto">
            <h2 className="text-2xl md:text-3xl font-bold mb-8">Checkout</h2>

            <div className="space-y-8">
              {/* Shipping Information */}
              <div className="p-6 rounded-lg bg-card border border-accent">
                <h3 className="text-lg font-semibold mb-4">Shipping Address</h3>
                <form className="space-y-4">
                  <div className="grid grid-cols-2 gap-4">
                    <input
                      type="text"
                      placeholder="First Name"
                      className="px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                    />
                    <input
                      type="text"
                      placeholder="Last Name"
                      className="px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                    />
                  </div>
                  <input
                    type="email"
                    placeholder="Email Address"
                    className="w-full px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                  />
                  <input
                    type="text"
                    placeholder="Street Address"
                    className="w-full px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                  />
                  <div className="grid grid-cols-3 gap-4">
                    <input
                      type="text"
                      placeholder="City"
                      className="px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                    />
                    <input
                      type="text"
                      placeholder="Region"
                      className="px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                    />
                    <input
                      type="text"
                      placeholder="Postal Code"
                      className="px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                    />
                  </div>
                  <input
                    type="tel"
                    placeholder="Phone Number"
                    className="w-full px-4 py-2 rounded-lg bg-background border border-accent focus:outline-none focus:border-primary-cta"
                  />
                </form>
              </div>

              {/* Delivery Method */}
              <div className="p-6 rounded-lg bg-card border border-accent">
                <h3 className="text-lg font-semibold mb-4">Delivery Method</h3>
                <div className="space-y-3">
                  <label className="flex items-center p-3 border border-accent rounded-lg cursor-pointer hover:bg-accent/50">
                    <input type="radio" name="delivery" defaultChecked className="mr-3" />
                    <div>
                      <div className="font-semibold">Standard Delivery - Free</div>
                      <div className="text-sm text-foreground/70">Arrives in 3-7 business days</div>
                    </div>
                  </label>
                  <label className="flex items-center p-3 border border-accent rounded-lg cursor-pointer hover:bg-accent/50">
                    <input type="radio" name="delivery" className="mr-3" />
                    <div>
                      <div className="font-semibold">Express Delivery - 29,999 UZS</div>
                      <div className="text-sm text-foreground/70">Arrives in 1-2 business days</div>
                    </div>
                  </label>
                </div>
              </div>

              {/* Payment Method */}
              <div className="p-6 rounded-lg bg-card border border-accent">
                <h3 className="text-lg font-semibold mb-4">Payment Method</h3>
                <div className="space-y-3">
                  <label className="flex items-center p-3 border border-accent rounded-lg cursor-pointer hover:bg-accent/50">
                    <input type="radio" name="payment" defaultChecked className="mr-3" />
                    <div>
                      <div className="font-semibold">Credit/Debit Card</div>
                      <div className="text-sm text-foreground/70">Visa, MasterCard, Humo</div>
                    </div>
                  </label>
                  <label className="flex items-center p-3 border border-accent rounded-lg cursor-pointer hover:bg-accent/50">
                    <input type="radio" name="payment" className="mr-3" />
                    <div>
                      <div className="font-semibold">Cash on Delivery</div>
                      <div className="text-sm text-foreground/70">Pay when you receive your order</div>
                    </div>
                  </label>
                  <label className="flex items-center p-3 border border-accent rounded-lg cursor-pointer hover:bg-accent/50">
                    <input type="radio" name="payment" className="mr-3" />
                    <div>
                      <div className="font-semibold">Digital Payment</div>
                      <div className="text-sm text-foreground/70">Click, Payme, Apelsin</div>
                    </div>
                  </label>
                </div>
              </div>

              {/* Order Summary */}
              <div className="p-6 rounded-lg bg-card border border-accent">
                <h3 className="text-lg font-semibold mb-4">Order Summary</h3>
                <div className="space-y-2 text-base mb-4">
                  <div className="flex justify-between">
                    <span>Subtotal (4 items):</span>
                    <span className="font-semibold">589,997 UZS</span>
                  </div>
                  <div className="flex justify-between">
                    <span>Shipping:</span>
                    <span className="font-semibold text-green-600">Free</span>
                  </div>
                  <div className="flex justify-between">
                    <span>Estimated Tax:</span>
                    <span className="font-semibold">47,200 UZS</span>
                  </div>
                  <div className="border-t border-accent pt-2 flex justify-between text-lg font-bold">
                    <span>Total:</span>
                    <span>637,197 UZS</span>
                  </div>
                </div>

                <button className="w-full px-6 py-3 bg-primary-cta text-primary-cta-text rounded-lg font-semibold hover:opacity-90 transition-opacity mb-3">
                  Complete Purchase
                </button>
                <Link
                  href="/cart"
                  className="w-full px-6 py-3 bg-secondary-cta text-secondary-cta-text rounded-lg font-semibold hover:opacity-90 transition-opacity text-center block border border-accent"
                >
                  Back to Cart
                </Link>
              </div>

              {/* Trust Badges */}
              <div className="grid grid-cols-3 gap-4 text-center">
                <div className="p-4 rounded-lg bg-accent/20">
                  <div className="text-2xl mb-2">🔒</div>
                  <div className="text-sm font-semibold">Secure Payment</div>
                </div>
                <div className="p-4 rounded-lg bg-accent/20">
                  <div className="text-2xl mb-2">🚚</div>
                  <div className="text-sm font-semibold">Fast Delivery</div>
                </div>
                <div className="p-4 rounded-lg bg-accent/20">
                  <div className="text-2xl mb-2">💬</div>
                  <div className="text-sm font-semibold">Support 24/7</div>
                </div>
              </div>
            </div>
          </div>
        </section>
      </div>

      <div id="footer" data-section="footer">
        <FooterBaseCard
          logoText="Uzum Market"
          columns={footerColumns}
          copyrightText="© 2025 Uzum Market. All rights reserved. | Made with ❤️ for Central Asia"
        />
      </div>
    </ThemeProvider>
  );
};

export default CheckoutPage;