from django.conf import settings

def get_base_metadata(profile):
    """Generates base metadata for the entire site."""
    # Using the real domain for production
    site_url = "https://sadmansakibjisan.com"
    
    return {
        'title': profile.meta_title or f"{profile.name} | Software Architect & CEO",
        'description': profile.meta_description or profile.bio[:160],
        'og_type': 'website',
        'og_url': site_url,
        'og_image': profile.og_image.url if profile.og_image else f"{site_url}/static/images/og-default.png",
        'twitter_card': 'summary_large_image',
        'canonical': site_url,
    }

def get_person_json_ld(profile):
    """Generates AEO (JSON-LD) for the Person."""
    return {
        "@context": "https://schema.org",
        "@type": "Person",
        "name": profile.name,
        "url": "https://sadmansakibjisan.com",
        "jobTitle": "Software Architect & AI Specialist",
        "sameAs": [
            profile.github,
            profile.linkedin,
            profile.facebook
        ],
        "description": profile.bio,
        "image": "https://sadmansakibjisan.com/static/images/sadman-sakib-jisan-hero.png",
        "knowsAbout": [
            "Software Architecture",
            "Artificial Intelligence",
            "Full Stack Development",
            "Scalable Systems",
            "Global Technology Innovation"
        ]
    }

def get_organization_json_ld(company):
    """Generates AEO (JSON-LD) for a Company."""
    return {
        "@context": "https://schema.org",
        "@type": "Organization",
        "name": company.name,
        "url": company.website_url,
        "founder": {
            "@type": "Person",
            "name": "Sadman Sakib Jisan"
        },
        "description": company.description,
        "location": {
            "@type": "Place",
            "name": company.location
        }
    }
