export const getThemeClasses = (theme: string) => {
  const themeConfig = {
    green: {
      primary: 'bg-theme-green-primary text-white',
      secondary: 'bg-theme-green-secondary text-white',
      accent: 'bg-theme-green-accent text-white',
      border: 'border-theme-green-primary',
      text: 'text-theme-green-primary',
      gradient: 'from-theme-green-primary to-theme-green-secondary',
      glass: 'bg-theme-green-primary/10 border-theme-green-primary/30',
      hover: 'hover:bg-theme-green-primary/20',
      cssVars: {
        primary: '#1db954',
        secondary: '#1ed760',
        accent: '#00e676',
      }
    },
    pink: {
      primary: 'bg-theme-pink-primary text-white',
      secondary: 'bg-theme-pink-secondary text-white',
      accent: 'bg-theme-pink-accent text-white',
      border: 'border-theme-pink-primary',
      text: 'text-theme-pink-primary',
      gradient: 'from-theme-pink-primary to-theme-pink-secondary',
      glass: 'bg-theme-pink-primary/10 border-theme-pink-primary/30',
      hover: 'hover:bg-theme-pink-primary/20',
      cssVars: {
        primary: '#ec4899',
        secondary: '#f472b6',
        accent: '#fb7185',
      }
    },
    blue: {
      primary: 'bg-theme-blue-primary text-white',
      secondary: 'bg-theme-blue-secondary text-white',
      accent: 'bg-theme-blue-accent text-white',
      border: 'border-theme-blue-primary',
      text: 'text-theme-blue-primary',
      gradient: 'from-theme-blue-primary to-theme-blue-secondary',
      glass: 'bg-theme-blue-primary/10 border-theme-blue-primary/30',
      hover: 'hover:bg-theme-blue-primary/20',
      cssVars: {
        primary: '#3b82f6',
        secondary: '#60a5fa',
        accent: '#93c5fd',
      }
    },
    red: {
      primary: 'bg-theme-red-primary text-white',
      secondary: 'bg-theme-red-secondary text-white',
      accent: 'bg-theme-red-accent text-white',
      border: 'border-theme-red-primary',
      text: 'text-theme-red-primary',
      gradient: 'from-theme-red-primary to-theme-red-secondary',
      glass: 'bg-theme-red-primary/10 border-theme-red-primary/30',
      hover: 'hover:bg-theme-red-primary/20',
      cssVars: {
        primary: '#dc2626',
        secondary: '#ef4444',
        accent: '#f87171',
      }
    },
    purple: {
      primary: 'bg-theme-purple-primary text-white',
      secondary: 'bg-theme-purple-secondary text-white',
      accent: 'bg-theme-purple-accent text-white',
      border: 'border-theme-purple-primary',
      text: 'text-theme-purple-primary',
      gradient: 'from-theme-purple-primary to-theme-purple-secondary',
      glass: 'bg-theme-purple-primary/10 border-theme-purple-primary/30',
      hover: 'hover:bg-theme-purple-primary/20',
      cssVars: {
        primary: '#8b5cf6',
        secondary: '#a78bfa',
        accent: '#c4b5fd',
      }
    },
    yellow: {
      primary: 'bg-theme-yellow-primary text-black',
      secondary: 'bg-theme-yellow-secondary text-black',
      accent: 'bg-theme-yellow-accent text-black',
      border: 'border-theme-yellow-primary',
      text: 'text-theme-yellow-primary',
      gradient: 'from-theme-yellow-primary to-theme-yellow-secondary',
      glass: 'bg-theme-yellow-primary/10 border-theme-yellow-primary/30',
      hover: 'hover:bg-theme-yellow-primary/20',
      cssVars: {
        primary: '#eab308',
        secondary: '#f59e0b',
        accent: '#fbbf24',
      }
    },
    turquoise: {
      primary: 'bg-theme-turquoise-primary text-white',
      secondary: 'bg-theme-turquoise-secondary text-white',
      accent: 'bg-theme-turquoise-accent text-white',
      border: 'border-theme-turquoise-primary',
      text: 'text-theme-turquoise-primary',
      gradient: 'from-theme-turquoise-primary to-theme-turquoise-secondary',
      glass: 'bg-theme-turquoise-primary/10 border-theme-turquoise-primary/30',
      hover: 'hover:bg-theme-turquoise-primary/20',
      cssVars: {
        primary: '#06b6d4',
        secondary: '#22d3ee',
        accent: '#67e8f9',
      }
    },
  };

  const selectedTheme = themeConfig[theme as keyof typeof themeConfig] || themeConfig.green;
  
  // Update CSS custom properties
  if (typeof document !== 'undefined') {
    const root = document.documentElement;
    root.style.setProperty('--theme-primary', selectedTheme.cssVars.primary);
    root.style.setProperty('--theme-secondary', selectedTheme.cssVars.secondary);
    root.style.setProperty('--theme-accent', selectedTheme.cssVars.accent);
  }

  return selectedTheme;
};

export const getThemeHueShift = (theme: string): number => {
  const hueShiftMap = {
    green: 120,    // Green hue
    pink: 300,     // Pink hue (more dramatic)
    blue: 360,     // Red hue (full rotation for more dramatic effect) - SWITCHED
    red: 245,      // Blue hue (more dramatic) - SWITCHED
    purple: 280,   // Purple hue (more dramatic)
    yellow: 200,   // Turquoise hue (more dramatic) - SWITCHED
    turquoise: 40, // Yellow hue (more dramatic) - SWITCHED
  };
  
  return hueShiftMap[theme as keyof typeof hueShiftMap] || 120; // Default to green
};
