//! Terminal output styling with colors and formatting


/// ANSI color codes
pub mod colors {
    pub const RESET: &str = "\x1b[0m";
    pub const BRIGHT_GREEN: &str = "\x1b[92m";
    pub const BRIGHT_RED: &str = "\x1b[91m";
    pub const BRIGHT_YELLOW: &str = "\x1b[93m";
    pub const BRIGHT_CYAN: &str = "\x1b[96m";
    pub const BRIGHT_MAGENTA: &str = "\x1b[95m";
    pub const BOLD: &str = "\x1b[1m";
}

/// Print success message
pub fn success(msg: &str) {
    println!("{}✓ {}{}", colors::BRIGHT_GREEN, msg, colors::RESET);
}

/// Print error message
pub fn error(msg: &str) {
    eprintln!("{}✗ {}{}", colors::BRIGHT_RED, msg, colors::RESET);
}

/// Print warning message
pub fn warning(msg: &str) {
    println!("{}⚠ {}{}", colors::BRIGHT_YELLOW, msg, colors::RESET);
}

/// Print info message
pub fn info(msg: &str) {
    println!("{}ℹ {}{}", colors::BRIGHT_CYAN, msg, colors::RESET);
}

/// Print header message
pub fn header(msg: &str) {
    println!("{}{}{}{}", colors::BOLD, colors::BRIGHT_MAGENTA, msg, colors::RESET);
}

/// Print colored package name
pub fn package_pacman(name: &str) {
    print!("{}[pacman]{} {}", colors::BRIGHT_CYAN, colors::RESET, name);
}

/// Print colored flatpak name
pub fn package_flatpak(bundle_id: &str) {
    print!("{}[flatpak]{} {}", colors::BRIGHT_MAGENTA, colors::RESET, bundle_id);
}

/// Print styled count
pub fn count(n: usize, label: &str) {
    println!("  {}{}{}: {}", colors::BOLD, label, colors::RESET, n);
}
