//! Semantic ANSI styles used by the non-TUI output path.
//!
//! Colours are kept abstract: callers reach for [`OK`] or [`ERROR`] rather
//! than `Color::Green`, so a future theme change is a one-file edit. The
//! `anstream` crate drops these styles automatically when
//! `$NO_COLOR` is set or stderr is not a TTY.

use anstyle::{AnsiColor, Color, Style};

const RED: Color = Color::Ansi(AnsiColor::Red);
const YELLOW: Color = Color::Ansi(AnsiColor::Yellow);
const GREEN: Color = Color::Ansi(AnsiColor::Green);
const CYAN: Color = Color::Ansi(AnsiColor::Cyan);

/// Bold red. Used for error markers (`✗`) and problem labels.
pub const ERROR: Style = Style::new().fg_color(Some(RED)).bold();

/// Bold yellow. Used for warnings and `skip`-class messages.
pub const WARN: Style = Style::new().fg_color(Some(YELLOW)).bold();

/// Green. Used for the success check-mark (`✓`) and `ok` results.
pub const OK: Style = Style::new().fg_color(Some(GREEN));

/// Bold cyan. Used for repo names, section headers, and other emphasis.
pub const ACCENT: Style = Style::new().fg_color(Some(CYAN)).bold();

/// Dimmed. Used for headers, secondary text, and decoration.
pub const DIM: Style = Style::new().dimmed();

/// Yellow. Used in `limb status` for non-zero dirty-file counts.
pub const DIRTY: Style = Style::new().fg_color(Some(YELLOW));

/// Green. Used in `limb status` for the upstream-ahead arrow (`↑`).
pub const AHEAD: Style = Style::new().fg_color(Some(GREEN));

/// Red. Used in `limb status` for the upstream-behind arrow (`↓`).
pub const BEHIND: Style = Style::new().fg_color(Some(RED));

/// Green. Used for FETCHED ages younger than `[refresh.thresholds.fresh]`.
pub const FRESH: Style = Style::new().fg_color(Some(GREEN));

/// Yellow. Used for FETCHED ages between `fresh` and `warn`.
pub const WARN_AGE: Style = Style::new().fg_color(Some(YELLOW));

/// Red. Used for FETCHED ages between `warn` and `stale`.
pub const STALE_AGE: Style = Style::new().fg_color(Some(RED));

/// Dimmed. Used for FETCHED ages older than `stale`, and for never-fetched.
pub const ANCIENT_AGE: Style = Style::new().dimmed();
