"""Quick verification of header colors"""
import sys
import io
from openpyxl import load_workbook
from pathlib import Path

# Fix Windows console encoding
if sys.platform == 'win32':
    sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

file_path = Path("output/full_run/adolescense/5_domain/Personality_14-17.xlsx")
wb = load_workbook(file_path)
ws = wb.active

green_count = 0
red_count = 0

for cell in ws[1]:
    if cell.font and cell.font.color:
        color_rgb = str(cell.font.color.rgb) if hasattr(cell.font.color, 'rgb') else None
        if color_rgb and '008000' in color_rgb:
            green_count += 1
        elif color_rgb and 'FF0000' in color_rgb:
            red_count += 1

print(f"✅ Personality_14-17.xlsx:")
print(f"   Green headers (omission): {green_count}")
print(f"   Red headers (reverse-scored): {red_count}")
print(f"   Total colored headers: {green_count + red_count}")
