/**
 * Single source of truth for branding, URLs and contact details.
 * Values come from PUBLIC_* env vars (see .env.example) with safe local defaults.
 */
const env = import.meta.env;

const trim = (v: string) => v.replace(/\/+$/, '');

export const site = {
  name: 'FleetTruck360',
  legalName: 'FleetTruck360 LLC',
  tagline: 'Digital trip sheets, fleet and driver pay for trucking companies',
  description:
    'Trucking software for small fleets: digital trip sheets on the phone, IFTA mileage by state, expenses with receipts and weekly driver pay. Free trial.',
  url: trim(env.PUBLIC_SITE_URL || 'http://localhost:4321'),
  appUrl: trim(env.PUBLIC_APP_URL || 'http://localhost:5174'),
  apiUrl: trim(env.PUBLIC_API_URL || 'http://localhost:8010/api/v1'),
  /** API the BUILD reads plans, blog posts and assistant answers from (deploy/build-release.sh sets it; default = apiUrl).
   *  Build-time only — browsers always use apiUrl. */
  buildApiUrl: trim(env.BUILD_API_URL || env.PUBLIC_API_URL || 'http://localhost:8010/api/v1'),
  turnstileSiteKey: env.PUBLIC_TURNSTILE_SITE_KEY || '1x00000000000000000000AA',
  /** language menu (EN / ES + Google Translate) in the header, footer and sign-up page — hidden for now (user, 20 Nov:
   *  "for now hide language and not work on it"). The Spanish pages still build; true shows the menu again. */
  showLanguages: false,
  trialDays: 14,
  yearlyDiscountPct: 15,
  currency: 'USD',
  locale: 'en-US',
  // Placeholder contact details — replace before launch
  supportEmail: 'support@fleettruck360.com',
  salesEmail: 'sales@fleettruck360.com',
  supportPhone: '+1 (817) 555-0142',
  /** WhatsApp chat button (components/WhatsAppChat.astro): international number, digits only (PUBLIC_WHATSAPP_NUMBER).
   *  Falls back to the support phone. Placeholder until the real business number is set. */
  whatsapp: (env.PUBLIC_WHATSAPP_NUMBER || '+1 (817) 555-0142').replace(/\D/g, ''),
  address: 'Fort Worth, TX, USA',
  ogImage: '/og-image.png',
  /** Core search terms used site-wide (meta keywords + structured data); pages add their own. */
  keywords: [
    'trucking software', 'trucking management software', 'fleet management software', 'TMS for small trucking companies',
    'digital trip sheet', 'truck driver trip sheet app', 'IFTA mileage tracking', 'state mileage report', 'fuel tax reporting',
    'driver settlement software', 'owner operator software', 'trucking expense tracking', 'truck repair log', 'trucking dispatch app',
  ],
  twitter: '',     // e.g. '@fleettruck' — add before launch
  themeColor: '#0A1428',
  social: {
    // Add real profile URLs before launch (used in Organization JSON-LD `sameAs`)
    facebook: '',
    linkedin: '',
    youtube: '',
  },
} as const;

export const appLoginUrl = `${site.appUrl}/login`;
