// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2025-07-22',
  devtools: { enabled: false }, // DevTools 비활성화로 성능 향상
  
  // SSR 비활성화 - 개발 속도 극대화
  ssr: false,
  
  // Dev server configuration
  devServer: {
    port: 3003,
    host: '0.0.0.0' // 모든 네트워크 인터페이스에서 수신
  },
  
  app: {
    head: {
      title: '출장마사지 - 전국 출장마사지 플랫폼',
      charset: 'utf-8',
      viewport: 'width=device-width, initial-scale=1',
      htmlAttrs: {
        lang: 'ko'
      },
      meta: [
        { name: 'description', content: '전국 출장마사지 업체 정보를 한눈에! 지역별 마사지샵 검색, 가격 비교, 실시간 예약까지 출장마사지.kr에서 해결하세요.' },
        { name: 'keywords', content: '출장마사지, 출장안마, 마사지, 홈타이, 호텔마사지, 스웨디시, 타이마사지, 아로마테라피' },
        { name: 'author', content: '출장마사지' },
        { name: 'robots', content: 'index, follow' },
        { name: 'format-detection', content: 'telephone=no' },
        { 
          name: 'google-site-verification', 
          content: 'ooxpkLQqEYCIfSwZKDLks9pwZ5l0RpTdkB4Ae-eAgTw' 
        },
        
        // Open Graph
        { property: 'og:type', content: 'website' },
        { property: 'og:site_name', content: '출장마사지' },
        { property: 'og:title', content: '출장마사지 - 전국 출장마사지 플랫폼' },
        { property: 'og:description', content: '전국 출장마사지 업체 정보를 한눈에! 지역별 마사지샵 검색, 가격 비교, 실시간 예약까지' },
        { property: 'og:image', content: '/images/og-image.png' },
        { property: 'og:locale', content: 'ko_KR' },
        
        // Twitter Card
        { name: 'twitter:card', content: 'summary_large_image' },
        { name: 'twitter:title', content: '출장마사지 - 전국 출장마사지 플랫폼' },
        { name: 'twitter:description', content: '전국 출장마사지 업체 정보를 한눈에!' },
        { name: 'twitter:image', content: '/images/og-image.png' }
      ],
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
        { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' },
        { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' },
        { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' },
        { rel: 'shortcut icon', href: '/favicon.ico' },
        { rel: 'canonical', href: 'https://xn--hz2b29j7ogx9bb7g.kr' }
      ],
      script: [
        {
          type: 'application/ld+json',
          innerHTML: JSON.stringify({
            '@context': 'https://schema.org',
            '@type': 'WebSite',
            name: '출장마사지',
            url: 'https://출장마사지.kr',
            description: '전국 출장마사지 플랫폼',
            potentialAction: {
              '@type': 'SearchAction',
              target: 'https://출장마사지.kr/shops?search={search_term_string}',
              'query-input': 'required name=search_term_string'
            }
          })
        }
      ]
    },
    pageTransition: { name: 'page', mode: 'out-in' }
  },

  css: ['~/assets/css/main.css'],

  modules: [
    '@nuxtjs/tailwindcss',
    '@pinia/nuxt',
    '@nuxt/icon'
  ],

  // 최소 설정만 유지
  runtimeConfig: {
    dbHost: process.env.DB_HOST || 'officialsite.kr',
    dbPort: process.env.DB_PORT || '23306',
    dbUser: process.env.DB_USER || 'admin',
    dbPassword: process.env.DB_PASSWORD || 'dlgks~123',
    dbName: process.env.DB_NAME || 'msgss',
    jwtSecret: process.env.JWT_SECRET || 'your-secret-key-change-in-production',
    // 프로덕션: /var/www/front/msgss/msgss-platform/.output/public
    // 로컬: process.cwd()/public
    uploadBasePath: process.env.UPLOAD_BASE_PATH || '',
    public: {
      apiBase: process.env.API_BASE || 'http://localhost:3003',
    }
  },

  // Vite 최적화
  vite: {
    server: {
      port: 3003,
      strictPort: true,
      host: '0.0.0.0',
      hmr: {
        port: 3003,
        protocol: 'ws',
        host: process.env.NODE_ENV === 'production' ? '출장마사지.kr' : 'localhost',
        clientPort: 3003
      }
    },
    optimizeDeps: {
      include: ['vue', 'vue-router', 'pinia']
    }
  },

  // Tailwind 최적화
  tailwindcss: {
    viewer: false,
    exposeConfig: false
  },

  // 빌드 최적화
  build: {
    transpile: []
  },

  // Nitro 최적화
  nitro: {
    // Remove devProxy as it can cause API routing conflicts
  }
})