/**
 * Centralized Environment Configuration
 * Handles environment variables with safe defaults.
 */

const DEFAULT_KEY_PLACEHOLDER = "Your-API-Key";

export const config = {
    // Groq AI API Key
    groqApiKey: import.meta.env.VITE_GROQ_API_KEY || DEFAULT_KEY_PLACEHOLDER,

    // OpenWeatherMap API Key
    // Fallback to the known working demo key if no env var is set
    weatherApiKey: import.meta.env.VITE_OPENWEATHER_API_KEY || "7bca9386645d390690e65f474dff6b5d",

    // Helper to check if a key is valid (not missing and not the placeholder)
    isValidKey: (key) => key && key !== DEFAULT_KEY_PLACEHOLDER,

    // Helper to check if we should run in Demo Mode
    // We only trigger demo mode if the key is the placeholder OR explicitly missing
    // (The working weather key will NOT trigger demo mode)
    isDemoMode: (key) => !key || key === DEFAULT_KEY_PLACEHOLDER
};
