Adjust the code below and send back the full adjusted code with no commentary | I want you to make the theme system better than what it is, I want it to be able to make smart random themes that look good in all color ranges styles and stuff do what is best.

private enum ThemeStyle
{
    Classic,
    Vibrant,
    Epic,
    Neon,
    Pastel,
    DarkGlow,
    Oceanic,
    Sunset,
    Cyberpunk,
    Forest,
    Retro,
    Metallic,
    Candy,
    Space,
    Vintage,
    Aurora,
    // New styles
    PrismBurst,
    TechnoWave,
    SolarFlare,
    ElectricDream,
    MysticRainbow,
    TwilightPulse
}

private static int SafeRandomRange(Random rand, int minValue, int maxValue)
{
    if (minValue > maxValue)
    {
        var temp = minValue;
        minValue = maxValue;
        maxValue = temp;
    }
    return rand.Next(minValue, maxValue + 1);
}

private Color RandomHueColor(int hMin, int hMax, double sMin, double sMax, double vMin, double vMax)
{
    int hue = SafeRandomRange(_rand, hMin, hMax);
    double saturation = _rand.NextDouble() * (sMax - sMin) + sMin;
    double value = _rand.NextDouble() * (vMax - vMin) + vMin;
    return ColorFromHSV(hue, saturation, value);
}

private List<Color> GenerateUniqueColorsDistinct(int count, double sMin, double sMax, double vMin, double vMax)
{
    var colors = new List<Color>();
    var usedHues = new HashSet<int>();
    int attempts = 0;

    while (colors.Count < count && attempts < 5000)
    {
        int hue = _rand.Next(0, 360);
        if (usedHues.Contains(hue)) { attempts++; continue; }
        usedHues.Add(hue);

        double sat = _rand.NextDouble() * (sMax - sMin) + sMin;
        double val = _rand.NextDouble() * (vMax - vMin) + vMin;
        Color c = ColorFromHSV(hue, sat, val);
        colors.Add(c);
        attempts++;
    }

    // If not enough unique, fill with random colors anyway
    while (colors.Count < count)
        colors.Add(RandomHueColor(0, 360, sMin, sMax, vMin, vMax));

    return colors;
}

private Color GenerateUniqueLightColorExcluding(List<Color> exclude)
{
    int attempts = 0;
    while (attempts < 1000)
    {
        double hue = _rand.NextDouble() * 360;
        double saturation = _rand.NextDouble() * 0.3 + 0.2;
        double value = _rand.NextDouble() * 0.4 + 0.6;
        Color c = ColorFromHSV(hue, saturation, value);

        bool isUnique = true;
        foreach (var ex in exclude)
        {
            if (Math.Abs(ex.R - c.R) < 10 && Math.Abs(ex.G - c.G) < 10 && Math.Abs(ex.B - c.B) < 10)
            {
                isUnique = false;
                break;
            }
        }

        if (isUnique)
            return c;

        attempts++;
    }

    return Color.White;
}

