import type { Metadata } from 'next'
import InternalPageTemplate from '@/components/InternalPageTemplate'
import BreadcrumbJsonLd from '@/components/BreadcrumbJsonLd'
import Link from 'next/link'
import { getTranslations } from 'next-intl/server'
import { buildAlternates } from '@/lib/seo'

export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string }>
}): Promise<Metadata> {
  const { locale } = await params
  const t = await getTranslations('seo')
  const { canonical, languages } = buildAlternates(locale, '/hotel-price-comparison')
  return {
    title: t('hotelPriceComparison'),
    description:
      'Compare hotel prices across 100+ countries in seconds. The same room often costs less when searched from a different country — find the cheapest rate on Booking.com, Airbnb, Expedia and more.',
    openGraph: {
      title: 'Hotel Price Comparison — Find the Cheapest Rate Across 100+ Countries',
      description:
        'The same hotel room can cost 20–40% more depending on where you search from. CahooTravel compares prices across 100+ countries so you always book at the cheapest rate.',
      type: 'website',
    },
    alternates: { canonical, languages },
  }
}

const BASE_URL = 'https://www.cahootravel.com'

const articleSchema = {
  '@context': 'https://schema.org',
  '@type': 'Article',
  headline: 'Hotel Price Comparison — Find the Cheapest Rate Across 100+ Countries',
  description:
    'Compare hotel prices across 100+ countries in seconds. The same room often costs less when searched from a different country — find the cheapest rate on Booking.com, Airbnb, Expedia and more.',
  author: { '@type': 'Organization', name: 'CahooTravel' },
  publisher: {
    '@type': 'Organization',
    name: 'CahooTravel',
    logo: { '@type': 'ImageObject', url: `${BASE_URL}/cahootravel-logo.svg` },
  },
  datePublished: '2025-01-15',
  dateModified: '2025-01-15',
  mainEntityOfPage: `${BASE_URL}/hotel-price-comparison`,
}

const faqSchema = {
  '@context': 'https://schema.org',
  '@type': 'FAQPage',
  mainEntity: [
    {
      '@type': 'Question',
      name: 'Is hotel price comparison legal?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'Yes, comparing hotel prices across different markets is completely legal. CahooTravel is a price intelligence tool that fetches publicly available prices and presents them side by side. You then book directly on the platform of your choice — no terms of service are violated.',
      },
    },
    {
      '@type': 'Question',
      name: 'Why do hotels charge different prices in different countries?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'Booking platforms like Booking.com and Airbnb use geo-pricing: they show different prices to users depending on the country the search originates from. Factors include local purchasing power, competition from regional booking sites, market-specific promotions, and algorithmic demand signals. Price gaps of 10–40% are common.',
      },
    },
    {
      '@type': 'Question',
      name: 'Which hotel price comparison tool works without a VPN?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'CahooTravel compares hotel prices across 100+ countries without requiring a VPN. Unlike VPN-based workarounds, CahooTravel uses real browser sessions from country-specific infrastructure, so prices are accurate and booking platforms do not detect or block the comparison.',
      },
    },
    {
      '@type': 'Question',
      name: 'Does CahooTravel add fees to the compared prices?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'No. CahooTravel never adds markup to prices. The prices shown are exactly what the booking platform displays to a user in that country. CahooTravel earns a referral commission from platforms when you book — this does not affect the price you pay.',
      },
    },
    {
      '@type': 'Question',
      name: 'How often are hotel prices updated?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'Prices are fetched in real time when you run a search. CahooTravel does not cache prices — every comparison reflects the live price on each platform at the moment you search.',
      },
    },
    {
      '@type': 'Question',
      name: 'Can I compare prices for apartments and hostels too?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'Yes. CahooTravel supports 23+ platforms including Airbnb and VRBO for apartments, Hostelworld for hostels, and major hotel platforms like Booking.com, Expedia, Hotels.com, and Agoda. Any accommodation listed on a supported platform can be compared.',
      },
    },
  ],
}

