"""FAQ content for professionals (job seekers)."""

PROFESSIONAL_FAQ_SECTIONS = [
    {
        'title': 'General Questions',
        'slug': 'general',
        'items': [
            {
                'id': 1,
                'question': 'What is PezaJob?',
                'answer': (
                    'PezaJob is the online career and talent platform of Peza Job, '
                    'a career development, recruitment and talent management company.\n\n'
                    'The platform connects job seekers with employers and employment '
                    'opportunities. Job seekers can search and apply for jobs, create '
                    'professional profiles, upload their CVs, showcase their skills and '
                    'experience, and make themselves discoverable to employers and '
                    'recruiters.\n\n'
                    'Employers and recruiters can use PezaJob to advertise vacancies, '
                    'search for qualified candidates and access talent through our CV '
                    'database.\n\n'
                    'PezaJob is built to make it easier for the right people and the '
                    'right opportunities to find each other.\n\n'
                    'PezaJob is for people looking for a job, employers looking for talent, and '
                    'anyone who wants to grow their career.'
                ),
            },
            {
                'id': 2,
                'question': 'How do I create a job seeker profile?',
                'answer': (
                    'Click Create Account / Register, select Job Seeker, and provide the '
                    'required information. You can then complete your profile with your '
                    'education, experience, skills and other career information.'
                ),
            },
            {
                'id': 3,
                'question': 'Why should I create a profile on PezaJob?',
                'answer': (
                    'A profile lets you apply for jobs faster, track your applications, '
                    'present your skills and experience to employers, and be discoverable '
                    'when companies search for talent on the platform.'
                ),
            },
            {
                'id': 4,
                'question': 'How much does it cost to create and maintain a profile?',
                'answer': (
                    'Creating a basic job seeker account and profile is free. Optional '
                    'membership plans are available if you want enhanced visibility and '
                    'additional features. View current plans and pricing on the '
                    'Subscriptions page.'
                ),
            },
            {
                'id': 5,
                'question': 'Is my information secure on PezaJob?',
                'answer': (
                    'We take account security seriously. Sign-in credentials are protected, '
                    'and you control what appears on your public profile. Only share contact '
                    'details you are comfortable making visible to employers through your '
                    'profile or applications.'
                ),
            },
            {
                'id': 6,
                'question': 'How do I subscribe to the platform?',
                'answer': (
                    'Go to the Pricing page, review the job seeker membership options, '
                    'choose the plan that fits your needs, and complete the subscription '
                    'steps shown at checkout. Employers use separate recruitment and CV '
                    'search plans.'
                ),
            },
            {
                'id': 7,
                'question': 'What does "Ongoing Vacancy" mean?',
                'answer': (
                    'An Ongoing Vacancy is a job opportunity that does not have a fixed '
                    'application deadline. Applications may remain open until the employer '
                    'finds a suitable candidate.'
                ),
            },
        ],
    },
    {
        'title': 'Job Search & Applications',
        'slug': 'job-search',
        'items': [
            {
                'id': 8,
                'question': 'How can I search for jobs on PezaJob?',
                'answer': (
                    'Open Browse Jobs from the main menu or homepage search. You can filter '
                    'by location, job type, experience level, and industry, and use keywords '
                    'to search titles, companies, and descriptions.'
                ),
            },
            {
                'id': 9,
                'question': 'How do I apply for a job?',
                'answer': (
                    'Find a vacancy that matches your qualifications and experience, open '
                    'the job advert, and follow the application instructions provided. '
                    'Some jobs may require you to apply directly through PezaJob, '
                    'while others may direct you to the employer.'
                ),
            },
            {
                'id': 10,
                'question': 'Do I need an account to apply for a job?',
                'answer': (
                    'Some vacancies may allow you to apply without an account, while other '
                    'features may require you to create a PezaJob profile. Creating '
                    'a profile can also make it easier to manage your applications and '
                    'access career services.'
                ),
            },
            {
                'id': 11,
                'question': 'Can I search for companies on PezaJob?',
                'answer': (
                    'Yes. Use Find Companies to browse employer profiles, view their open '
                    'roles, and learn more about organisations hiring on the platform.'
                ),
            },
            {
                'id': 12,
                'question': 'How can I report a suspicious or inappropriate job advert?',
                'answer': (
                    'Use the Report Job option on the vacancy where available, or contact '
                    'PezaJob and provide the relevant details. We encourage job '
                    'seekers to report adverts that appear fraudulent, misleading or '
                    'inappropriate.'
                ),
            },
        ],
    },
    {
        'title': 'Professional Profile & Visibility',
        'slug': 'profile',
        'items': [
            {
                'id': 13,
                'question': 'What is a professional profile, and why is it important?',
                'answer': (
                    'Your professional profile summarises who you are as a candidate—your '
                    'headline, experience, skills, location, and CV. It helps employers '
                    'assess your fit quickly and supports applications and talent discovery.'
                ),
            },
            {
                'id': 14,
                'question': (
                    'How Can I Increase My Chances of Being Hired or Discovered by Employers?'
                ),
                'answer': (
                    'Getting noticed by the right employer starts with having a complete, '
                    'professional and searchable profile. Employers and recruiters use '
                    'information and keywords on candidate profiles when searching for '
                    'potential candidates.\n\n'
                    'Here are some ways to improve your visibility:\n\n'
                    '1. Complete your profile\n'
                    'Fill in as much relevant information as possible, including your '
                    'education, qualifications, work experience, location, professional '
                    'interests and other important career details.\n\n'
                    '2. Add a professional profile picture\n'
                    'A clear, professional-looking photograph helps create a strong first '
                    'impression and makes your profile more credible and recognisable.\n\n'
                    '3. Upload an updated CV\n'
                    'Your CV provides employers with a detailed view of your qualifications, '
                    'experience, skills and career achievements. Make sure it is '
                    'professional, accurate and up to date.\n\n'
                    '4. Add your key skills\n'
                    'List relevant technical and soft skills that accurately reflect your '
                    'abilities. Employers often search for candidates using specific '
                    'keywords, so include skills that are relevant to the type of jobs you '
                    'are seeking.\n\n'
                    '5. Write a strong professional summary\n'
                    'Your professional summary should quickly explain who you are, what you '
                    'do, your key strengths and the value you can bring to an organisation. '
                    'Use relevant industry and job-related keywords naturally.\n\n'
                    '6. Keep your experience up to date\n'
                    'Add your current and previous positions, responsibilities, achievements '
                    'and relevant experience. Don\'t leave important career information out.\n\n'
                    '7. Keep your profile active and updated\n'
                    'Review your profile regularly and update it whenever you gain new '
                    'skills, qualifications, experience or achievements.\n\n'
                    '8. Consider a Premium Profile\n'
                    'A Premium Profile can give you additional visibility on the PezaJob '
                    'platform, including opportunities for your profile to be '
                    'featured on the homepage. This can help increase the chances of your '
                    'profile being seen by employers and other visitors.\n\n'
                    'Remember:\n\n'
                    'Don\'t just apply for jobs, make it easier for employers to find you.\n\n'
                    'A complete, professional and keyword-rich profile can help you stand '
                    'out when employers are searching for candidates with your skills and '
                    'experience.'
                ),
            },
            {
                'id': 15,
                'question': 'Can employers contact me directly?',
                'answer': (
                    'Employers may reach you through your application details or platform '
                    'messaging when you apply or when your profile is visible to them. '
                    'Review your profile and privacy settings to control what you share '
                    'publicly.'
                ),
            },
            {
                'id': 16,
                'question': 'Can I Upload My CV?',
                'answer': (
                    'Yes! Uploading your CV to your PezaJob profile allows you to '
                    'be included in our CV Database, where employers and recruiters can '
                    'search for qualified candidates based on their skills, qualifications, '
                    'experience and other requirements.\n\n'
                    'Your CV could be discovered by an employer looking for someone with '
                    'your particular background, even when you have not directly applied '
                    'for their vacancy.\n\n'
                    'Why should you upload your CV?\n\n'
                    '- Get discovered by employers searching our CV Database for suitable '
                    'candidates.\n'
                    '- Increase your visibility to recruiters and organisations looking '
                    'for talent.\n'
                    '- Be considered for relevant opportunities that match your '
                    'qualifications and experience.\n'
                    '- Save time by having your professional information readily available '
                    'when opportunities arise.\n'
                    '- Keep your career profile active and make it easier for employers to '
                    'identify your skills and experience.\n\n'
                    'We recommend uploading a professional, updated CV and regularly '
                    'updating your profile whenever you gain new qualifications, skills, '
                    'experience or achievements.\n\n'
                    'Your next opportunity may find you. Upload your CV today and make '
                    'yourself visible to employers.'
                ),
            },
            {
                'id': 17,
                'question': 'What is a Professional Plus Profile?',
                'answer': (
                    'A Professional Plus Profile is an enhanced job seeker profile designed '
                    'to give you greater visibility on PezaJob and help you stand '
                    'out to employers and recruiters.\n\n'
                    'For just K20 per month, you can upgrade your profile and benefit from '
                    'additional visibility and profile features designed to help you '
                    'showcase your professional background.\n\n'
                    'What are the benefits of having a Professional Plus Profile?\n\n'
                    'A Professional Plus Profile can help you:\n\n'
                    '- Increase your visibility on the PezaJob platform.\n'
                    '- Stand out from other job seekers with an enhanced professional '
                    'profile.\n'
                    '- Showcase your skills, qualifications and experience in a more '
                    'complete and professional way.\n'
                    '- Increase your chances of being discovered by employers and '
                    'recruiters searching our candidate database.\n'
                    '- Get featured on the PezaJob homepage, where available, '
                    'giving your profile additional exposure.\n'
                    '- Present yourself as a serious and professionally prepared '
                    'candidate.\n\n'
                    'How can a Professional Plus Profile improve my visibility?\n\n'
                    'Employers and recruiters can search for candidates based on '
                    'information such as job titles, skills, qualifications, experience '
                    'and other relevant keywords.\n\n'
                    'Having a complete Professional Plus Profile gives you more '
                    'opportunities to present this information clearly and professionally. '
                    'Additional profile visibility and homepage features can also help '
                    'more people discover your profile.\n\n'
                    'Tip: Make the most of your Professional Plus Profile by keeping your '
                    'CV updated and completing your profile with relevant skills, '
                    'experience, qualifications and a strong professional summary.\n\n'
                    'Does a Professional Plus Profile guarantee employment?\n\n'
                    'No. A Professional Plus Profile does not guarantee employment, an '
                    'interview or selection by an employer.\n\n'
                    'Its purpose is to help improve your professional visibility and '
                    'discoverability. Final recruitment decisions are always made by '
                    'employers based on their own requirements, assessment and selection '
                    'processes.\n\n'
                    'For only K20 per month, don\'t just search for opportunities, make it '
                    'easier for opportunities to find you.'
                ),
            },
        ],
    },
    {
        'title': 'Career Growth & Resources',
        'slug': 'resources',
        'items': [
            {
                'id': 18,
                'question': 'What other resources are available on PezaJob?',
                'answer': (
                    'Beyond job listings, PezaJob offers a career blog, podcast episodes, '
                    'company and talent directories, subscription plans, and recruitment '
                    'services for deeper career and hiring support.'
                ),
            },
            {
                'id': 19,
                'question': 'How can I listen to podcasts on PezaJob?',
                'answer': (
                    'Visit the Podcast section from the main navigation or footer. Browse '
                    'published episodes and play them from the podcast pages on the site.'
                ),
            },
            {
                'id': 20,
                'question': 'Does Peza Job Zambia offer career coaching?',
                'answer': (
                    'PEZAJOB provides career guidance through blog articles, podcasts, and '
                    'platform resources. For recruitment support or professional '
                    'services, visit the Services page or contact our team.'
                ),
            },
        ],
    },
    {
        'title': 'Support & Assistance',
        'slug': 'support',
        'items': [
            {
                'id': 21,
                'question': 'What should I do if I forget my password?',
                'answer': (
                    'On the Sign In page, select the password reset option, enter the email '
                    'address linked to your account, and follow the reset link sent to your '
                    'inbox to choose a new password.'
                ),
            },
            {
                'id': 22,
                'question': 'How do I contact PezaJob for support?',
                'answer': (
                    'Email info@pezajob.com, call +260 773 821 612, or submit a message '
                    'through the Contact page. Our team will respond as soon as possible.'
                ),
            },
        ],
    },
]


def filter_faq_by_sections(sections, query=''):
    """Return FAQ sections with items matching query (case-insensitive)."""
    query = (query or '').strip().lower()
    if not query:
        return sections

    filtered = []
    for section in sections:
        items = [
            item for item in section['items']
            if query in item['question'].lower()
            or query in item.get('answer', '').lower()
            or query in item.get('answer_html', '').lower()
        ]
        if items:
            filtered.append({**section, 'items': items})
    return filtered


def filter_faq_sections(query=''):
    """Return professional FAQ sections with items matching query."""
    return filter_faq_by_sections(PROFESSIONAL_FAQ_SECTIONS, query)
