import Head from "next/head";
import Header from "../components/Header";
import Footer from "../components/Footer";
import {
  FaPhone,
  FaEnvelope,
  FaMapMarkerAlt,
  FaFacebook,
  FaLinkedin,
  FaPinterest,
  FaDirections,
  FaStar,
} from "react-icons/fa";

export default function ContactUs() {
  return (
    <div>
      <Head>
        <title>Contact Us</title>
      </Head>
      <Header />

      {/* Desktop Layout */}
      <div className="hidden md:flex p-8 bg-[#F6F9FC] rounded-lg shadow-md space-y-12 justify-between">
        {/* Left: Heading and HQ */}
        <div className="flex flex-col">
          <div>
            <h2 className="text-7xl font-semibold text-[#0B6F6F] p-3">
              CONTACT US
            </h2>
            <p className="text-gray-700 text-base max-w-3xl p-3">
             Have questions or want to work with us? Our team is here to help.
Reach out to us for inquiries, partnerships, or support, and we’ll get back to you as soon as possible.
            </p>
          </div>

          <div className="flex flex-row p-6 items-center">
  {/* Left Column - Line + Social Icons */}
  <div className="flex flex-col gap-4 items-center">
    <div>
      <svg
        width="13"
        height="361"
        viewBox="0 0 13 361"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
      >
        <line
          x1="6.99998"
          y1="0.682026"
          x2="5.99996"
          y2="360.682"
          stroke="url(#paint0_linear_6_1616)"
          strokeWidth="11"
        />
        <defs>
          <linearGradient
            id="paint0_linear_6_1616"
            x1="1"
            y1="0.665359"
            x2="-2.16841e-05"
            y2="360.665"
            gradientUnits="userSpaceOnUse"
          >
            <stop stopColor="#075653" />
            <stop offset="1" stopColor="#FAE278" />
          </linearGradient>
        </defs>
      </svg>
    </div>

    <div className="flex flex-col gap-4">
      <a href="#" className="text-[#0B6F6F] hover:text-[#0a5e5e] transition-colors">
        <FaFacebook size={24} />
      </a>
      <a href="#" className="text-[#0B6F6F] hover:text-[#0a5e5e] transition-colors">
        <FaLinkedin size={24} />
      </a>
      <a href="#" className="text-[#0B6F6F] hover:text-[#0a5e5e] transition-colors">
        <FaPinterest size={24} />
      </a>
    </div>
  </div>

  {/* Right Column - Head Quarter Info */}
  <div className="pl-6 space-y-6 self-center -mt-35">
    <h2 className="text-2xl font-semibold text-gray-800 ">Head Quarter</h2>

    <div className="space-y-6">
      <div className="flex items-start gap-4">
        <div className="text-[#0B6F6F]">
          <FaPhone size={20} />
        </div>
        <div>
          <p className="text-sm text-gray-600">Phone</p>
          <p className="text-gray-800 font-medium text-sm">
            (+251) 123-456-789
          </p>
        </div>
      </div>

      <div className="flex items-start gap-4">
        <div className="text-[#0B6F6F]">
          <FaEnvelope size={20} />
        </div>
        <div>
          <p className="text-sm text-gray-600">Email</p>
          <p className="text-gray-800 font-medium text-sm">
            hello@dottinat.com
          </p>
        </div>
      </div>

      <div className="flex items-start gap-4">
        <div className="text-[#0B6F6F]">
          <FaMapMarkerAlt size={20} />
        </div>
        <div>
          <p className="text-sm text-gray-600">Address</p>
          <p className="text-gray-800 font-medium text-sm">
            Addis Ababa, Ethiopia
          </p>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
        {/* Right: Form */}
        <div className="flex flex-col md:flex-row gap-12 max-w-7xl mx-auto h-1/2 items-center my-20">
          <div className="flex-1 
          
          p-6 rounded-lg shadow-md"
          style={{
            background: 'linear-gradient(135deg, #0B6F6F 32%, #F9E079 97%, #E9F0AA 100%)'
          }}>
            <ContactForm />
          </div>
        </div>
      </div>

      {/* Mobile Layout */}
      <div className="md:hidden p-6 space-y-8 bg-[#F6F9FC]">
        <h2 className="text-4xl font-semibold text-[#0B6F6F] text-center">
          CONTACT US
        </h2>
        <p className="text-gray-700 text-sm text-center">
          Lorem ipsum dolor sit amet consectetur. Est nulla nam quam nisi porta. Massa
          sapien at at amet volutpat proin id fames. Netus at scelerisque hendrerit
          quis nisl enim in. Tortor nunc.
        </p>

        <div className="border-l-4 border-[#0B6F6F] pl-4 space-y-6">
          <h2 className="text-xl font-semibold text-gray-800">Head Quarter</h2>

          <div className="space-y-4">
            <div className="flex items-start gap-3">
              <FaPhone className="text-[#0B6F6F]" />
              <div>
                <p className="text-sm text-gray-600">Phone</p>
                <p className="text-gray-800 font-medium text-sm">
                  (+251) 123-456-789
                </p>
              </div>
            </div>

            <div className="flex items-start gap-3">
              <FaEnvelope className="text-[#0B6F6F]" />
              <div>
                <p className="text-sm text-gray-600">Email</p>
                <p className="text-gray-800 font-medium text-sm">
                  hello@dottinat.com
                </p>
              </div>
            </div>

            <div className="flex items-start gap-3">
              <FaMapMarkerAlt className="text-[#0B6F6F]" />
              <div>
                <p className="text-sm text-gray-600">Address</p>
                <p className="text-gray-800 font-medium text-sm">
                  Addis Ababa, Ethiopia
                </p>
              </div>
            </div>

            <div className="flex gap-4 pt-2">
              <FaFacebook className="text-[#0B6F6F]" />
              <FaLinkedin className="text-[#0B6F6F]" />
              <FaPinterest className="text-[#0B6F6F]" />
            </div>
          </div>
        </div>

        <div
  className="p-4 rounded-lg shadow-md"
  style={{
    background: 'linear-gradient(135deg, #0B6F6F 32%, #F9E079 97%, #E9F0AA 100%)'
  }}
>
          <ContactForm />
        </div>
      </div>

      {/* Map */}
      <div className="relative w-full max-w-8xl mx-auto h-[400px] rounded-lg overflow-hidden shadow-lg my-8 px-4">
        <iframe
          className="w-full h-full"
          src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3940.920491471523!2d38.76321531533839!3d9.00568529355086!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zOcKwMDAnMjAuNSJOIDM4wrA0NSc1Mi4xIkU!5e0!3m2!1sen!2set!4v1620000000000!5m2!1sen!2set"
          allowFullScreen
          loading="lazy"
        ></iframe>

        <div className="absolute top-4 left-4 bg-gradient-to-tl from-[#81a670] to-[#0B6F6F] p-3 rounded-lg shadow-md w-[260px] md:w-[280px]">
          <div className="space-y-2 text-white text-sm">
            <h3 className="font-bold text-lg">Droga Building</h3>
            <p>
              7th Floor, Room no-<br />
              Gulele Subcity, Woreda 9,<br />
              Addis Ababa, Ethiopia
            </p>
            <div className="flex items-center">
              {[...Array(5)].map((_, i) => (
                <FaStar key={i} className={`${i < 4 ? 'text-yellow-400' : 'text-white'} w-4 h-4`} />
              ))}
              <span className="ml-1 text-white">4.5</span>
            </div>
            <a
            href="https://www.google.com/maps/place/Droga+Building/@9.0056853,38.7632153,17z/data=!3m1!4b1!4m6!3m5!1s0x0:0x0!8m2!3d9.0056853!4d38.765404!16s%2Fg%2F11ryv1x8y9"
            target="_blank"
            rel="noopener noreferrer"
            className="flex items-center gap-2 bg-white text-[#0B6F6F] px-4 py-2 rounded-full text-xs border border-[#0B6F6F] "
          >
            <FaDirections />
            Get Direction
          </a>

          </div>
        </div>
      </div>

      <Footer />
    </div>
  );
}