export default function HotelPriceComparisonPage() {
  return (
    <InternalPageTemplate>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(articleSchema) }}
      />
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(faqSchema) }}
      />

      <article className="max-w-3xl">
        {/* Header */}
        <div className="mb-10">
          <div className="flex items-center gap-3 mb-4">
            <span className="text-xs font-medium text-brand-purple bg-brand-purple-light px-2.5 py-1 rounded-full">
              Hotel Price Comparison
            </span>
            <span className="text-xs text-gray-400">8 min read</span>
          </div>
          <h1 className="text-4xl font-bold text-gray-900 mb-4 leading-tight">
            Hotel Price Comparison — Find the Cheapest Rate Across 100+ Countries
          </h1>
          <p className="text-gray-500 text-lg leading-relaxed">
            The same hotel room can cost 20–40% more or less depending on the country you search
            from. Most travellers never discover this — they book from their home country and
            overpay. CahooTravel compares hotel prices across 100+ countries simultaneously so you
            always find the cheapest available rate, no VPN required.
          </p>
        </div>

        {/* Featured image */}
        <div className="mb-10 rounded-2xl overflow-hidden aspect-[16/7]">
          <img
            src="/hotel-price-comparison.jpg"
            alt="Side-by-side hotel price comparison showing different rates by country"
            className="w-full h-full object-cover"
          />
        </div>

        <div className="prose prose-gray max-w-none text-sm leading-relaxed space-y-8">

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              Why hotel prices differ by country
            </h2>
            <p className="text-gray-600">
              Hotel booking platforms — Booking.com, Airbnb, Expedia, Agoda and others — use a
              practice called <strong>geo-pricing</strong> (geographic price discrimination). The
              price displayed for a hotel room is not fixed; it is dynamically adjusted based on
              where in the world the search originates. A room at a Tokyo hotel might cost ¥28,000
              to a Japanese searcher, ¥33,500 to someone in the United States, and ¥31,000 to
              someone in Germany — at the same moment, for the same room, on the same platform.
            </p>
            <p className="text-gray-600 mt-3">
              This happens because platforms use your IP address, browser language settings, and
              account history to infer your country, then apply market-specific pricing algorithms.
              Factors that drive differences include local purchasing power (high-income markets are
              priced higher), competition from regional booking sites (Ctrip in China, Jalan in
              Japan), country-specific promotional discounts, and historical booking behaviour by
              market segment. Price gaps of <strong>10–40%</strong> are common. In specific
              markets and destination types, gaps above 50% have been observed.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              How hotel price comparison works
            </h2>
            <p className="text-gray-600">
              Traditional hotel search engines (Google Hotels, Trivago, Kayak) compare prices
              across platforms — but always from a single geographic perspective. They show you the
              best price <em>visible from your country</em>. The real cheapest price, visible only
              to users searching from a different country, remains hidden.
            </p>
            <p className="text-gray-600 mt-3">
              CahooTravel solves this in three steps:
            </p>
            <ol className="list-decimal pl-5 space-y-3 text-gray-600 mt-3">
              <li>
                <strong>Paste the hotel link.</strong> Find any hotel on Booking.com, Airbnb,
                Expedia, or any of the 23+ supported platforms and copy the URL. Paste it into
                CahooTravel — no setup or account configuration needed.
              </li>
              <li>
                <strong>We search across 100+ countries.</strong> CahooTravel fetches the exact
                hotel page as it appears to users in each country, using real browser sessions from
                country-specific infrastructure. This means prices are accurate — not estimates,
                not cached data, not VPN-based approximations.
              </li>
              <li>
                <strong>You book directly at the cheapest rate.</strong> Results show which country
                has the lowest price and by how much. You are linked directly to the hotel page at
                that price. The booking is made between you and the platform — CahooTravel is
                never involved in the transaction.
              </li>
            </ol>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              Which platforms does CahooTravel compare?
            </h2>
            <p className="text-gray-600">
              CahooTravel currently supports <strong>23+ booking platforms</strong>, covering
              hotels, apartments, hostels, and vacation rentals. Any accommodation listed on a
              supported platform can be compared across all available countries in a single search.
            </p>
            <p className="text-gray-600 mt-3">
              Supported platforms include: Booking.com, Airbnb, Expedia, Hotels.com, Agoda,
              Trip.com, VRBO, Hostelworld, MakeMyTrip, Priceline, HotelsCombined, Trivago,
              LastMinute, eDreams, Orbitz, Travelocity, HRS, Hotelopia, Despegar, Naver Travel,
              Rakuten Travel, Jalan, and more. New platforms are added regularly.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              Hotel price comparison vs using a VPN
            </h2>
            <p className="text-gray-600">
              VPNs are often suggested as a way to access cheaper hotel prices by masking your
              location. In practice, this approach has significant limitations that make it
              unreliable for hotel bookings:
            </p>
            <div className="bg-gray-50 rounded-xl border border-gray-100 overflow-hidden mt-4">
              <table className="w-full text-sm">
                <thead>
                  <tr className="bg-gray-100 text-left">
                    <th className="px-4 py-3 font-semibold text-gray-700">Factor</th>
                    <th className="px-4 py-3 font-semibold text-gray-700">VPN</th>
                    <th className="px-4 py-3 font-semibold text-gray-700">CahooTravel</th>
                  </tr>
                </thead>
                <tbody className="divide-y divide-gray-100">
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Speed</td>
                    <td className="px-4 py-3 text-gray-600">Slow — manual, one country at a time</td>
                    <td className="px-4 py-3 text-green-700 font-medium">Seconds — 100+ countries at once</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Price accuracy</td>
                    <td className="px-4 py-3 text-gray-600">Unreliable — VPN IPs often detected and blocked</td>
                    <td className="px-4 py-3 text-green-700 font-medium">Live prices from real country infrastructure</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Booking risk</td>
                    <td className="px-4 py-3 text-gray-600">Payment method mismatch can flag fraud</td>
                    <td className="px-4 py-3 text-green-700 font-medium">None — you book directly, no mismatch</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Works on mobile</td>
                    <td className="px-4 py-3 text-gray-600">Requires VPN app, complex setup</td>
                    <td className="px-4 py-3 text-green-700 font-medium">Yes — any browser, no setup</td>
                  </tr>
                  <tr>
                    <td className="px-4 py-3 text-gray-600">Cost</td>
                    <td className="px-4 py-3 text-gray-600">€5–15/month for a reliable service</td>
                    <td className="px-4 py-3 text-green-700 font-medium">Free to start, paid plans from €4.99/mo</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <p className="text-gray-500 text-xs mt-2">
              Major booking platforms actively detect commercial VPN IP ranges and either block
              access or revert to default pricing. CahooTravel uses residential-grade infrastructure
              that is not flagged as VPN traffic.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-3">
              How much can travellers actually save?
            </h2>
            <p className="text-gray-600">
              Based on searches run through CahooTravel, a price gap exists in the majority of
              hotel searches — meaning the same room is cheaper when searched from a different
              country than where the traveller is located. Average savings when a gap is found
              range from <strong>€20 to €60 per booking per night</strong>, with larger gaps on longer stays
              and higher-tier properties.
            </p>
            <p className="text-gray-600 mt-3">
              Two common scenarios illustrate the scale of the opportunity:
            </p>
            <ul className="list-disc pl-5 space-y-3 text-gray-600 mt-3">
              <li>
                <strong>European traveller booking in Asia.</strong> A traveller in Germany booking
                a hotel in Bangkok or Tokyo may see prices 25–40% higher than what the same room
                costs when searched from within Southeast or East Asia. On a 7-night stay, the
                saving can exceed €150.
              </li>
              <li>
                <strong>US traveller booking in Europe.</strong> US-origin searches often see
                higher prices on UK and Western European hotels compared to searches from Eastern
                European countries. A Paris hotel that shows $220/night from New York may show
                €155/night ($168) when compared from Romania or Bulgaria.
              </li>
            </ul>
          </section>

          {/* CTA */}
          <div className="rounded-2xl bg-brand-purple text-white p-8 flex flex-col md:flex-row items-center justify-between gap-6 mt-4">
            <div>
              <h3 className="text-lg font-bold mb-1">
                See if your next hotel is cheaper elsewhere
              </h3>
              <p className="text-purple-200 text-sm">
                Paste any Booking.com, Airbnb, or Expedia link and compare prices across 100+
                countries for free.
              </p>
            </div>
            <Link
              href="/"
              className="flex-shrink-0 bg-brand-yellow hover:bg-brand-yellow-dark text-gray-900 font-medium text-sm px-6 py-2.5 rounded-md transition-colors whitespace-nowrap"
            >
              Compare hotel prices →
            </Link>
          </div>

          {/* FAQ */}
          <section>
            <h2 className="text-2xl font-bold text-gray-900 mb-6">
              Frequently asked questions
            </h2>
            <div className="space-y-6">
              {[
                {
                  q: 'Is hotel price comparison legal?',
                  a: 'Yes, comparing hotel prices across different markets is completely legal. CahooTravel is a price intelligence tool that fetches publicly available prices and presents them side by side. You then book directly on the platform of your choice — no terms of service are violated.',
                },
                {
                  q: 'Why do hotels charge different prices in different countries?',
                  a: 'Booking platforms like Booking.com and Airbnb use geo-pricing: they show different prices depending on the country a search originates from. Factors include local purchasing power, competition from regional booking sites, market-specific promotions, and algorithmic demand signals. Price gaps of 10–40% are common.',
                },
                {
                  q: 'Which hotel price comparison tool works without a VPN?',
                  a: 'CahooTravel compares hotel prices across 100+ countries without requiring a VPN. Unlike VPN-based workarounds, CahooTravel uses real browser sessions from country-specific infrastructure, so prices are accurate and booking platforms do not detect or block the comparison.',
                },
                {
                  q: 'Does CahooTravel add fees to the compared prices?',
                  a: "No. CahooTravel never adds markup to prices. The prices shown are exactly what the booking platform displays to a user in that country. CahooTravel earns a referral commission from platforms when you book — this does not affect the price you pay.",
                },
                {
                  q: 'How often are hotel prices updated?',
                  a: 'Prices are fetched in real time when you run a search. CahooTravel does not cache prices — every comparison reflects the live price on each platform at the moment you search.',
                },
                {
                  q: 'Can I compare prices for apartments and hostels too?',
                  a: 'Yes. CahooTravel supports 23+ platforms including Airbnb and VRBO for apartments, Hostelworld for hostels, and major hotel platforms like Booking.com, Expedia, Hotels.com, and Agoda. Any accommodation listed on a supported platform can be compared.',
                },
              ].map(({ q, a }) => (
                <div key={q} className="border-t border-gray-100 pt-5">
                  <h3 className="text-sm font-semibold text-gray-900 mb-2">{q}</h3>
                  <p className="text-gray-600 text-sm">{a}</p>
                </div>
              ))}
            </div>
          </section>

        </div>
      </article>

      <BreadcrumbJsonLd items={[{ name: 'Hotel Price Comparison' }]} />
    </InternalPageTemplate>
  )
}
