"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay';
import FaqBase from '@/components/sections/faq/FaqBase';
import ContactCenter from '@/components/sections/contact/ContactCenter';
import FooterMedia from '@/components/sections/footer/FooterMedia';
import { MessageSquare } from "lucide-react";

export default function SupportPage() {
  return (
    <ThemeProvider
      defaultButtonVariant="bounce-effect"
      defaultTextAnimation="entrance-slide"
      borderRadius="rounded"
      contentWidth="mediumLarge"
      sizing="mediumLargeSizeLargeTitles"
      background="circleGradient"
      cardStyle="gradient-mesh"
      primaryButtonStyle="radial-glow"
      secondaryButtonStyle="layered"
      headingFontWeight="bold"
    >
      <div id="nav" data-section="nav">
        <NavbarLayoutFloatingOverlay
          brandName="BASE"
          navItems={[
            { name: "Systems", id: "/systems" },
            { name: "Performance", id: "/performance" },
            { name: "Build", id: "/build" },
            { name: "Field Tests", id: "/field-tests" },
            { name: "Support", id: "/support" }
          ]}
          button={{ text: "Shop", href: "#shop" }}
          className="backdrop-blur-lg border border-accent/40"
        />
      </div>

      <div id="support" data-section="support">
        <FaqBase
          title="Support & Resources"
          description="No-friction setup. Guided troubleshooting, calibration guides, and direct technical support."
          faqs={[
            {
              id: "quick-start",              title: "How do I get started?",              content: "<p><strong>Quick Start Guide:</strong> Unpack unit. Connect power and audio input. Run calibration app (iOS/Android/Web). Place microphone at listening position. DSP correction applies automatically. Adjust playback level to reference (-20dBFS = 85dB SPL @ 1m).</p><p><strong>Typical time:</strong> 15–20 minutes for nearfield, 30–45 minutes for room correction in treated spaces.</p>"
            },
            {
              id: "connectivity",              title: "What inputs and outputs does BASE support?",              content: "<p><strong>Analog:</strong> XLR (balanced) + RCA (unbalanced).</p><p><strong>Digital:</strong> USB-C audio input (24-bit / 48–192kHz), optional AES/EBU module (custom order).</p><p><strong>Control:</strong> Ethernet for remote DSP management, MQTT for integration with studio automation.</p><p><strong>Wireless:</strong> Not supported—analog and digital hardwired connections ensure latency control and interference immunity.</p>"
            },
            {
              id: "calibration",              title: "How does room calibration work?",              content: "<p><strong>Process:</strong> Supplied measurement microphone + app generates frequency response curve. DSP applies inverse correction curve to match anechoic reference target. Phase alignment and timing delay adjusted per room geometry.</p><p><strong>Recalibration:</strong> Run new calibration after furniture moves or acoustic treatment changes. Previous profiles archived.</p><p><strong>Manual mode:</strong> Override DSP settings for custom voicing if preferred.</p>"
            },
            {
              id: "warranty",              title: "What warranty and support do I get?",              content: "<p><strong>Warranty:</strong> 3-year parts + labor on manufacturing defects. Accidental damage coverage available (add-on).</p><p><strong>Support:</strong> Email support, phone triage, authorized repair centers in major markets. Firmware updates delivered via USB or network.</p><p><strong>Technical consultation:</strong> Included room setup consultation (1 hour remote) with audio engineers.</p>"
            },
            {
              id: "troubleshooting",              title: "Why is my audio cutting out or sounding thin?",              content: "<p><strong>Checklist:</strong></p><ul><li>Confirm USB power supply is connected (power LED should be steady).</li><li>Check input cable connection and audio level in DAW (should be -20 to -10dBFS for clean headroom).</li><li>Verify DSP profile is active and not set to 'Off' mode.</li><li>Run calibration again if acoustic conditions changed.</li><li>Contact support if issue persists—we'll troubleshoot via phone.</li></ul>"
            }
          ]}
          textboxLayout="default"
          useInvertedBackground="noInvert"
          animationType="smooth"
        />
      </div>

      <div id="contact" data-section="contact">
        <ContactCenter
          tag="Newsletter"
          title="Stay Updated"
          description="Get the latest specs, performance updates, and exclusive field test results delivered to your inbox."
          tagIcon={MessageSquare}
          useInvertedBackground="invertDefault"
          inputPlaceholder="your@email.com"
          buttonText="Subscribe"
          onSubmit={(email) => console.log('Newsletter signup:', email)}
        />
      </div>

      <div id="footer" data-section="footer">
        <FooterMedia
          imageSrc="https://images.unsplash.com/photo-1478737270239-2f02b77fc618?w=800&q=80"
          imageAlt="BASE laboratory testing environment"
          logoText="BASE"
          copyrightText="© 2025 BASE Audio Systems. All rights reserved."
          columns={[
            {
              title: "Products",              items: [
                { label: "BASE One", href: "/systems" },
                { label: "BASE Two", href: "/systems" },
                { label: "BASE Studio", href: "/systems" },
                { label: "Configurator", href: "/build" }
              ]
            },
            {
              title: "Resources",              items: [
                { label: "Measurement Reports", href: "/performance" },
                { label: "Quick Start", href: "/support" },
                { label: "Field Tests", href: "/field-tests" },
                { label: "Technical Specs", href: "/performance" }
              ]
            },
            {
              title: "Company",              items: [
                { label: "About", href: "/about" },
                { label: "Support", href: "/support" },
                { label: "Contact", href: "/contact" },
                { label: "Careers", href: "/careers" }
              ]
            }
          ]}
        />
      </div>
    </ThemeProvider>
  );
}