// SEO Configuration for Pounce
// Centralized SEO metadata and structured data

export const SITE_URL = 'https://pounce.ch'
export const SITE_NAME = 'Pounce'
export const DEFAULT_OG_IMAGE = `${SITE_URL}/og-image.png`

export const SEO_CONFIG = {
  home: {
    title: 'Pounce - Domain Intelligence Platform | Find, Track & Trade Domains',
    description: 'Domain intelligence for serious investors. Scan live auctions, track drops, compare TLD pricing, and manage portfolios with a clean market feed and verified listings.',
    keywords: [
      'domain intelligence', 'domain auctions', 'expired domains', 'domain investing',
      'TLD pricing', 'domain drops', 'domain marketplace', 'domain monitoring',
      'domain portfolio', 'domain valuation', 'premium domains', 'domain flipping',
      'godaddy auctions', 'sedo marketplace', 'dropcatch', 'namejet', 'domain trading'
    ],
  },
  discover: {
    title: 'TLD Pricing & Trends 2025 | Compare 800+ Domain Extensions | Pounce',
    description: 'Compare registration and renewal prices for 800+ TLDs. Track price trends, find hidden renewal traps, and discover the best domain extensions for your investment. Updated daily.',
    keywords: [
      'TLD pricing', 'domain extension prices', 'TLD comparison', 'domain renewal costs',
      'cheapest TLDs', 'new gTLDs', 'ccTLD pricing', '.com price', '.io domain cost',
      '.ai domain price', 'domain registration cost', 'TLD trends 2025'
    ],
  },
  acquire: {
    title: 'Domain Auctions & Marketplace | Live Drops & Deals | Pounce',
    description: 'Browse live domain auctions from GoDaddy, Sedo, DropCatch & more. Use filters to cut noise, and discover Pounce Direct listings with DNS-verified owners and 0% commission.',
    keywords: [
      'domain auctions', 'buy domains', 'expired domain auctions', 'domain marketplace',
      'godaddy auctions', 'sedo domains', 'dropcatch', 'namejet auctions',
      'premium domains for sale', 'domain deals', 'cheap domains'
    ],
  },
  yield: {
    title: 'Domain Monetization | Turn Parked Domains into Revenue | Pounce Yield',
    description: 'Stop losing money on parked domains. Pounce Yield uses AI-powered intent routing to monetize your unused domains with up to 70% revenue share. No ads, real affiliate revenue.',
    keywords: [
      'domain monetization', 'parked domain income', 'domain parking alternative',
      'domain revenue', 'affiliate domains', 'intent routing', 'domain yield',
      'passive domain income', 'monetize parked domains'
    ],
  },
  pricing: {
    title: 'Pricing Plans | Scout, Trader, Tycoon | Pounce',
    description: 'Scout, Trader, or Tycoon. Clean market feed, faster monitoring, valuation intel, portfolio tools, and 0% commission on Pounce Direct listings. Tycoon checks every 10 minutes.',
    keywords: [
      'domain tool pricing', 'domain software', 'domain investing tools',
      'domain monitoring service', 'domain alert service', 'domain trading platform'
    ],
  },
}

// Schema.org structured data generators
export function generateOrganizationSchema() {
  return {
    '@context': 'https://schema.org',
    '@type': 'Organization',
    name: 'Pounce',
    url: SITE_URL,
    logo: `${SITE_URL}/pounce-logo.png`,
    description: 'Domain intelligence platform for investors and traders',
    foundingDate: '2024',
    sameAs: [
      'https://twitter.com/pouncedomains',
      'https://github.com/pounce',
    ],
    contactPoint: {
      '@type': 'ContactPoint',
      email: 'hello@pounce.ch',
      contactType: 'Customer Service',
    },
  }
}

