import { createFileRoute } from "@tanstack/react-router";
import { Section } from "@/components/page-shell";
import { SubPageLayout } from "@/components/sub-page-layout";

export const Route = createFileRoute("/faq")({
  head: () => ({
    meta: [
      { title: "Frequently Asked Questions — Promist" },
      { name: "description", content: "Common questions about misting systems: how they work, installation, maintenance, and more." },
    ],
  }),
  component: SolutionsFaq,
});

const faqs = [
  {
    q: "How do misting systems work?",
    a: "When connected to a special high pressure pump, water is forced through our patented nozzles and quickly atomized to droplets as small as 8-10 microns. These billions of tiny droplets quickly evaporate, absorbing energy from the air in the form of heat. The result is a temperature reduction of up to 35°F (15°C), depending on ambient temperature and humidity levels."
  },
  {
    q: "Do I need misting fans or misting nozzles?",
    a: "For bigger areas, misting fans are the right choice as they provide the cooling power of mist and spread the cool air around a much bigger area. For warehouse cooling, outdoor cooling such as crowd or event cooling, misting fans are also the best choice. For smaller or more confined areas, such as patios and outdoor eating areas, misting systems (nozzle-only) are the better option."
  },
  {
    q: "How is it installed?",
    a: "The tubing can be run under eaves, attached to fencing, hidden amongst shrubbery and plants, or suspended from any convenient structure. The nozzles are positioned to provide maximum coverage for the area to be cooled. Our installation teams are fully trained and can install your system quickly and efficiently."
  },
  {
    q: "Will it work in high humidity?",
    a: "Yes, although the cooling effect is stronger in dry, arid conditions. Even in humid climates, misting systems provide significant relief through direct contact with the fine mist."
  },
  {
    q: "How many nozzles will a pump feed?",
    a: "This depends on the nozzle size and the pump capacity. Our sales team will help you determine the right configuration. Generally, a single pump can feed anywhere from 10 to 50+ nozzles depending on the model."
  },
  {
    q: "What size pump to order?",
    a: "We will help you choose the right pump size based on the area to be covered, the number of nozzles required, and the application. Contact us with your requirements and we will provide a recommendation."
  },
  {
    q: "How much water will it use?",
    a: "This depends on the number and size of nozzles used. A typical residential system uses approximately 1-2 gallons per hour. The water is atomized into such fine droplets that very little water is actually used."
  },
  {
    q: "What is the minimum inlet water pressure?",
    a: "The minimum inlet water pressure required is 1.5 Bar (approximately 22 PSI). The optimal range is 2.0-3.0 Bar (29-44 PSI) for best performance."
  },
  {
    q: "Can tubing be drilled?",
    a: "Yes, our stainless steel tubing can be drilled to add additional nozzle positions. This provides flexibility for future system modifications or additions."
  },
  {
    q: "Do I need a filter?",
    a: "Yes, a 5-micron water filter is recommended to prevent nozzle blockages. Our systems include filters as standard equipment."
  },
  {
    q: "How often should filters be replaced?",
    a: "Filter replacement is recommended every 6 months, or more frequently in areas with poor water quality. Regular filter maintenance ensures consistent system performance."
  },
  {
    q: "Can I install the system myself?",
    a: "Some of our simpler DIY misting systems can be installed by homeowners. However, for complex high-pressure installations, we recommend professional installation to ensure optimal performance and warranty compliance."
  },
  {
    q: "Must the system be serviced?",
    a: "Yearly servicing is recommended to maintain optimal performance. This includes nozzle inspection, filter replacement, pump maintenance, and system pressure checks. We offer maintenance contracts for ongoing support."
  },
  {
    q: "What is the best nozzle for 1000 PSI?",
    a: "For 1000 PSI systems, we recommend nozzles with orifice sizes of 0.006\", 0.008\", or 0.012\". The choice depends on the desired droplet size and coverage area."
  },
  {
    q: "What is the difference between high and low pressure misting?",
    a: "Low-pressure systems operate at 30-85 PSI (standard household water pressure) and produce larger droplets that may not fully evaporate. High-pressure systems operate at 1000 PSI (70 BAR) and produce ultra-fine 8-10 micron droplets that evaporate almost instantly, providing superior cooling without wetness."
  },
  {
    q: "How do I winterize my misting system?",
    a: "In freezing conditions, remove all nozzles and drain the lines completely. Our systems are designed with drain valves for easy winterization."
  },
  {
    q: "Can you provide what I need?",
    a: "With over 37 years of combined industry experience, we can design, supply, install, and maintain misting systems for virtually any application. From residential patios to industrial facilities, we have the expertise and product range to meet your requirements."
  },
  {
    q: "What is your shipping method?",
    a: "We ship worldwide via freight on pallets. Systems are carefully packed to prevent damage during transit. Contact us for shipping quotes to your location."
  }
];

function SolutionsFaq() {
  return (
    <SubPageLayout
      eyebrow="Solutions"
      title="Frequently Asked Questions"
      lede="To make life easier for our customers, we have compiled the most commonly asked misting questions below."
    >
      <Section>
        <div className="max-w-3xl mx-auto space-y-4">
          {faqs.map((faq, i) => (
            <details key={i} className="group border rounded-lg overflow-hidden">
              <summary className="flex items-center justify-between p-5 cursor-pointer bg-white hover:bg-muted/30 transition-colors font-semibold text-lg">
                {faq.q}
                <svg className="w-5 h-5 text-brand-red shrink-0 transition-transform group-open:rotate-180" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
                </svg>
              </summary>
              <div className="px-5 pb-5 text-muted-foreground">
                <p>{faq.a}</p>
              </div>
            </details>
          ))}
        </div>
      </Section>
    </SubPageLayout>
  );
}
