'use client';

export const dynamic = 'force-dynamic';

import { useState } from 'react';
import { Phone, Mail, MapPin, MessageCircle, Clock, ChevronRight, ChevronDown } from 'lucide-react';
import AnimatedSection from '@/components/ui/AnimatedSection';
import GoldDivider from '@/components/ui/GoldDivider';
import InquiryForm from '@/components/InquiryForm';

const faqs = [
  {
    q: 'Where is Andalusian Banquet located?',
    a: 'Andalusian Banquet is located in DHA, Karachi — a convenient and accessible location for weddings, corporate events, brand activations, and social gatherings.',
  },
  {
    q: 'What types of events can be hosted at Andalusian Banquet?',
    a: 'We host weddings, receptions, engagements, mehndi events, corporate functions, brand activations, conferences, concerts, pop-up markets, festivals, private gatherings, institutional events, and large-scale social events.',
  },
  {
    q: 'What venue options are available?',
    a: 'Andalusian Banquet offers multiple indoor halls — Granada, Cádiz, Sevilla, Cordoba, and Alhambra — along with a spacious open-air lawn suitable for a range of event sizes and styles.',
  },
  {
    q: 'What is the guest capacity of the venue?',
    a: 'Cádiz Hall accommodates approximately 300–350 guests. Granada, Sevilla, and Cordoba each accommodate approximately 500–700 guests. Alhambra accommodates approximately 1,000–1,200 guests. The open-air lawn accommodates approximately 800–1,500 guests depending on event layout and requirements.',
  },
  {
    q: 'Is parking available?',
    a: 'Yes. Andalusian Banquet offers parking capacity for approximately 3,000 vehicles, making it well-suited for large weddings, corporate events, public gatherings, festivals, and high-footfall events.',
  },
  {
    q: 'Does Andalusian Banquet provide waitering service?',
    a: 'Yes. Trained waitering service is available to support smooth guest service and a comfortable event experience.',
  },
  {
    q: 'Does Andalusian Banquet provide event-day staff?',
    a: 'Yes. Our team provides on-ground operational support including guest guidance, access control, event supervision, waitering service, and coordination support throughout the event.',
  },
  {
    q: 'Does Andalusian Banquet offer décor and styling support?',
    a: 'Yes. We offer décor, styling, and customization support — including theme planning, stage setup, floral arrangements, seating layouts, lighting coordination, and personalized event styling.',
  },
  {
    q: 'Can corporate events and brand activations be hosted at Andalusian Banquet?',
    a: 'Yes. Our venue is well-suited for corporate events, brand launches, activations, conferences, networking events, exhibitions, public markets, and institutional gatherings.',
  },
  {
    q: 'Can clients visit the venue before booking?',
    a: 'Yes. Site visits and consultations can be arranged. Clients are encouraged to visit the venue to better understand the space, layout options, and planning possibilities.',
  },
  {
    q: 'How can a booking be made?',
    a: 'Clients can contact Andalusian Banquet directly to discuss availability, event requirements, venue options, and booking details. Our team will guide you through the planning and reservation process.',
  },
];

const contactDetails = [
  {
    icon: Phone,
    label: 'Call Us',
    lines: ['+92 326 8463036', '+92 326 8463037'],
    action: 'tel:+923268463036',
    actionLabel: 'Call Now',
  },
  {
    icon: MessageCircle,
    label: 'WhatsApp',
    lines: ['+92 326 8463036', 'Available 9am – 10pm'],
    action: 'https://wa.me/923268463036',
    actionLabel: 'Message Us',
  },
  {
    icon: Mail,
    label: 'Email',
    lines: ['info@andalusianbanquets.com', 'bookings@andalusianbanquets.com'],
    action: 'mailto:info@andalusianbanquets.com',
    actionLabel: 'Send Email',
  },
  {
    icon: MapPin,
    label: 'Address',
    lines: ['33 Zulfiqar Street 1, DHA Phase VIII Zone A', 'Phase 8 DHA, Karachi, 75500'],
    action: '#map',
    actionLabel: 'Get Directions',
  },
];

