#!/usr/bin/env bash
set -euo pipefail

if   [ -n "${BASH_VERSION-}" ]; then script_path="${BASH_SOURCE[0]}"
elif [ -n "${ZSH_VERSION-}"  ]; then script_path="${(%):-%x}"
else                                 script_path="$0"
fi
script_dir="$(cd "$(dirname "$script_path")" && pwd -P)"

# Load shared utilities
# shellcheck source=../lib/utils.sh
source "$script_dir/../lib/utils.sh"

if [ ! -d "./evibes" ]; then
  log_error "❌  Please run this script from the project's root (where the 'evibes' directory lives)."
  exit 1
fi

art_path="$script_dir/../ASCII_ART_EVIBES"
if [ ! -f "$art_path" ]; then
  log_error "❌  Could not find ASCII art at $art_path"
  exit 1
fi

if is_interactive; then
  # In interactive mode, show colorful banner
  purple='\033[38;2;121;101;209m'
  reset='\033[0m'
  echo -e "${purple}$(cat "$art_path")${reset}"
  echo
  echo -e "${COLOR_GRAY}                                                                       by WISELESS TEAM${COLOR_RESET}"
  echo
else
  # In non-interactive mode, show simple banner
  echo "eVibes by WISELESS TEAM"
fi
