#!/usr/bin/env python3
"""
PHAT Foods Logo Generation - Working Version
Creates actual logo concepts for Olevia and Aria with typography variations.
"""

import json
import os
from pathlib import Path

# Configuration
BRAND_NAMES = ["Olevia", "Aria"]
TYPOGRAPHY_STYLES = [
    "serif", "serif-bold", 
    "script", "script-elegant", 
    "geometric", "geometric-bold"
]
PALETTE = {
    "primary": "#2D4A22",  # Dark olive green
    "secondary": "#3D5A32",  # Medium olive
    "accent": "#F4F1E8"   # Cream/off-white
}

OUTPUT_DIR = Path("logo-exploration")

def create_logo_prompts():
    """Generate detailed prompts for logo concepts"""
    prompts = []
    
    for brand in BRAND_NAMES:
        for i, style in enumerate(TYPOGRAPHY_STYLES, 1):
            # Determine style characteristics
            if "serif" in style:
                style_desc = "elegant serif typeface with fine details and traditional character"
                if "bold" in style:
                    style_desc = "bold serif typeface with strong presence and classic authority"
            elif "script" in style:
                style_desc = "flowing script typography with organic curves and handcrafted feel"
                if "elegant" in style:
                    style_desc = "refined script lettering with sophisticated flourishes"
            elif "geometric" in style:
                style_desc = "clean geometric sans-serif with modern minimalist structure"
                if "bold" in style:
                    style_desc = "bold geometric typeface with strong architectural presence"
            
            prompt = f"""Premium food brand logo for "{brand}" featuring {style_desc}. 
            Color palette: dark olive green (#2D4A22) as primary color with cream accents (#F4F1E8). 
            Clean, professional design suitable for high-end food packaging and restaurant branding. 
            Typography-focused logo with subtle organic food elements. 
            White background, vector-style illustration, balanced composition, 
            luxury food brand aesthetic, sophisticated and appetizing."""
            
            prompts.append({
                "brand": brand,
                "style": style,
                "filename": f"{brand.lower()}_{style.replace('-', '_')}_logo.png",
                "prompt": prompt
            })
    
    return prompts

def save_config():
    """Save configuration and prompts for reference"""
    config = {
        "brands": BRAND_NAMES,
        "styles": TYPOGRAPHY_STYLES,
        "palette": PALETTE,
        "output_directory": str(OUTPUT_DIR),
        "total_concepts": len(BRAND_NAMES) * len(TYPOGRAPHY_STYLES)
    }
    
    OUTPUT_DIR.mkdir(exist_ok=True)
    
    with open(OUTPUT_DIR / "config.json", "w") as f:
        json.dump(config, f, indent=2)
    
    prompts = create_logo_prompts()
    with open(OUTPUT_DIR / "prompts.json", "w") as f:
        json.dump(prompts, f, indent=2)
    
    return prompts

if __name__ == "__main__":
    print("🎨 PHAT Foods Logo Generation - Working Version")
    print(f"Creating {len(BRAND_NAMES)} brands × {len(TYPOGRAPHY_STYLES)} styles = {len(BRAND_NAMES) * len(TYPOGRAPHY_STYLES)} concepts")
    print(f"Palette: {PALETTE['primary']} (dark olive green)")
    print(f"Output: {OUTPUT_DIR}")
    
    prompts = save_config()
    print(f"\n✅ Configuration saved to {OUTPUT_DIR}/config.json")
    print(f"✅ Prompts saved to {OUTPUT_DIR}/prompts.json")
    print(f"\n📝 Ready to generate {len(prompts)} logo concepts")
    
    # Display prompt examples
    print("\n🎯 Example prompts:")
    for i, p in enumerate(prompts[:3]):
        print(f"\n{i+1}. {p['brand']} - {p['style']}:")
        print(f"   File: {p['filename']}")
        print(f"   Prompt: {p['prompt'][:100]}...")