export default function Contact() {
  const [openFaq, setOpenFaq] = useState(null);

  return (
    <div style={{ background: 'var(--bg-main)' }}>
      {/* Hero */}
      <section
        className="relative flex items-end pb-20"
        style={{
          minHeight: '55vh',
          backgroundImage: 'url(https://images.unsplash.com/photo-1530103862676-de8c9debad1d?w=1920&q=80)',
          backgroundSize: 'cover',
          backgroundPosition: 'center',
        }}
      >
        <div className="absolute inset-0 hero-overlay" />
        <div className="relative z-10 max-w-7xl mx-auto px-6 w-full pt-44">
          <p className="section-label mb-4">Get In Touch</p>
          <h1
            className="font-display text-light font-bold"
            style={{ fontSize: 'clamp(3rem, 7vw, 5.5rem)', lineHeight: 1.1 }}
          >
            Contact <span className="text-gold-gradient">Us</span>
          </h1>
          <GoldDivider className="mt-6" />
        </div>
      </section>

      {/* Contact Cards */}
      <section className="py-20 max-w-7xl mx-auto px-6">
        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
          {contactDetails.map(({ icon: Icon, label, lines, action, actionLabel }, i) => (
            <AnimatedSection key={i} delay={i * 80}>
              <div className="glass-card p-8 h-full flex flex-col hover:border-gold/50 transition-all duration-500">
                <div
                  className="w-12 h-12 flex items-center justify-center mb-6"
                  style={{ border: '1px solid rgba(212,175,55,0.4)' }}
                >
                  <Icon size={18} className="text-gold" />
                </div>
                <p className="section-label mb-3">{label}</p>
                <div className="flex-1">
                  {lines.map((line, j) => (
                    <p key={j} className={`${j === 0 ? 'text-light font-medium' : 'text-whisper text-sm'}`}>
                      {line}
                    </p>
                  ))}
                </div>
                <a
                  href={action}
                  className="mt-6 flex items-center gap-2 text-gold text-xs tracking-wider uppercase hover:gap-3 transition-all duration-300"
                >
                  {actionLabel}
                  <ChevronRight size={12} />
                </a>
              </div>
            </AnimatedSection>
          ))}
        </div>
      </section>

      {/* Inquiry Form */}
      <section className="pb-20 max-w-7xl mx-auto px-6">
        <AnimatedSection className="text-center mb-12">
          <p className="section-label mb-4">Plan Your Event</p>
          <h2
            className="font-display text-light font-bold mb-6"
            style={{ fontSize: 'clamp(2.5rem, 4vw, 3.5rem)' }}
          >
            Plan Your Event With <span className="text-gold-gradient">Andalusian Banquet</span>
          </h2>
          <GoldDivider className="mx-auto mb-6" />
          <p className="text-whisper max-w-3xl mx-auto mb-4 leading-relaxed">
            Looking for a premium venue for your next event? Andalusian Banquet offers elegant indoor halls, a spacious open-air lawn, parking capacity for approximately 3,000 vehicles, trained waitering service, professional event support, and complete venue coordination.
          </p>
          <p className="text-whisper max-w-3xl mx-auto leading-relaxed">
            Contact our team to discuss your event requirements, check availability, schedule a site visit, and explore the best venue option for your occasion.
          </p>
        </AnimatedSection>
        <InquiryForm />
      </section>

      {/* FAQ */}
      <section className="py-20" style={{ background: 'var(--bg-foundation)' }}>
        <div className="max-w-4xl mx-auto px-6">
          <AnimatedSection className="text-center mb-14">
            <p className="section-label mb-4">FAQ</p>
            <h2
              className="font-display text-light font-bold"
              style={{ fontSize: 'clamp(2.5rem, 4vw, 3.5rem)' }}
            >
              Frequently Asked <span className="text-gold-gradient">Questions</span>
            </h2>
            <GoldDivider className="mx-auto mt-6" />
          </AnimatedSection>

          <div className="space-y-2">
            {faqs.map((faq, i) => (
              <AnimatedSection key={i} delay={i * 40}>
                <div
                  className="glass-card overflow-hidden transition-all duration-300"
                  style={{ borderColor: openFaq === i ? 'rgba(212,175,55,0.4)' : 'rgba(212,175,55,0.12)' }}
                >
                  <button
                    className="w-full flex items-center justify-between p-6 text-left gap-4"
                    onClick={() => setOpenFaq(openFaq === i ? null : i)}
                  >
                    <span className="font-display text-light font-semibold text-base leading-snug">{faq.q}</span>
                    <ChevronDown
                      size={16}
                      className="text-gold flex-shrink-0 transition-transform duration-300"
                      style={{ transform: openFaq === i ? 'rotate(180deg)' : 'rotate(0deg)' }}
                    />
                  </button>
                  {openFaq === i && (
                    <div className="px-6 pb-6">
                      <div style={{ borderTop: '1px solid rgba(212,175,55,0.12)', paddingTop: '16px' }}>
                        <p className="text-whisper leading-relaxed text-sm">{faq.a}</p>
                      </div>
                    </div>
                  )}
                </div>
              </AnimatedSection>
            ))}
          </div>
        </div>
      </section>

      {/* Map */}
      <section className="py-20 max-w-7xl mx-auto px-6" id="map">
        <AnimatedSection>
          <a
            href="https://maps.app.goo.gl/gGm17sJ8NBpWBQ267"
            target="_blank"
            rel="noopener noreferrer"
            className="relative overflow-hidden map-placeholder flex items-center justify-center cursor-pointer"
            style={{ height: '400px' }}
          >
            {/* Decorative map placeholder */}
            <div className="text-center">
              <MapPin size={48} className="text-gold mx-auto mb-4" />
              <h3 className="font-display text-light text-2xl mb-2">Andalusian Banquets</h3>
              <p className="text-whisper">33 Zulfiqar Street 1, DHA Phase VIII Zone A, Karachi, 75500</p>
              <span className="btn-outline-gold px-8 py-3 mt-6 inline-block">
                Open in Google Maps
              </span>
            </div>
            {/* Grid pattern overlay */}
            <div
              className="absolute inset-0 opacity-5"
              style={{
                backgroundImage: 'linear-gradient(rgba(212,175,55,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(212,175,55,0.5) 1px, transparent 1px)',
                backgroundSize: '40px 40px',
              }}
            />
          </a>
        </AnimatedSection>
      </section>

      {/* Hours */}
      <section className="py-20" style={{ background: 'var(--bg-foundation)' }}>
        <div className="max-w-3xl mx-auto px-6 text-center">
          <AnimatedSection>
            <div className="glass-card p-12">
              <Clock size={32} className="text-gold mx-auto mb-6" />
              <p className="section-label mb-4">Booking Office Timings</p>
              <h3 className="font-display text-light font-bold text-3xl mb-6">
                Andalusian <span className="text-gold-gradient">Booking Office</span> Timings
              </h3>
              <GoldDivider className="mx-auto mb-8" />
              <div className="grid grid-cols-1 gap-6">
                {[
                  { day: 'Monday – Sunday', time: '1:00 PM – 11:00 PM' },
                ].map(({ day, time }, i) => (
                  <div key={i} className="flex justify-between items-center w-full px-2 pb-4"
                    style={{ borderBottom: '1px solid rgba(212,175,55,0.1)' }}>
                    <span className="text-whisper text-base">{day}</span>
                    <span className="text-light text-base font-medium">{time}</span>
                  </div>
                ))}
              </div>
            </div>
          </AnimatedSection>
        </div>
      </section>

      {/* Closing Statement */}
      <section className="py-24 max-w-4xl mx-auto px-6">
        <AnimatedSection className="text-center">
          <GoldDivider className="mx-auto mb-10" />
          <p className="text-whisper leading-relaxed text-base mx-auto" style={{ maxWidth: '720px' }}>
            Andalusian Banquet stands as a well-managed, reliable, and thoughtfully designed event venue. With a focus on quality, organization, and smooth execution, we continue to position ourselves as a trusted choice for weddings, corporate events, brand activations, and large-scale gatherings — delivering experiences that are planned with care and executed with confidence.
          </p>
          <GoldDivider className="mx-auto mt-10" />
        </AnimatedSection>
      </section>
    </div>
  );
}