// seo.jsx — per-route SEO meta layer for ruuapi landing
'use strict';

const SEO_META = {
  '/': {
    title: {
      en: 'ruuapi: Get Cited by ChatGPT, Perplexity & AI Overviews',
      tr: 'ruuapi: ChatGPT ve Perplexity’de Alıntı Alın (İstanbul/Türkiye)',
      de: 'ruuapi: In ChatGPT & Perplexity zitiert werden (Berlin/München)',
      es: 'ruuapi: Consigue Citas en ChatGPT y Perplexity (Madrid/Barcelona)',
      fr: 'ruuapi: Soyez cité par ChatGPT et Perplexity (Paris/Lyon)',
      pt: 'ruuapi: Seja citado no ChatGPT e Perplexity (Lisboa/São Paulo)',
      ja: 'ruuapi: ChatGPTやPerplexityで引用を獲得する (東京/日本)'
    },
    description: {
      en: 'AI-native content engine for AEO and GEO. Help your website get cited by ChatGPT, Perplexity, SearchGPT, and Google AI Overviews.',
      tr: 'AEO ve GEO için yapay zeka içerik motoru. İstanbul merkezli işletmeler için ChatGPT ve Google AI Overviews’da görünürlük kazanın.',
      de: 'KI-native Content-Engine für AEO & GEO. Optimieren Sie Ihre Website für ChatGPT und Perplexity in Berlin, München und weltweit.',
      es: 'Motor de contenido para AEO y GEO. Optimiza tu web para aparecer en ChatGPT y Perplexity desde Madrid hasta Ciudad de México.',
      fr: 'Moteur de contenu natif IA pour l\'AEO et le GEO. Soyez cité par ChatGPT et Perplexity à Paris, Lyon et partout ailleurs.',
      pt: 'Motor de conteúdo IA para AEO e GEO. Ajude o seu site a ser citado pelo ChatGPT e Perplexity em Lisboa e São Paulo.',
      ja: 'AEOとGEOのためのAIネイティブコンテンツエンジン。ChatGPT、Perplexity、Google AI Overviewsでの引用獲得を支援します。'
    },
    og: { image: '/og/home.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['AI SEO', 'AEO', 'GEO', 'ChatGPT citations', 'Perplexity SEO', 'SearchGPT', 'ruuapi', 'content engine'],
    canonical: 'https://ruuapi.com/',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'Organization',
        'name': 'ruuapi',
        'url': 'https://ruuapi.com',
        'logo': 'https://ruuapi.com/logo.png',
        'sameAs': ['https://twitter.com/ruuapi', 'https://linkedin.com/company/ruuapi']
      },
      {
        '@context': 'https://schema.org',
        '@type': 'WebSite',
        'url': 'https://ruuapi.com',
        'potentialAction': {
          '@type': 'SearchAction',
          'target': 'https://ruuapi.com/tools?q={search_term_string}',
          'query-input': 'required name=search_term_string'
        }
      },
      {
        '@context': 'https://schema.org',
        '@type': 'BreadcrumbList',
        'itemListElement': [{ '@type': 'ListItem', 'position': 1, 'name': 'Home', 'item': 'https://ruuapi.com/' }]
      }
    ]
  },
  '/pricing': {
    title: {
      en: 'Pricing Plans - Scalable AI SEO Solutions | ruuapi',
      tr: 'Fiyatlandırma - Ölçeklenebilir Yapay Zeka SEO Çözümleri',
      de: 'Preise - Skalierbare KI-SEO-Lösungen für Ihr Unternehmen',
      es: 'Precios - Soluciones de SEO con IA Escalables',
      fr: 'Tarifs - Solutions SEO IA Évolutives | ruuapi',
      pt: 'Preços - Soluções de SEO com IA Escaláveis',
      ja: '料金プラン - スケーラブルなAI SEOソリューション'
    },
    description: {
      en: 'Transparent pricing for AI-native content optimization. Choose the plan that fits your growth, from startups to enterprises.',
      tr: 'Yapay zeka içerik optimizasyonu için şeffaf fiyatlandırma. Türkiye’deki girişimlerden büyük şirketlere uygun paketler.',
      de: 'Transparente Preise für KI-Content-Optimierung. Passende Pläne für Startups und Unternehmen in DACH.',
      es: 'Precios transparentes para optimización de contenido con IA. Planes flexibles para agencias y empresas.',
      fr: 'Des tarifs transparents pour l\'optimisation IA. Choisissez le forfait qui convient à votre croissance.',
      pt: 'Preços transparentes para otimização de conteúdo com IA. Planos para startups e empresas globais.',
      ja: 'AIネイティブなコンテンツ最適化のための透明性の高い料金プラン。スタートアップから企業まで対応。'
    },
    og: { image: '/og/pricing.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['ruuapi pricing', 'AI SEO cost', 'AEO tools pricing', 'GEO software plans', 'content engine pricing'],
    canonical: 'https://ruuapi.com/pricing',
    jsonld: [
      { '@context': 'https://schema.org', '@type': 'WebPage', 'name': 'Pricing - ruuapi' },
      {
        '@context': 'https://schema.org',
        '@type': 'FAQPage',
        'mainEntity': [
          {
            '@type': 'Question',
            'name': 'Is there a free trial?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Yes, ruuapi offers a free tier with limited credits to test our AEO features.' }
          },
          {
            '@type': 'Question',
            'name': 'Can I change plans anytime?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Absolutely. You can upgrade or downgrade your subscription at any time from your dashboard.' }
          },
          {
            '@type': 'Question',
            'name': 'Do you offer enterprise custom plans?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Yes, for large scale content needs, contact our sales team for a custom quote.' }
          }
        ]
      }
    ]
  },
  '/tools': {
    title: {
      en: 'Free AI SEO & AEO Tools - Optimize Your Content | ruuapi',
      tr: 'Ücretsiz Yapay Zeka SEO ve AEO Araçları | ruuapi',
      de: 'Kostenlose KI-SEO & AEO Tools für Ihre Website',
      es: 'Herramientas Gratuitas de SEO con IA y AEO',
      fr: 'Outils SEO IA et AEO Gratuits | ruuapi',
      pt: 'Ferramentas Gratuitas de SEO com IA e AEO',
      ja: '無料のAI SEO & AEO ツール - コンテンツ最適化'
    },
    description: {
      en: 'Access our suite of free tools including Schema Generator, llms.txt creator, and AEO checker to boost your AI visibility.',
      tr: 'Yapay zeka görünürlüğünüzü artırmak için Schema oluşturucu ve AEO denetleyici gibi ücretsiz araçlarımızı kullanın.',
      de: 'Nutzen Sie unsere kostenlosen Tools wie Schema-Generator und AEO-Checker für bessere KI-Sichtbarkeit.',
      es: 'Accede a herramientas gratuitas: Generador de Schema, creador de llms.txt y verificador de AEO.',
      fr: 'Accédez à nos outils gratuits : Générateur de Schema, créateur llms.txt et testeur AEO.',
      pt: 'Aceda às nossas ferramentas gratuitas: Gerador de Schema, criador de llms.txt e verificador AEO.',
      ja: 'AI可視性を向上させるためのSchemaジェネレーター、llms.txt作成、AEOチェッカーをご利用ください。'
    },
    og: { image: '/og/tools.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['AI SEO tools', 'AEO tools', 'GEO tools', 'free SEO utilities', 'Schema generator', 'llms.txt'],
    canonical: 'https://ruuapi.com/tools',
    jsonld: [
      { '@context': 'https://schema.org', '@type': 'WebPage', 'name': 'Tools - ruuapi' },
      {
        '@context': 'https://schema.org',
        '@type': 'CollectionPage',
        'hasPart': [
          { '@type': 'SoftwareApplication', 'name': 'Schema Generator', 'applicationCategory': 'SEO' },
          { '@type': 'SoftwareApplication', 'name': 'llms.txt Generator', 'applicationCategory': 'SEO' }
        ]
      }
    ]
  },
  '/tools/schema-generator': {
    title: {
      en: 'AI-Native JSON-LD Schema Generator | ruuapi',
      tr: 'Yapay Zeka Destekli JSON-LD Schema Oluşturucu',
      de: 'KI-basierter JSON-LD Schema Generator | ruuapi',
      es: 'Generador de Schema JSON-LD para IA',
      fr: 'Générateur de Schema JSON-LD natif IA',
      pt: 'Gerador de Schema JSON-LD para IA',
      ja: 'AIネイティブ JSON-LD Schema ジェネレーター'
    },
    description: {
      en: 'Generate SEO-optimized JSON-LD schema specifically designed to help AI agents and LLMs understand your content better.',
      tr: 'Yapay zeka ajanlarının içeriğinizi daha iyi anlamasını sağlayan SEO uyumlu JSON-LD şemaları oluşturun.',
      de: 'Erstellen Sie SEO-optimierte JSON-LD Schemas, damit KI-Agenten und LLMs Ihre Inhalte besser verstehen.',
      es: 'Genera esquemas JSON-LD optimizados para que los agentes de IA y LLM entiendan mejor tu contenido.',
      fr: 'Générez des schémas JSON-LD optimisés pour aider les agents IA et les LLM à comprendre votre contenu.',
      pt: 'Gere esquemas JSON-LD otimizados para ajudar agentes de IA e LLMs a compreenderem o seu conteúdo.',
      ja: 'AIエージェントやLLMがコンテンツをより良く理解できるように設計されたJSON-LD Schemaを生成します。'
    },
    og: { image: '/og/schema-generator.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['schema generator', 'JSON-LD', 'AI schema', 'SEO structured data', 'LLM optimization'],
    canonical: 'https://ruuapi.com/tools/schema-generator',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'SoftwareApplication',
        'name': 'ruuapi Schema Generator',
        'applicationCategory': 'SEO Tool',
        'operatingSystem': 'Web',
        'offers': { '@type': 'Offer', 'price': '0', 'priceCurrency': 'USD' }
      },
      {
        '@context': 'https://schema.org',
        '@type': 'FAQPage',
        'mainEntity': [
          {
            '@type': 'Question',
            'name': 'What is an AI schema?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'It is structured data optimized for Large Language Models to index your facts correctly.' }
          },
          {
            '@type': 'Question',
            'name': 'Is this tool free?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Yes, our Schema Generator is free to use for all users.' }
          },
          {
            '@type': 'Question',
            'name': 'Does it support Organization schema?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Yes, it supports Organization, Product, Article, and many more.' }
          }
        ]
      }
    ]
  },
  '/tools/llms-txt-generator': {
    title: {
      en: 'llms.txt Generator — Spec-compliant, grade A-F, free hosting | ruuapi',
      tr: 'llms.txt Oluşturucu - Yapay Zeka Botlarını Yönlendirin',
      de: 'llms.txt Generator - KI-Crawler richtig führen',
      es: 'Generador de llms.txt - Guía a los Crawlers de IA',
      fr: 'Générateur llms.txt - Guidez les robots IA',
      pt: 'Gerador de llms.txt - Guie os Crawlers de IA',
      ja: 'llms.txt ジェネレーター - AIクローラーをガイド'
    },
    description: {
      en: 'Build, validate, and host your llms.txt. Free. A-F grade. Bot telemetry. AI-native by design.',
      tr: 'Claude ve ChatGPT gibi LLM’ler için web sitenizin kök dizinine uygun llms.txt dosyası oluşturun.',
      de: 'Erstellen Sie eine llms.txt Datei, um LLMs wie Claude und ChatGPT strukturierten Kontext zu liefern.',
      es: 'Crea un archivo llms.txt para proporcionar contexto en markdown a LLMs como Claude y ChatGPT.',
      fr: 'Créez un fichier llms.txt pour fournir un contexte en markdown aux LLM comme Claude et ChatGPT.',
      pt: 'Crie um ficheiro llms.txt para fornecer contexto em markdown a LLMs como o Claude e o ChatGPT.',
      ja: 'ClaudeやChatGPTなどのLLMに高コンテキストなマークダウンを提供するためのllms.txtファイルを作成します。'
    },
    og: { image: '/og/llms-txt-generator.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['llms.txt', 'markdown for AI', 'crawler guidance', 'Claude optimization', 'ChatGPT bot'],
    canonical: 'https://ruuapi.com/tools/llms-txt-generator',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'SoftwareApplication',
        'name': 'llms.txt Generator',
        'applicationCategory': 'Developer Tool',
        'operatingSystem': 'Web'
      },
      {
        '@context': 'https://schema.org',
        '@type': 'FAQPage',
        'mainEntity': [
          {
            '@type': 'Question',
            'name': 'What is llms.txt?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'A standard file for providing a site map and context specifically for LLMs.' }
          },
          {
            '@type': 'Question',
            'name': 'Where should I upload it?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Upload it to the root of your domain, e.g., yoursite.com/llms.txt.' }
          },
          {
            '@type': 'Question',
            'name': 'How does it help SEO?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'It ensures AI agents cite your content more accurately and frequently.' }
          }
        ]
      }
    ]
  },
  '/tools/aeo-checker': {
    title: {
      en: 'AEO Checker - Analyze Your AI Visibility | ruuapi',
      tr: 'AEO Denetleyici - Yapay Zeka Görünürlüğünüzü Analiz Edin',
      de: 'AEO Checker - Analysieren Sie Ihre KI-Sichtbarkeit',
      es: 'AEO Checker - Analiza tu Visibilidad en IA',
      fr: 'Testeur AEO - Analysez votre visibilité IA',
      pt: 'AEO Checker - Analise a sua Visibilidade em IA',
      ja: 'AEOチェッカー - AI可視性を分析'
    },
    description: {
      en: 'Check how often your brand is cited in AI responses. Coming soon: real-time AEO scoring and GEO auditing.',
      tr: 'Markanızın yapay zeka yanıtlarında ne sıklıkla geçtiğini kontrol edin. Yakında: Gerçek zamanlı AEO puanlama.',
      de: 'Prüfen Sie, wie oft Ihre Marke in KI-Antworten zitiert wird. Demnächst: Echtzeit AEO-Scoring.',
      es: 'Comprueba con qué frecuencia se cita tu marca en la IA. Próximamente: puntuación AEO en tiempo real.',
      fr: 'Vérifiez à quelle fréquence votre marque est citée par l\'IA. Bientôt : score AEO en temps réel.',
      pt: 'Verifique a frequência com que a sua marca é citada na IA. Em breve: pontuação AEO em tempo real.',
      ja: 'AIの回答でブランドがどの程度引用されているかを確認。近日公開：リアルタイムAEOスコアリング。'
    },
    og: { image: '/og/aeo-checker.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['AEO checker', 'AI visibility score', 'GEO audit', 'answer engine optimization', 'AI ranking'],
    canonical: 'https://ruuapi.com/tools/aeo-checker',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'SoftwareApplication',
        'name': 'AEO Checker',
        'applicationCategory': 'Analytics',
        'description': 'Analyze Answer Engine Optimization performance.'
      },
      {
        '@context': 'https://schema.org',
        '@type': 'FAQPage',
        'mainEntity': [
          {
            '@type': 'Question',
            'name': 'Is the AEO Checker available?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'It is currently in private beta and coming soon to the public.' }
          },
          {
            '@type': 'Question',
            'name': 'What does it measure?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'It measures citation share, sentiment, and accuracy in AI-generated answers.' }
          },
          {
            '@type': 'Question',
            'name': 'Can I track competitors?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Yes, the full version allows benchmarking against your industry competitors.' }
          }
        ]
      }
    ]
  },
  '/tools/citation-lookup': {
    title: {
      en: 'Citation Lookup - Track AI References | ruuapi',
      tr: 'Alıntı Arama - Yapay Zeka Referanslarını Takip Edin',
      de: 'Citation Lookup - KI-Referenzen nachverfolgen',
      es: 'Buscador de Citas - Rastrea Referencias en IA',
      fr: 'Recherche de citations - Suivez les références IA',
      pt: 'Pesquisa de Citações - Monitorize Referências em IA',
      ja: '引用ルックアップ - AIリファレンスを追跡'
    },
    description: {
      en: 'Discover which LLMs are citing your website. Track mentions across Perplexity, SearchGPT, and Google AI Overviews.',
      tr: 'Hangi yapay zeka modellerinin sitenizden alıntı yaptığını keşfedin. Perplexity ve SearchGPT verilerini takip edin.',
      de: 'Finden Sie heraus, welche LLMs Ihre Website zitieren. Verfolgen Sie Erwähnungen in Perplexity und SearchGPT.',
      es: 'Descubre qué LLM están citando tu web. Rastrea menciones en Perplexity, SearchGPT y Google AI Overviews.',
      fr: 'Découvrez quels LLM citent votre site web. Suivez les mentions sur Perplexity et SearchGPT.',
      pt: 'Descubra quais LLMs estão a citar o seu site. Monitorize menções no Perplexity e SearchGPT.',
      ja: 'どのLLMがあなたのサイトを引用しているかを調査。PerplexityやSearchGPTでの言及を追跡します。'
    },
    og: { image: '/og/citation-lookup.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['AI citation tracking', 'backlinks from AI', 'SearchGPT references', 'Perplexity citations', 'GEO analytics'],
    canonical: 'https://ruuapi.com/tools/citation-lookup',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'SoftwareApplication',
        'name': 'Citation Lookup',
        'applicationCategory': 'Analytics Tool'
      },
      {
        '@context': 'https://schema.org',
        '@type': 'FAQPage',
        'mainEntity': [
          {
            '@type': 'Question',
            'name': 'Which AI engines are supported?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'We support Perplexity, SearchGPT, Google AI Overviews, and Bing Chat.' }
          },
          {
            '@type': 'Question',
            'name': 'How accurate is the lookup?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'We use high-frequency scanning to capture citations with over 98% accuracy.' }
          },
          {
            '@type': 'Question',
            'name': 'Is this a free tool?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Basic lookup is free; history and depth tracking require a pro plan.' }
          }
        ]
      }
    ]
  },
  '/docs': {
    title: { en: 'Documentation - ruuapi AI SEO Guide', tr: 'Dokümantasyon - ruuapi Rehberi', de: 'Dokumentation - ruuapi Handbuch', es: 'Documentación - Guía de ruuapi', fr: 'Documentation - Guide ruuapi', pt: 'Documentação - Guia ruuapi', ja: 'ドキュメント - ruuapi ガイド' },
    description: { en: 'Complete guide to integrating ruuapi and optimizing your content for AI Answer Engines.', tr: 'ruuapi entegrasyonu ve içerik optimizasyonu için kapsamlı rehber.', de: 'Vollständiger Leitfaden zur Integration von ruuapi.', es: 'Guía completa para integrar ruuapi y optimizar contenido.', fr: 'Guide complet pour intégrer ruuapi et optimiser votre contenu.', pt: 'Guia completo para integrar a ruuapi e otimizar o seu conteúdo.', ja: 'ruuapiの統合とAI回答エンジン向けのコンテンツ最適化ガイド。' },
    og: { image: '/og/docs.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['ruuapi documentation', 'AI SEO guide', 'AEO integration', 'GEO technical docs'],
    canonical: 'https://ruuapi.com/docs',
    jsonld: [{ '@context': 'https://schema.org', '@type': 'WebPage', 'name': 'Documentation' }]
  },
  '/contact': {
    title: {
      en: 'Contact ruuapi — Talk to a human, we read everything',
      tr: 'ruuapi ile İletişim — Bir insanla konuşun, her şeyi okuyoruz',
      de: 'Kontakt ruuapi — Sprechen Sie mit einem Menschen',
      es: 'Contacto ruuapi — Hable con una persona, leemos todo',
      fr: 'Contact ruuapi — Parlez à un humain, nous lisons tout',
      pt: 'Contacto ruuapi — Fale com uma pessoa, lemos tudo',
      ja: 'ruuapi お問い合わせ — 人間が対応します。すべて読んでいます'
    },
    description: {
      en: 'Sales, support, partnership, press. Email or fill the form. Response within 24h on weekdays.',
      tr: 'Satış, destek, iş birliği, basın. E-posta gönderin veya formu doldurun. Hafta içi 24 saat içinde yanıt.',
      de: 'Sales, Support, Partnerschaft, Presse. E-Mail oder Formular. Antwort innerhalb von 24h an Werktagen.',
      es: 'Ventas, soporte, alianzas, prensa. Email o formulario. Respuesta en 24h entre semana.',
      fr: 'Ventes, support, partenariat, presse. Email ou formulaire. Réponse sous 24h en semaine.',
      pt: 'Vendas, suporte, parceria, imprensa. Email ou formulário. Resposta em 24h durante a semana.',
      ja: '営業、サポート、パートナーシップ、プレス。メールまたはフォームで。平日24時間以内に返信。'
    },
    og: { image: '/og/contact.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['contact ruuapi', 'AI SEO support', 'ruuapi sales', 'partnerships', 'press ruuapi'],
    canonical: 'https://ruuapi.com/contact',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'ContactPage',
        'name': 'Contact ruuapi',
        'description': 'Sales, support, partnership, and press inquiries for ruuapi.',
        'url': 'https://ruuapi.com/contact',
        'contactPoint': {
          '@type': 'ContactPoint',
          'email': 'info@ndr.ist',
          'contactType': 'customer support',
          'availableLanguage': ['English', 'Turkish']
        }
      },
      {
        '@context': 'https://schema.org',
        '@type': 'BreadcrumbList',
        'itemListElement': [
          { '@type': 'ListItem', 'position': 1, 'name': 'Home', 'item': 'https://ruuapi.com/' },
          { '@type': 'ListItem', 'position': 2, 'name': 'Contact', 'item': 'https://ruuapi.com/contact' }
        ]
      }
    ]
  },
  '/start': {
    title: {
      en: 'Try ruuapi free — 1,200 tokens, no card required',
      tr: 'ruuapi\'yi ücretsiz dene — 1.200 token, kredi kartı gerekmez',
      de: 'ruuapi kostenlos testen — 1.200 Token, keine Kreditkarte',
      es: 'Prueba ruuapi gratis — 1.200 tokens, sin tarjeta',
      fr: 'Essayez ruuapi gratuitement — 1 200 jetons, sans carte',
      pt: 'Experimente o ruuapi grátis — 1.200 tokens, sem cartão',
      ja: 'ruuapiを無料で試す — 1,200トークン、カード不要'
    },
    description: {
      en: 'Get a fully-cited article in your inbox in 5 minutes. No credit card. No signup friction. Just your topic and email.',
      tr: 'E-postanıza 5 dakika içinde tam alıntılı bir makale alın. Kredi kartı gerekmez. Sadece konunuzu ve e-postanızı girin.',
      de: 'Erhalten Sie in 5 Minuten einen vollständig zitierten Artikel in Ihrem Posteingang. Keine Kreditkarte erforderlich.',
      es: 'Recibe un artículo completamente citado en tu bandeja de entrada en 5 minutos. Sin tarjeta de crédito.',
      fr: 'Recevez un article entièrement cité dans votre boîte mail en 5 minutes. Sans carte bancaire.',
      pt: 'Receba um artigo completamente citado na sua caixa de entrada em 5 minutos. Sem cartão de crédito.',
      ja: '5分以内に完全に引用されたArticleがメールで届きます。クレジットカード不要。'
    },
    og: { image: '/og/home.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['ruuapi free trial', 'AI article generator', 'free AI SEO', 'no credit card AI', 'GEO article'],
    canonical: 'https://ruuapi.com/start',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'WebPage',
        'name': 'Try ruuapi free',
        'description': 'Get a fully-cited article in your inbox in 5 minutes.',
        'url': 'https://ruuapi.com/start'
      },
      {
        '@context': 'https://schema.org',
        '@type': 'BreadcrumbList',
        'itemListElement': [
          { '@type': 'ListItem', 'position': 1, 'name': 'Home', 'item': 'https://ruuapi.com/' },
          { '@type': 'ListItem', 'position': 2, 'name': 'Free Trial', 'item': 'https://ruuapi.com/start' }
        ]
      }
    ]
  },
  '/docs': {
    title: {
      en: 'API Docs — ruuapi · Schema, llms.txt, validation tools',
      tr: 'API Dokümantasyonu — ruuapi · Schema, llms.txt, doğrulama araçları',
      de: 'API Dokumentation — ruuapi · Schema, llms.txt, Validierungstools',
      es: 'Documentación API — ruuapi · Schema, llms.txt, herramientas de validación',
      fr: 'Documentation API — ruuapi · Schema, llms.txt, outils de validation',
      pt: 'Documentação API — ruuapi · Schema, llms.txt, ferramentas de validação',
      ja: 'API ドキュメント — ruuapi · Schema、llms.txt、検証ツール'
    },
    description: {
      en: 'Free API for schema markup, llms.txt generation, validation. 8 endpoints. Open to LLM agents. curl, Python, JS examples.',
      tr: 'Schema işaretlemesi, llms.txt oluşturma ve doğrulama için ücretsiz API. 8 uç nokta. LLM ajanlarına açık. curl, Python, JS örnekleri.',
      de: 'Kostenlose API für Schema-Markup, llms.txt-Generierung, Validierung. 8 Endpunkte. Offen für LLM-Agenten. curl, Python, JS Beispiele.',
      es: 'API gratuita para schema markup, generación de llms.txt, validación. 8 endpoints. Abierto a agentes LLM. Ejemplos en curl, Python, JS.',
      fr: 'API gratuite pour schema markup, génération de llms.txt, validation. 8 endpoints. Ouvert aux agents LLM. Exemples curl, Python, JS.',
      pt: 'API gratuita para schema markup, geração de llms.txt, validação. 8 endpoints. Aberto a agentes LLM. Exemplos curl, Python, JS.',
      ja: 'スキーママークアップ、llms.txt生成、検証のための無料API。8エンドポイント。LLMエージェント向けに開放。curl、Python、JS例付き。'
    },
    og: { image: '/og/docs.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['API docs', 'ruuapi API', 'schema API', 'llms.txt API', 'JSON-LD generator API', 'LLM agent API', 'free SEO API'],
    canonical: 'https://ruuapi.com/docs',
    jsonld: [
      {
        '@context': 'https://schema.org',
        '@type': 'TechArticle',
        'name': 'ruuapi API Documentation',
        'description': 'Free API for schema markup, llms.txt generation, and validation. Open to LLM agents.',
        'url': 'https://ruuapi.com/docs',
        'author': { '@type': 'Organization', 'name': 'ruuapi' },
        'datePublished': '2026-05-15',
        'dateModified': '2026-05-15'
      },
      {
        '@context': 'https://schema.org',
        '@type': 'BreadcrumbList',
        'itemListElement': [
          { '@type': 'ListItem', 'position': 1, 'name': 'Home', 'item': 'https://ruuapi.com/' },
          { '@type': 'ListItem', 'position': 2, 'name': 'API Docs', 'item': 'https://ruuapi.com/docs' }
        ]
      },
      {
        '@context': 'https://schema.org',
        '@type': 'HowTo',
        'name': 'How to call the schema-build endpoint',
        'description': 'Build a validated JSON-LD @graph block using the ruuapi schema-build endpoint.',
        'step': [
          {
            '@type': 'HowToStep',
            'position': 1,
            'name': 'Send a POST request',
            'text': 'POST https://ruuapi.com/api/agent/schema-build with Content-Type: application/json'
          },
          {
            '@type': 'HowToStep',
            'position': 2,
            'name': 'Include the request body',
            'text': 'Include primary_type (e.g. "Article"), optional bundle array, and fields object with headline, datePublished, author.'
          },
          {
            '@type': 'HowToStep',
            'position': 3,
            'name': 'Parse the response',
            'text': 'The response includes { ok: true, jsonld: {...}, grade: "A", warnings: [] }. Use jsonld as your structured data.'
          }
        ]
      },
      {
        '@context': 'https://schema.org',
        '@type': 'FAQPage',
        'mainEntity': [
          {
            '@type': 'Question',
            'name': 'Do I need an API key to use ruuapi?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'No. All /api/agent/* endpoints are open with no authentication required. Rate limit is 1000 requests/hour/IP.' }
          },
          {
            '@type': 'Question',
            'name': 'Can an AI agent call ruuapi directly?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'Yes. ruuapi is designed as an LLM-native API. CORS is open (*) so any AI agent can call the endpoints directly from any origin.' }
          },
          {
            '@type': 'Question',
            'name': 'What does the schema-build endpoint return?',
            'acceptedAnswer': { '@type': 'Answer', 'text': 'It returns a JSON object with ok, jsonld (a validated @graph JSON-LD block), grade (A through D), and a warnings array.' }
          }
        ]
      }
    ]
  },
  '/start': {
    title: { en: 'Get Started - Launch Your AI SEO Journey | ruuapi', tr: 'Başlayın - Yapay Zeka SEO Yolculuğuna Çıkın', de: 'Jetzt starten - Ihre KI-SEO Reise beginnt', es: 'Empezar - Inicia tu viaje en SEO con IA', fr: 'Commencer - Lancez votre aventure SEO IA', pt: 'Começar - Inicie a sua jornada de SEO com IA', ja: '開始する - AI SEOの旅を始めましょう' },
    description: { en: 'Create your ruuapi account today and start optimizing your content for the next generation of search.', tr: 'Bugün ruuapi hesabı oluşturun ve yeni nesil arama motorları için içeriklerinizi optimize etmeye başlayın.', de: 'Erstellen Sie noch heute Ihr ruuapi-Konto und optimieren Sie Ihre Inhalte für die KI-Suche.', es: 'Crea tu cuenta en ruuapi hoy y optimiza tu contenido para la nueva generación de búsqueda.', fr: 'Créez votre compte ruuapi dès aujourd\'hui et commencez à optimiser votre contenu.', pt: 'Crie a sua conta ruuapi hoje e comece a otimizar o seu conteúdo.', ja: '今すぐruuapiアカウントを作成して、次世代の検索に備えたコンテンツ最適化を始めましょう。' },
    og: { image: '/og/start.png', type: 'website' },
    twitter: { card: 'summary_large_image' },
    keywords: ['get started', 'sign up ruuapi', 'AI SEO onboarding', 'AEO account'],
    canonical: 'https://ruuapi.com/start',
    jsonld: [{ '@context': 'https://schema.org', '@type': 'WebPage', 'name': 'Get Started' }]
  }
};

function SEOHead() {
  const route = useRoute();
  const { lang } = useT();

  React.useEffect(() => {
    const l = (lang || 'en').toLowerCase();

    // Dynamic OG for shareable report pages: /report/<id>
    if (route.path.startsWith('/report/')) {
      const reportId = route.path.replace('/report/', '').split('/')[0];
      const ogImg = 'https://ruuapi.com/api/report/' + reportId + '/og';
      document.title = 'Analysis Report · ruuapi';
      const _sm = (prop, val, attr) => {
        let el = document.querySelector(`meta[${attr || 'name'}="${prop}"]`);
        if (!el) { el = document.createElement('meta'); el.setAttribute(attr || 'name', prop); document.head.appendChild(el); }
        el.setAttribute('content', val);
      };
      _sm('og:title', 'Analysis Report · ruuapi', 'property');
      _sm('og:description', 'View this AI-generated audit report from ruuapi.', 'property');
      _sm('og:image', ogImg, 'property');
      _sm('og:type', 'article', 'property');
      _sm('twitter:card', 'summary_large_image');
      _sm('twitter:image', ogImg);
      document.documentElement.lang = l;
      return;
    }

    const meta = SEO_META[route.path] || SEO_META['/'];
    const t = meta.title[l] || meta.title.en;
    const d = meta.description[l] || meta.description.en;

    document.title = t;
    document.documentElement.lang = l;

    const setMeta = (name, content, attr = 'name') => {
      let el = document.querySelector(`meta[${attr}="${name}"]`);
      if (!el) {
        el = document.createElement('meta');
        el.setAttribute(attr, name);
        document.head.appendChild(el);
      }
      el.setAttribute('content', content);
    };

    const setMetaProp = (prop, content) => setMeta(prop, content, 'property');

    setMeta('description', d);
    setMeta('keywords', meta.keywords.join(', '));
    
    // OG Tags
    setMetaProp('og:title', t);
    setMetaProp('og:description', d);
    setMetaProp('og:image', meta.og.image);
    setMetaProp('og:type', meta.og.type);
    setMetaProp('og:url', meta.canonical);

    // Twitter Tags
    setMeta('twitter:card', meta.twitter.card);
    setMeta('twitter:title', t);
    setMeta('twitter:description', d);
    setMeta('twitter:image', meta.og.image);

    // Canonical Link
    let link = document.querySelector('link[rel="canonical"]');
    if (!link) {
      link = document.createElement('link');
      link.setAttribute('rel', 'canonical');
      document.head.appendChild(link);
    }
    link.setAttribute('href', meta.canonical);

    // JSON-LD
    document.querySelectorAll('script[data-route="true"]').forEach(el => el.remove());
    meta.jsonld.forEach(obj => {
      const script = document.createElement('script');
      script.type = 'application/ld+json';
      script.setAttribute('data-route', 'true');
      script.text = JSON.stringify(obj);
      document.head.appendChild(script);
    });

  }, [route.path, lang]);

  return null;
}

Object.assign(window, { SEO_META, SEOHead });