private void GenerateRandomTheme(bool reapply = false)
{
    if (!reapply || _lastMainStart == Color.Empty)
    {
        var styles = Enum.GetValues(typeof(ThemeStyle)).Cast<ThemeStyle>().ToList();

        // Shuffle styles for better random distribution
        for (int i = styles.Count - 1; i > 0; i--)
        {
            int j = _rand.Next(i + 1);
            (styles[i], styles[j]) = (styles[j], styles[i]);
        }
        var style = styles[0];

        switch (style)
        {
            case ThemeStyle.Classic:
                _lastMainStart = RandomColor(10, 60);
                _lastMainEnd = RandomColor(30, 100);
                _lastAccentsStart = RandomColor(150, 255);
                _lastAccentsEnd = RandomColor(100, 200);
                _lastTextColor = RandomColor(200, 255);
                break;

            case ThemeStyle.Vibrant:
                _lastMainStart = RandomVibrantColor();
                _lastMainEnd = RandomVibrantColor();
                _lastAccentsStart = RandomVibrantColor();
                _lastAccentsEnd = RandomVibrantColor();
                _lastTextColor = Color.White;
                break;

            case ThemeStyle.Epic:
                _lastMainStart = RandomHueColor(0, 360, 0.7, 0.9, 0.1, 0.3);
                _lastMainEnd = RandomHueColor(0, 360, 0.7, 0.9, 0.4, 0.6);
                _lastAccentsStart = RandomHueColor(0, 360, 0.8, 1.0, 0.8, 1.0);
                _lastAccentsEnd = RandomHueColor(0, 360, 0.6, 0.8, 0.6, 0.8);
                _lastTextColor = Color.WhiteSmoke;
                break;

            case ThemeStyle.Neon:
                _lastMainStart = Color.Black;
                _lastMainEnd = Color.FromArgb(255, SafeRandomRange(_rand, 50, 90), SafeRandomRange(_rand, 0, 50), SafeRandomRange(_rand, 80, 255));
                _lastAccentsStart = RandomHueColor(260, 300, 0.9, 1.0, 0.9, 1.0);
                _lastAccentsEnd = RandomHueColor(130, 170, 0.9, 1.0, 0.9, 1.0);
                _lastTextColor = Color.White;
                break;

            case ThemeStyle.Pastel:
                _lastMainStart = RandomHueColor(0, 360, 0.25, 0.35, 0.8, 0.95);
                _lastMainEnd = RandomHueColor(0, 360, 0.2, 0.3, 0.85, 1.0);
                _lastAccentsStart = RandomHueColor(0, 360, 0.3, 0.4, 0.75, 0.9);
                _lastAccentsEnd = RandomHueColor(0, 360, 0.25, 0.35, 0.9, 1.0);
                _lastTextColor = Color.FromArgb(255, 80, 80, 80);
                break;

            case ThemeStyle.DarkGlow:
                var darkGlowColors = GenerateUniqueColorsDistinct(4, 0.7, 1, 0.05, 0.2);
                _lastMainStart = darkGlowColors[0];
                _lastMainEnd = darkGlowColors[1];
                _lastAccentsStart = darkGlowColors[2];
                _lastAccentsEnd = darkGlowColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(darkGlowColors);
                break;

            case ThemeStyle.Oceanic:
                var oceanicColors = GenerateUniqueColorsDistinct(4, 0.5, 0.8, 0.3, 0.5);
                for (int i = 0; i < oceanicColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(oceanicColors[i], out h, out s, out v);
                    h = (h + 180) % 360; // shift to blue-green range
                    oceanicColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = oceanicColors[0];
                _lastMainEnd = oceanicColors[1];
                _lastAccentsStart = oceanicColors[2];
                _lastAccentsEnd = oceanicColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(oceanicColors);
                break;

            case ThemeStyle.Sunset:
                var sunsetColors = GenerateUniqueColorsDistinct(4, 0.6, 0.9, 0.35, 0.5);
                for (int i = 0; i < sunsetColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(sunsetColors[i], out h, out s, out v);
                    h = (h % 60) + 10; // warm reds/oranges
                    sunsetColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = sunsetColors[0];
                _lastMainEnd = sunsetColors[1];
                _lastAccentsStart = sunsetColors[2];
                _lastAccentsEnd = sunsetColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(sunsetColors);
                break;

            case ThemeStyle.Cyberpunk:
                var cyberColors = GenerateUniqueColorsDistinct(4, 0.7, 1.0, 0.05, 0.3);
                double[] cyberHueTargets = { 270, 300, 210, 240 };
                for (int i = 0; i < cyberColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(cyberColors[i], out h, out s, out v);
                    h = cyberHueTargets[i];
                    cyberColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = cyberColors[0];
                _lastMainEnd = cyberColors[1];
                _lastAccentsStart = cyberColors[2];
                _lastAccentsEnd = cyberColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(cyberColors);
                break;

            case ThemeStyle.Forest:
                var forestColors = GenerateUniqueColorsDistinct(4, 0.5, 0.7, 0.25, 0.5);
                for (int i = 0; i < forestColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(forestColors[i], out h, out s, out v);
                    h = (h + 90) % 150; // shift to greens (90-140)
                    forestColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = forestColors[0];
                _lastMainEnd = forestColors[1];
                _lastAccentsStart = forestColors[2];
                _lastAccentsEnd = forestColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(forestColors);
                break;

            case ThemeStyle.Retro:
                var retroColors = GenerateUniqueColorsDistinct(4, 0.4, 0.6, 0.25, 0.5);
                double[] retroHueTargets = { 290, 20, 40, 30 };
                for (int i = 0; i < retroColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(retroColors[i], out h, out s, out v);
                    h = retroHueTargets[i];
                    retroColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = retroColors[0];
                _lastMainEnd = retroColors[1];
                _lastAccentsStart = retroColors[2];
                _lastAccentsEnd = retroColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(retroColors);
                break;

            case ThemeStyle.Metallic:
                var metallicColors = GenerateUniqueColorsDistinct(4, 0.05, 0.15, 0.3, 0.5);
                for (int i = 0; i < metallicColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(metallicColors[i], out h, out s, out v);
                    s *= 0.1;
                    metallicColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = metallicColors[0];
                _lastMainEnd = metallicColors[1];
                _lastAccentsStart = metallicColors[2];
                _lastAccentsEnd = metallicColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(metallicColors);
                break;

            case ThemeStyle.Candy:
                var candyColors = GenerateUniqueColorsDistinct(4, 0.7, 0.9, 0.7, 0.95);
                double[] candyHueTargets = { 320, 350, 330, 310 };
                for (int i = 0; i < candyColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(candyColors[i], out h, out s, out v);
                    h = candyHueTargets[i];
                    candyColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = candyColors[0];
                _lastMainEnd = candyColors[1];
                _lastAccentsStart = candyColors[2];
                _lastAccentsEnd = candyColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(candyColors);
                break;

            case ThemeStyle.Space:
                var spaceColors = GenerateUniqueColorsDistinct(4, 0.7, 0.9, 0.05, 0.3);
                double[] spaceHueTargets = { 240, 260, 250, 220 };
                for (int i = 0; i < spaceColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(spaceColors[i], out h, out s, out v);
                    h = spaceHueTargets[i];
                    spaceColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = spaceColors[0];
                _lastMainEnd = spaceColors[1];
                _lastAccentsStart = spaceColors[2];
                _lastAccentsEnd = spaceColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(spaceColors);
                break;

            case ThemeStyle.Vintage:
                var vintageColors = GenerateUniqueColorsDistinct(4, 0.4, 0.6, 0.3, 0.5);
                double[] vintageHueTargets = { 40, 50, 30, 20 };
                for (int i = 0; i < vintageColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(vintageColors[i], out h, out s, out v);
                    h = vintageHueTargets[i];
                    vintageColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = vintageColors[0];
                _lastMainEnd = vintageColors[1];
                _lastAccentsStart = vintageColors[2];
                _lastAccentsEnd = vintageColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(vintageColors);
                break;

            case ThemeStyle.Aurora:
                var auroraColors = GenerateUniqueColorsDistinct(4, 0.7, 1, 0.25, 0.5);
                double[] auroraHueTargets = { 150, 180, 130, 220 };
                for (int i = 0; i < auroraColors.Count; i++)
                {
                    double h, s, v;
                    ColorToHSV(auroraColors[i], out h, out s, out v);
                    h = auroraHueTargets[i];
                    auroraColors[i] = ColorFromHSV(h, s, v);
                }
                _lastMainStart = auroraColors[0];
                _lastMainEnd = auroraColors[1];
                _lastAccentsStart = auroraColors[2];
                _lastAccentsEnd = auroraColors[3];
                _lastTextColor = GenerateUniqueLightColorExcluding(auroraColors);
                break;

            // New diverse and colorful styles

            case ThemeStyle.PrismBurst:
                {
                    // Explosive multi-colored bright palette with complementary accents
                    var baseColors = GenerateUniqueColorsDistinct(4, 0.8, 1.0, 0.7, 1.0);
                    _lastMainStart = baseColors[0];
                    _lastMainEnd = baseColors[1];
                    _lastAccentsStart = baseColors[2];
                    _lastAccentsEnd = baseColors[3];

                    // Text color: pick a dark contrasting color to brightest main end
                    double h, s, v;
                    ColorToHSV(_lastMainEnd, out h, out s, out v);
                    var textHue = (h + 180) % 360;
                    _lastTextColor = ColorFromHSV(textHue, 0.8, 0.2); // dark contrast
                }
                break;

            case ThemeStyle.TechnoWave:
                {
                    // Electric blue neon, magenta accents, dark backgrounds, intense saturation
                    _lastMainStart = ColorFromHSV(_rand.Next(200, 240), 0.95, 0.1);
                    _lastMainEnd = ColorFromHSV(_rand.Next(220, 260), 0.95, 0.3);
                    _lastAccentsStart = ColorFromHSV(_rand.Next(280, 320), 0.9, 0.8);
                    _lastAccentsEnd = ColorFromHSV(_rand.Next(300, 340), 0.9, 0.9);
                    _lastTextColor = Color.White;
                }
                break;

            case ThemeStyle.SolarFlare:
                {
                    // Hot fiery oranges and reds with golden glowing accents
                    _lastMainStart = ColorFromHSV(_rand.Next(10, 40), 0.9, 0.3);
                    _lastMainEnd = ColorFromHSV(_rand.Next(20, 50), 0.9, 0.5);
                    _lastAccentsStart = ColorFromHSV(_rand.Next(30, 60), 1.0, 0.95);
                    _lastAccentsEnd = ColorFromHSV(_rand.Next(15, 45), 1.0, 0.85);
                    _lastTextColor = Color.FromArgb(255, 30, 30, 30);
                }
                break;

            case ThemeStyle.ElectricDream:
                {
                    // Soft purples, teal and pink pastel-like but saturated and glowing
                    var colors = GenerateUniqueColorsDistinct(4, 0.5, 0.8, 0.6, 0.85);
                    double[] targetHues = { 280, 190, 320, 350 };
                    for (int i = 0; i < colors.Count; i++)
                    {
                        double h, s, v;
                        ColorToHSV(colors[i], out h, out s, out v);
                        h = targetHues[i];
                        colors[i] = ColorFromHSV(h, s, v);
                    }
                    _lastMainStart = colors[0];
                    _lastMainEnd = colors[1];
                    _lastAccentsStart = colors[2];
                    _lastAccentsEnd = colors[3];
                    _lastTextColor = Color.WhiteSmoke;
                }
                break;

            case ThemeStyle.MysticRainbow:
                {
                    // Full rainbow spread but muted dark base with saturated colorful accents
                    _lastMainStart = ColorFromHSV(_rand.Next(0, 360), 0.2, 0.15);
                    _lastMainEnd = ColorFromHSV((_rand.Next(0, 360) + 180) % 360, 0.3, 0.25);

                    var accents = GenerateUniqueColorsDistinct(2, 0.85, 1.0, 0.8, 1.0);
                    _lastAccentsStart = accents[0];
                    _lastAccentsEnd = accents[1];

                    _lastTextColor = Color.White;
                }
                break;

            case ThemeStyle.TwilightPulse:
                {
                    // Dusk-inspired purples, blues, soft fading gradients with bright accent glows
                    _lastMainStart = ColorFromHSV(_rand.Next(250, 280), 0.6, 0.45);
                    _lastMainEnd = ColorFromHSV(_rand.Next(230, 260), 0.65, 0.6);
                    _lastAccentsStart = ColorFromHSV(_rand.Next(310, 350), 0.9, 0.95);
                    _lastAccentsEnd = ColorFromHSV(_rand.Next(270, 310), 0.9, 0.8);
                    _lastTextColor = Color.FromArgb(255, 240, 240, 250);
                }
                break;
        }
    }

    Theme(_lastMainStart, _lastMainEnd, _lastAccentsStart, _lastAccentsEnd, _lastTextColor);
}