// Reusable form component
function ContactForm() {
  return (
    <form className="space-y-4">
      <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
        <div>
          <label className="block text-sm font-medium text-white mb-1">Name</label>
          <input
            type="text"
            className="w-full p-2 border border-white rounded-md focus:ring-1 focus:ring-[#0B6F6F] focus:border-[#0B6F6F]"
            required
          />
        </div>
        <div>
          <label className="block text-sm font-medium text-white mb-1">Email</label>
          <input
            type="email"
            className="w-full p-2 border border-white rounded-md focus:ring-1 focus:ring-[#0B6F6F] focus:border-[#0B6F6F]"
            required
          />
        </div>
      </div>
      <div>
        <label className="block text-sm font-medium text-white mb-1">Phone (Optional)</label>
        <input
          type="tel"
          className="w-full p-2 border border-white rounded-md focus:ring-1 focus:ring-[#0B6F6F] focus:border-[#0B6F6F]"
        />
      </div>
      <div>
        <label className="block text-sm font-medium text-white mb-1">Write your message</label>
        <textarea
          className="w-full p-2 border border-white rounded-md focus:ring-1 focus:ring-[#0B6F6F] focus:border-[#0B6F6F]"
          rows={4}
          required
        />
      </div>
      <div className="flex items-center">
        <input
          type="checkbox"
          id="newsletter"
          className="h-4 w-4 text-[#0B6F6F] focus:ring-[#0B6F6F] border-gray-300 rounded"
        />
        <label htmlFor="newsletter" className="ml-2 block text-sm text-white">
          Subscribe to our Newsletter for all latest News.
        </label>
      </div>
      <button
  type="submit"
  className=" bg-white text-[#0A5B5B] py-2 px-4 rounded-full border border-[#0A5B5B] mt-2"
>
  Send Message
</button>

    </form>
  );
}
