/**
 * Unified color utilities for CLI output
 *
 * Replaces manual ANSI codes with consistent chalk usage.
 * Standardizes color handling across the codebase.
 */

import chalk from 'chalk';

// Re-export chalk for direct usage
export { chalk };

/**
 * Predefined color functions for common use cases
 */
export const colors = {
  error: chalk.red,
  success: chalk.green,
  warning: chalk.yellow,
  info: chalk.blue,
  dim: chalk.gray,
  bold: chalk.bold,
  highlight: chalk.cyan,
};

/**
 * Status indicators with colors
 */
export const status = {
  success: chalk.green('✓'),
  error: chalk.red('✗'),
  warning: chalk.yellow('⚠'),
  info: chalk.blue('ℹ'),
};

/**
 * Format a success message
 * @param {string} message - Message to format
 * @returns {string} Formatted message
 */
export function formatSuccess(message) {
  return `${status.success} ${chalk.green(message)}`;
}

/**
 * Format an error message
 * @param {string} message - Message to format
 * @returns {string} Formatted message
 */
export function formatError(message) {
  return `${status.error} ${chalk.red(message)}`;
}

/**
 * Format a warning message
 * @param {string} message - Message to format
 * @returns {string} Formatted message
 */
export function formatWarning(message) {
  return `${status.warning} ${chalk.yellow(message)}`;
}

/**
 * Format an info message
 * @param {string} message - Message to format
 * @returns {string} Formatted message
 */
export function formatInfo(message) {
  return `${status.info} ${chalk.blue(message)}`;
}
