export default defineNuxtConfig({
  devtools: { enabled: true },
  modules: ["@nuxtjs/tailwindcss"],
  css: ["~/assets/css/main.css"],
  runtimeConfig: {
    /** Target proxy server/routes/workpulse-api — tanpa trailing slash */
    workpulseInternalApiOrigin:
      process.env.WORKPULSE_INTERNAL_API_ORIGIN || "http://127.0.0.1:3040",
    public: {
      /**
       * Default `/workpulse-api` = same-origin proxy (hindari TLS salah host ke apiwork).
       * Setelah sertifikat apiwork benar: `NUXT_PUBLIC_WORKPULSE_API_BASE=https://apiwork.rycroftapparel.com`
       */
      workpulseApiBase: process.env.NUXT_PUBLIC_WORKPULSE_API_BASE ?? "/workpulse-api",
      /** Override: `NUXT_PUBLIC_WORKPULSE_WS_PATH` */
      workpulseWsPath: process.env.NUXT_PUBLIC_WORKPULSE_WS_PATH ?? "/api/v1/ws"
    }
  },
  app: {
    /** Transisi antar halaman (semua route) — halus & konsisten dengan Employees */
    pageTransition: { name: "page", mode: "out-in" },
    head: {
      title: "WorkPulse - Internal Reporting Hub",
      meta: [
        {
          name: "viewport",
          content: "width=device-width, initial-scale=1"
        }
      ],
      link: [
        {
          rel: "icon",
          type: "image/svg+xml",
          href: "/favicon.svg"
        },
        {
          rel: "preconnect",
          href: "https://fonts.googleapis.com"
        },
        {
          rel: "preconnect",
          href: "https://fonts.gstatic.com",
          crossorigin: ""
        },
        {
          rel: "stylesheet",
          href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap"
        }
      ]
    }
  },
  compatibilityDate: "2026-05-13"
});
