def get_competitor_prompt(competitors_data: list, project_name: str, language: str = "ar") -> list:
    lang_instruction = "Respond entirely in Arabic." if language == "ar" else "Respond entirely in English."
    
    comp_text = ""
    for c in competitors_data:
        comp_text += f"- {c.get('name', 'N/A')}: {c.get('description', '')[:200]}\n"

    return [
        {
            "role": "system",
            "content": (
                "You are a competitive intelligence analyst. Analyze the following competitors "
                "and provide strategic insights for the given business. "
                f"{lang_instruction}\n\n"
                "Return JSON with keys:\n"
                "competitors: [{name, strengths: [], weaknesses: [], market_position: string, pricing: string}],\n"
                "competitive_advantages: [],\n"
                "market_gaps: [],\n"
                "recommended_differentiation: string,\n"
                "threat_level: string (low/medium/high)"
            ),
        },
        {
            "role": "user",
            "content": f"Project: {project_name}\n\nCompetitors found:\n{comp_text}\n\nAnalyze these competitors."
        },
    ]
