package core

import "fmt"

// ANSI escape codes — works on Windows Terminal, WSL, macOS, Linux

const (
	reset  = "\033[0m"
	bold   = "\033[1m"
	dim    = "\033[2m"

	red     = "\033[31m"
	green   = "\033[32m"
	yellow  = "\033[33m"
	blue    = "\033[34m"
	magenta = "\033[35m"
	cyan    = "\033[36m"
	darkRed = "\033[31m"
)

func colorize(color, text string) string {
	return color + text + reset
}

func boldRed(s string) string    { return bold + red + s + reset }
func boldGreen(s string) string  { return bold + green + s + reset }
func boldBlue(s string) string   { return bold + blue + s + reset }
func boldCyan(s string) string   { return bold + cyan + s + reset }
func dimYellow(s string) string  { return dim + yellow + s + reset }
func redText(s string) string    { return red + s + reset }
func greenText(s string) string  { return green + s + reset }
func cyanText(s string) string   { return cyan + s + reset }
func darkRedText(s string) string { return dim + darkRed + s + reset }
func magentaBold(s string) string { return bold + magenta + s + reset }

func colorf(color, format string, args ...interface{}) string {
	return color + fmt.Sprintf(format, args...) + reset
}
