/**
 * Background class - Dark version
 * 
 * Creates a true dark background with minimal elements
 */
class Background {
  // Background properties
  color bgColor;
  color accentColor1;
  color accentColor2;
  
  // Movement properties - minimal
  float noiseScale = 0.003;
  float noiseOffset = 0;
  float noiseSpeed = 0.0008;
  
  // Timing
  float cps = 0.5;
  float lastCycleTime = 0;
  
  Background() {
    // Almost black background
    bgColor = color(1, 2, 5);  // Near black
    accentColor1 = color(0, 20, 40);  // Very dark blue
    accentColor2 = color(15, 0, 30);  // Very dark purple
  }
  
  void update() {
    // Update noise movement
    noiseOffset += noiseSpeed;
    
    // Check for cycle changes
    float currentCycleTime = millis() / 1000.0 * cps;
    if (floor(currentCycleTime) > floor(lastCycleTime)) {
      // New cycle - could trigger effects here
    }
    lastCycleTime = currentCycleTime;
  }
  
  void display() {
    // Fill with near-black color for clean slate
    // This completely covers previous frames
    noStroke();
    fill(bgColor, 240);  // High alpha to clear previous frames
    rect(0, 0, width, height);
    
    // Add minimal accent elements - just a few dots
    float motionFactor = sin(millis() * 0.0001) * 0.5 + 0.5;
    
    // Draw just 5 accent dots
    for (int i = 0; i < 5; i++) {
      float x = noise(i * 0.3, noiseOffset) * width;
      float y = noise(i * 0.3, noiseOffset + 5) * height;
      float size = 3 + noise(i * 0.3, noiseOffset + 10) * 8;
      
      color dotColor = lerpColor(accentColor1, accentColor2, noise(i * 0.3, noiseOffset + 15));
      fill(dotColor, 30 * motionFactor);
      ellipse(x, y, size, size);
    }
    
    // No horizontal scanlines at all
  }
  
  void setCPS(float newCps) {
    this.cps = newCps;
  }
}