export function generateSoftwareApplicationSchema() {
  return {
    '@context': 'https://schema.org',
    '@type': 'SoftwareApplication',
    name: 'Pounce Domain Intelligence',
    applicationCategory: 'BusinessApplication',
    operatingSystem: 'Web',
    url: SITE_URL,
    description: 'Live domain auction aggregation, TLD price tracking, and portfolio management platform',
    offers: [
      {
        '@type': 'Offer',
        name: 'Scout',
        price: '0',
        priceCurrency: 'USD',
        description: 'Free tier with basic features',
      },
      {
        '@type': 'Offer',
        name: 'Trader',
        price: '9',
        priceCurrency: 'USD',
        priceValidUntil: '2025-12-31',
        description: 'Professional tier with curated feeds and hourly alerts',
      },
      {
        '@type': 'Offer',
        name: 'Tycoon',
        price: '29',
        priceCurrency: 'USD',
        priceValidUntil: '2025-12-31',
        description: 'Advanced tier with 10-minute monitoring, priority alerts, and unlimited portfolio',
      },
    ],
  }
}

export function generateTLDPageSchema(tld: string, data: {
  registrationPrice?: number
  renewalPrice?: number
  type?: string
  registrarCount?: number
}) {
  const hasPrices = typeof data.registrationPrice === 'number' || typeof data.renewalPrice === 'number'
  const lowPrice = typeof data.registrationPrice === 'number' ? data.registrationPrice : undefined
  const highPrice = typeof data.renewalPrice === 'number' ? data.renewalPrice : undefined
  return {
    '@context': 'https://schema.org',
    '@type': 'Product',
    name: `.${tld} Domain Extension`,
    description: hasPrices
      ? `Current registrar pricing for .${tld} domains (registration and renewal).`
      : `Registrar comparison and pricing intelligence for .${tld} domains.`,
    url: `${SITE_URL}/tld/${tld}`,
    category: data.type || 'Domain Extension',
    offers: {
      '@type': 'AggregateOffer',
      ...(lowPrice !== undefined ? { lowPrice } : {}),
      ...(highPrice !== undefined ? { highPrice } : {}),
      priceCurrency: 'USD',
      offerCount: data.registrarCount || 1,
    },
  }
}

export function generateBreadcrumbSchema(items: Array<{ name: string; url: string }>) {
  return {
    '@context': 'https://schema.org',
    '@type': 'BreadcrumbList',
    itemListElement: items.map((item, index) => ({
      '@type': 'ListItem',
      position: index + 1,
      name: item.name,
      item: item.url,
    })),
  }
}

export function generateFAQSchema(faqs: Array<{ question: string; answer: string }>) {
  return {
    '@context': 'https://schema.org',
    '@type': 'FAQPage',
    mainEntity: faqs.map(faq => ({
      '@type': 'Question',
      name: faq.question,
      acceptedAnswer: {
        '@type': 'Answer',
        text: faq.answer,
      },
    })),
  }
}

export function generateWebPageSchema(page: {
  title: string
  description: string
  url: string
  datePublished?: string
  dateModified?: string
}) {
  return {
    '@context': 'https://schema.org',
    '@type': 'WebPage',
    name: page.title,
    description: page.description,
    url: page.url,
    isPartOf: {
      '@type': 'WebSite',
      name: SITE_NAME,
      url: SITE_URL,
    },
    ...(page.datePublished ? { datePublished: page.datePublished } : {}),
    ...(page.dateModified ? { dateModified: page.dateModified } : {}),
  }
}

// Popular TLDs for static generation
export const POPULAR_TLDS = [
  'com', 'net', 'org', 'io', 'ai', 'co', 'app', 'dev', 'xyz', 'online',
  'store', 'shop', 'tech', 'site', 'club', 'info', 'biz', 'me', 'tv', 'cc',
  'ch', 'de', 'uk', 'fr', 'es', 'it', 'nl', 'at', 'be', 'pl',
  'au', 'ca', 'us', 'mx', 'br', 'ar', 'jp', 'cn', 'kr', 'in',
  'cloud', 'digital', 'agency', 'studio', 'media', 'design', 'solutions', 'consulting',
  'finance', 'money', 'bank', 'insurance', 'invest', 'capital', 'fund', 'trading',
  'health', 'fitness', 'beauty', 'fashion', 'style', 'luxury', 'vip', 'pro',
  'crypto', 'nft', 'web3', 'blockchain', 'bitcoin', 'defi', 'dao', 'token',
]
