import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Menu, X, Phone } from "lucide-react";

const Navigation = () => {
  const [isOpen, setIsOpen] = useState(false);

  const navItems = [
    { name: "Home", href: "/" },
    { name: "About", href: "/about" },
    { name: "Services", href: "/services" },
    { name: "Resources", href: "/resources" },
    { name: "Testimonials", href: "/testimonials" },
    { name: "Contact", href: "/contact" },
  ];

  return (
    <nav className="fixed top-0 left-0 right-0 z-50 bg-card/95 backdrop-blur-sm border-b border-sage/20">
      <div className="container mx-auto px-4">
        <div className="flex items-center justify-between h-16">
          {/* Logo */}
          <div className="flex-shrink-0">
            <h1 className="text-xl font-display font-semibold text-forest">
              Greg Knopp, P.C.
            </h1>
          </div>

          {/* Desktop Navigation */}
          <div className="hidden md:block">
            <div className="ml-10 flex items-baseline space-x-8">
              {navItems.map((item) => (
                <a
                  key={item.name}
                  href={item.href}
                  className="text-sage hover:text-forest gentle-transition px-3 py-2 text-sm font-medium"
                >
                  {item.name}
                </a>
              ))}
            </div>
          </div>

          {/* Desktop CTA */}
          <div className="hidden md:flex items-center space-x-4">
            <a
              href="#"
              className="text-sage hover:text-forest gentle-transition text-sm"
            >
              Client Login
            </a>
            <Button 
              size="sm" 
              className="btn-shadow"
              onClick={() => window.open('tel:+13618543711')}
            >
              <Phone className="w-4 h-4 mr-2" />
              Schedule Consultation
            </Button>
          </div>

          {/* Mobile menu button */}
          <div className="md:hidden">
            <button
              onClick={() => setIsOpen(!isOpen)}
              className="text-sage hover:text-forest gentle-transition p-2"
            >
              {isOpen ? <X size={24} /> : <Menu size={24} />}
            </button>
          </div>
        </div>

        {/* Mobile Navigation */}
        {isOpen && (
          <div className="md:hidden">
            <div className="px-2 pt-2 pb-3 space-y-1 bg-card border-t border-sage/20">
              {navItems.map((item) => (
                <a
                  key={item.name}
                  href={item.href}
                  className="text-sage hover:text-forest block px-3 py-2 text-base font-medium gentle-transition"
                  onClick={() => setIsOpen(false)}
                >
                  {item.name}
                </a>
              ))}
              <div className="pt-4 pb-2 space-y-2">
                <a
                  href="#"
                  className="text-sage hover:text-forest block px-3 py-2 text-sm"
                >
                  Client Login
                </a>
                <Button 
                  size="sm" 
                  className="ml-3 btn-shadow"
                  onClick={() => window.open('tel:+13618543711')}
                >
                  <Phone className="w-4 h-4 mr-2" />
                  Schedule Consultation
                </Button>
              </div>
            </div>
          </div>
        )}
      </div>
    </nav>
  );
};

export default Navigation;