<?php
// api/i18n.php — Retorna JSON con todas las traducciones por idioma
// Idiomas: es (base), en, pt, fr, de
header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: public, max-age=86400');

$strings = [
  'es' => [
    'nav.overview'         => 'Resumen',
    'nav.meta'             => 'Meta Ads',
    'nav.google'           => 'Google Ads',
    'nav.seo'              => 'SEO',
    'nav.web'              => 'Sitios Web',
    'nav.videos'           => 'Videos',
    'nav.images'           => 'Imágenes IA',
    'nav.brand'            => 'Activos de Marca',
    'nav.reports'          => 'Reportes',
    'nav.tiktok'           => 'TikTok Ads',
    'nav.email'            => 'Correos masivos',
    'nav.profile'          => 'Mi perfil',
    'nav.users'            => 'Usuarios',
    'nav.apis'             => 'APIs',
    'nav.logout'           => 'Cerrar sesión',
    'nav.section.main'     => 'Principal',
    'nav.section.account'  => 'Cuenta',
    'status.online'        => 'En línea',
    'metric.meta_spend'    => 'Meta Ads — Inversión',
    'metric.google_spend'  => 'Google Ads — Inversión',
    'metric.seo_clicks'    => 'SEO — Clics orgánicos',
    'metric.active_clients'=> 'Clientes activos',
    'metric.top3_kw'       => 'TOP 3 keywords',
    'dash.active_campaigns'=> 'Campañas activas',
    'dash.monthly_report'  => 'Reporte mensual',
    'dash.recent_activity' => 'Actividad reciente',
    'dash.clients'         => 'Clientes',
    'dash.google_campaigns'=> 'Google Ads — Campañas',
    'avi.name'             => 'AVI · Asistente DIMARK',
    'avi.placeholder'      => 'Pregúntale algo a AVI...',
    'avi.send'             => 'Enviar',
    'avi.generate'         => 'Generar con AVI →',
    'avi.copy'             => 'Copiar',
    'avi.regenerate'       => '↺ Regenerar',
    'btn.update'           => '↺ Actualizar',
    'btn.save'             => 'Guardar',
    'btn.cancel'           => 'Cancelar',
    'btn.generate'         => 'Generar',
    'btn.export'           => 'Exportar',
    'btn.send'             => 'Enviar',
    'btn.close'            => 'Cerrar',
    'btn.copy'             => 'Copiar',
    'btn.see_all'          => 'Ver todo →',
    'btn.new_client'       => '+ Nuevo cliente',
    'btn.configure'        => '⚙ Configurar cliente',
    'status.loading'       => 'Cargando...',
    'status.no_data'       => 'Sin datos',
    'status.select_client' => 'Selecciona un cliente',
    'status.error'         => 'Error al cargar datos',
    'period.7d'            => '7D',
    'period.30d'           => '30D',
    'period.90d'           => '90D',
    'avi.drawer.ctx_general'   => 'Modo general · Selecciona cliente para análisis con datos reales',
    'avi.drawer.history'       => 'Historial de conversaciones',
    'avi.drawer.history_clear' => 'Borrar todo',
    'avi.drawer.placeholder'   => 'Pregunta o instrucción libre...',
    'avi.drawer.execute'       => 'Ejecutar →',
    'avi.modal.confirm_title'  => 'AVI Agente · Confirmar acción',
    'avi.modal.confirm_sub'    => 'Revisa antes de ejecutar',
    'avi.modal.execute'        => 'Ejecutar',
    'avi.modal.cancel'         => 'Cancelar',
  ],
  'en' => [
    'nav.overview'         => 'Overview',
    'nav.meta'             => 'Meta Ads',
    'nav.google'           => 'Google Ads',
    'nav.seo'              => 'SEO',
    'nav.web'              => 'Websites',
    'nav.videos'           => 'Videos',
    'nav.images'           => 'AI Images',
    'nav.brand'            => 'Brand Assets',
    'nav.reports'          => 'Reports',
    'nav.tiktok'           => 'TikTok Ads',
    'nav.email'            => 'Mass emails',
    'nav.profile'          => 'My profile',
    'nav.users'            => 'Users',
    'nav.apis'             => 'APIs',
    'nav.logout'           => 'Log out',
    'nav.section.main'     => 'Main',
    'nav.section.account'  => 'Account',
    'status.online'        => 'Online',
    'metric.meta_spend'    => 'Meta Ads — Investment',
    'metric.google_spend'  => 'Google Ads — Investment',
    'metric.seo_clicks'    => 'SEO — Organic clicks',
    'metric.active_clients'=> 'Active clients',
    'metric.top3_kw'       => 'TOP 3 keywords',
    'dash.active_campaigns'=> 'Active campaigns',
    'dash.monthly_report'  => 'Monthly report',
    'dash.recent_activity' => 'Recent activity',
    'dash.clients'         => 'Clients',
    'dash.google_campaigns'=> 'Google Ads — Campaigns',
    'avi.name'             => 'AVI · DIMARK Assistant',
    'avi.placeholder'      => 'Ask AVI something...',
    'avi.send'             => 'Send',
    'avi.generate'         => 'Generate with AVI →',
    'avi.copy'             => 'Copy',
    'avi.regenerate'       => '↺ Regenerate',
    'btn.update'           => '↺ Update',
    'btn.save'             => 'Save',
    'btn.cancel'           => 'Cancel',
    'btn.generate'         => 'Generate',
    'btn.export'           => 'Export',
    'btn.send'             => 'Send',
    'btn.close'            => 'Close',
    'btn.copy'             => 'Copy',
    'btn.see_all'          => 'See all →',
    'btn.new_client'       => '+ New client',
    'btn.configure'        => '⚙ Configure client',
    'status.loading'       => 'Loading...',
    'status.no_data'       => 'No data',
    'status.select_client' => 'Select a client',
    'status.error'         => 'Error loading data',
    'period.7d'            => '7D',
    'period.30d'           => '30D',
    'period.90d'           => '90D',
    'avi.drawer.ctx_general'   => 'General mode · Select a client for analysis with real data',
    'avi.drawer.history'       => 'Conversation history',
    'avi.drawer.history_clear' => 'Clear all',
    'avi.drawer.placeholder'   => 'Free question or instruction...',
    'avi.drawer.execute'       => 'Run →',
    'avi.modal.confirm_title'  => 'AVI Agent · Confirm action',
    'avi.modal.confirm_sub'    => 'Review before running',
    'avi.modal.execute'        => 'Run',
    'avi.modal.cancel'         => 'Cancel',
  ],
  'pt' => [
    'nav.overview'         => 'Resumo',
    'nav.meta'             => 'Meta Ads',
    'nav.google'           => 'Google Ads',
    'nav.seo'              => 'SEO',
    'nav.web'              => 'Sites',
    'nav.videos'           => 'Vídeos',
    'nav.images'           => 'Imagens IA',
    'nav.brand'            => 'Ativos de Marca',
    'nav.reports'          => 'Relatórios',
    'nav.tiktok'           => 'TikTok Ads',
    'nav.email'            => 'E-mails em massa',
    'nav.profile'          => 'Meu perfil',
    'nav.users'            => 'Usuários',
    'nav.apis'             => 'APIs',
    'nav.logout'           => 'Sair',
    'nav.section.main'     => 'Principal',
    'nav.section.account'  => 'Conta',
    'status.online'        => 'Online',
    'metric.meta_spend'    => 'Meta Ads — Investimento',
    'metric.google_spend'  => 'Google Ads — Investimento',
    'metric.seo_clicks'    => 'SEO — Cliques orgânicos',
    'metric.active_clients'=> 'Clientes ativos',
    'metric.top3_kw'       => 'TOP 3 palavras-chave',
    'dash.active_campaigns'=> 'Campanhas ativas',
    'dash.monthly_report'  => 'Relatório mensal',
    'dash.recent_activity' => 'Atividade recente',
    'dash.clients'         => 'Clientes',
    'dash.google_campaigns'=> 'Google Ads — Campanhas',
    'avi.name'             => 'AVI · Assistente DIMARK',
    'avi.placeholder'      => 'Pergunte algo ao AVI...',
    'avi.send'             => 'Enviar',
    'avi.generate'         => 'Gerar com AVI →',
    'avi.copy'             => 'Copiar',
    'avi.regenerate'       => '↺ Regenerar',
    'btn.update'           => '↺ Atualizar',
    'btn.save'             => 'Salvar',
    'btn.cancel'           => 'Cancelar',
    'btn.generate'         => 'Gerar',
    'btn.export'           => 'Exportar',
    'btn.send'             => 'Enviar',
    'btn.close'            => 'Fechar',
    'btn.copy'             => 'Copiar',
    'btn.see_all'          => 'Ver tudo →',
    'btn.new_client'       => '+ Novo cliente',
    'btn.configure'        => '⚙ Configurar cliente',
    'status.loading'       => 'Carregando...',
    'status.no_data'       => 'Sem dados',
    'status.select_client' => 'Selecione um cliente',
    'status.error'         => 'Erro ao carregar dados',
    'period.7d'            => '7D',
    'period.30d'           => '30D',
    'period.90d'           => '90D',
    'avi.drawer.ctx_general'   => 'Modo geral · Selecione um cliente para análise com dados reais',
    'avi.drawer.history'       => 'Histórico de conversas',
    'avi.drawer.history_clear' => 'Apagar tudo',
    'avi.drawer.placeholder'   => 'Pergunta ou instrução livre...',
    'avi.drawer.execute'       => 'Executar →',
    'avi.modal.confirm_title'  => 'AVI Agente · Confirmar ação',
    'avi.modal.confirm_sub'    => 'Verifique antes de executar',
    'avi.modal.execute'        => 'Executar',
    'avi.modal.cancel'         => 'Cancelar',
  ],
  'fr' => [
    'nav.overview'         => 'Tableau de bord',
    'nav.meta'             => 'Meta Ads',
    'nav.google'           => 'Google Ads',
    'nav.seo'              => 'SEO',
    'nav.web'              => 'Sites web',
    'nav.videos'           => 'Vidéos',
    'nav.images'           => 'Images IA',
    'nav.brand'            => 'Actifs de marque',
    'nav.reports'          => 'Rapports',
    'nav.tiktok'           => 'TikTok Ads',
    'nav.email'            => 'E-mails en masse',
    'nav.profile'          => 'Mon profil',
    'nav.users'            => 'Utilisateurs',
    'nav.apis'             => 'APIs',
    'nav.logout'           => 'Déconnexion',
    'nav.section.main'     => 'Principal',
    'nav.section.account'  => 'Compte',
    'status.online'        => 'En ligne',
    'metric.meta_spend'    => 'Meta Ads — Investissement',
    'metric.google_spend'  => 'Google Ads — Investissement',
    'metric.seo_clicks'    => 'SEO — Clics organiques',
    'metric.active_clients'=> 'Clients actifs',
    'metric.top3_kw'       => 'TOP 3 mots-clés',
    'dash.active_campaigns'=> 'Campagnes actives',
    'dash.monthly_report'  => 'Rapport mensuel',
    'dash.recent_activity' => 'Activité récente',
    'dash.clients'         => 'Clients',
    'dash.google_campaigns'=> 'Google Ads — Campagnes',
    'avi.name'             => 'AVI · Assistant DIMARK',
    'avi.placeholder'      => 'Posez une question à AVI...',
    'avi.send'             => 'Envoyer',
    'avi.generate'         => 'Générer avec AVI →',
    'avi.copy'             => 'Copier',
    'avi.regenerate'       => '↺ Régénérer',
    'btn.update'           => '↺ Actualiser',
    'btn.save'             => 'Enregistrer',
    'btn.cancel'           => 'Annuler',
    'btn.generate'         => 'Générer',
    'btn.export'           => 'Exporter',
    'btn.send'             => 'Envoyer',
    'btn.close'            => 'Fermer',
    'btn.copy'             => 'Copier',
    'btn.see_all'          => 'Voir tout →',
    'btn.new_client'       => '+ Nouveau client',
    'btn.configure'        => '⚙ Configurer client',
    'status.loading'       => 'Chargement...',
    'status.no_data'       => 'Pas de données',
    'status.select_client' => 'Sélectionner un client',
    'status.error'         => 'Erreur de chargement',
    'period.7d'            => '7J',
    'period.30d'           => '30J',
    'period.90d'           => '90J',
    'avi.drawer.ctx_general'   => 'Mode général · Sélectionnez un client pour analyse avec données réelles',
    'avi.drawer.history'       => 'Historique des conversations',
    'avi.drawer.history_clear' => 'Tout effacer',
    'avi.drawer.placeholder'   => 'Question ou instruction libre...',
    'avi.drawer.execute'       => 'Exécuter →',
    'avi.modal.confirm_title'  => 'AVI Agent · Confirmer l\'action',
    'avi.modal.confirm_sub'    => 'Vérifiez avant d\'exécuter',
    'avi.modal.execute'        => 'Exécuter',
    'avi.modal.cancel'         => 'Annuler',
  ],
  'de' => [
    'nav.overview'         => 'Übersicht',
    'nav.meta'             => 'Meta Ads',
    'nav.google'           => 'Google Ads',
    'nav.seo'              => 'SEO',
    'nav.web'              => 'Websites',
    'nav.videos'           => 'Videos',
    'nav.images'           => 'KI-Bilder',
    'nav.brand'            => 'Marken-Assets',
    'nav.reports'          => 'Berichte',
    'nav.tiktok'           => 'TikTok Ads',
    'nav.email'            => 'Massen-E-Mails',
    'nav.profile'          => 'Mein Profil',
    'nav.users'            => 'Benutzer',
    'nav.apis'             => 'APIs',
    'nav.logout'           => 'Abmelden',
    'nav.section.main'     => 'Hauptmenü',
    'nav.section.account'  => 'Konto',
    'status.online'        => 'Online',
    'metric.meta_spend'    => 'Meta Ads — Investition',
    'metric.google_spend'  => 'Google Ads — Investition',
    'metric.seo_clicks'    => 'SEO — Organische Klicks',
    'metric.active_clients'=> 'Aktive Kunden',
    'metric.top3_kw'       => 'TOP 3 Keywords',
    'dash.active_campaigns'=> 'Aktive Kampagnen',
    'dash.monthly_report'  => 'Monatsbericht',
    'dash.recent_activity' => 'Letzte Aktivität',
    'dash.clients'         => 'Kunden',
    'dash.google_campaigns'=> 'Google Ads — Kampagnen',
    'avi.name'             => 'AVI · DIMARK-Assistent',
    'avi.placeholder'      => 'AVI etwas fragen...',
    'avi.send'             => 'Senden',
    'avi.generate'         => 'Mit AVI generieren →',
    'avi.copy'             => 'Kopieren',
    'avi.regenerate'       => '↺ Neu generieren',
    'btn.update'           => '↺ Aktualisieren',
    'btn.save'             => 'Speichern',
    'btn.cancel'           => 'Abbrechen',
    'btn.generate'         => 'Generieren',
    'btn.export'           => 'Exportieren',
    'btn.send'             => 'Senden',
    'btn.close'            => 'Schließen',
    'btn.copy'             => 'Kopieren',
    'btn.see_all'          => 'Alle anzeigen →',
    'btn.new_client'       => '+ Neuer Kunde',
    'btn.configure'        => '⚙ Kunde konfigurieren',
    'status.loading'       => 'Laden...',
    'status.no_data'       => 'Keine Daten',
    'status.select_client' => 'Kunden auswählen',
    'status.error'         => 'Fehler beim Laden',
    'period.7d'            => '7T',
    'period.30d'           => '30T',
    'period.90d'           => '90T',
    'avi.drawer.ctx_general'   => 'Allgemeiner Modus · Wählen Sie einen Kunden für Echtdaten-Analyse',
    'avi.drawer.history'       => 'Gesprächsverlauf',
    'avi.drawer.history_clear' => 'Alles löschen',
    'avi.drawer.placeholder'   => 'Freie Frage oder Anweisung...',
    'avi.drawer.execute'       => 'Ausführen →',
    'avi.modal.confirm_title'  => 'AVI Agent · Aktion bestätigen',
    'avi.modal.confirm_sub'    => 'Prüfen Sie vor der Ausführung',
    'avi.modal.execute'        => 'Ausführen',
    'avi.modal.cancel'         => 'Abbrechen',
  ],
];

echo json_encode($strings, JSON_UNESCAPED_UNICODE);
