%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF1E6','primaryTextColor':'#1a1a1a','primaryBorderColor':'#F77020','lineColor':'#F77020','secondaryColor':'#FFE4D1','tertiaryColor':'#ffffff','clusterBkg':'#FFF8F2','clusterBorder':'#F77020','fontFamily':'Inter','fontSize':'14px'},'flowchart':{'curve':'basis','htmlLabels':true}}}%%
flowchart TD
classDef trust fill:#F77020,stroke:#c4541a,stroke-width:2px,color:#ffffff
classDef action fill:#FFF1E6,stroke:#F77020,stroke-width:2px,color:#1a1a1a
classDef ai fill:#FFE4D1,stroke:#F77020,stroke-width:2px,color:#7a3a10
classDef user fill:#ffffff,stroke:#F77020,stroke-width:2px,color:#1a1a1a
classDef success fill:#F77020,stroke:#9c4214,stroke-width:3px,color:#ffffff
classDef decision fill:#ffffff,stroke:#F77020,stroke-width:2px,stroke-dasharray:4 2,color:#1a1a1a
Start([Application Submitted]) --> Inputs[Collect Inputs]
Inputs --> Resume[Resume File]
Inputs --> Answers[Questionnaire Answers]
Inputs --> JD[Job Description & Weights]
Resume --> Format{File Format?}
Format -- PDF --> ParsePDF[PDF Text Extractor]
Format -- DOCX --> ParseDOCX[DOCX Parser]
Format -- Image / Scanned --> OCR[OCR Engine]
OCR --> ParsedText[Reconstructed Text]
ParsePDF --> ParsedText
ParseDOCX --> ParsedText
ParsedText --> Sectionise[Detect Sections]
Sectionise --> Contact[Contact Block]
Sectionise --> ExpSec[Experience Block]
Sectionise --> EduSec[Education Block]
Sectionise --> SkillsSec[Skills Block]
Sectionise --> CertSec[Certifications Block]
SkillsSec --> SkillNorm[Normalise to Skill Taxonomy]
SkillNorm --> SkillMatch[Match Skills vs JD]
SkillMatch --> SkillScore[Skills Sub-Score 40 percent]
ExpSec --> ExpYears[Compute Years of Experience]
ExpYears --> ExpRel[Relevance to JD]
ExpRel --> ExpScore[Experience Sub-Score 30 percent]
EduSec --> EduVerify[Verify Institution & Degree]
EduVerify --> EduScore[Education Sub-Score 15 percent]
Answers --> AnsClean[Normalise Answers]
AnsClean --> AnsFit[Compute Fit vs Configured Weights]
AnsFit --> AnsScore[Questionnaire Sub-Score 15 percent]
SkillScore --> Combine[Combine Weighted Scores]
ExpScore --> Combine
EduScore --> Combine
AnsScore --> Combine
Combine --> Final[Final Match Score 0 to 100]
Final --> Threshold{Above Threshold?}
Threshold -- No --> LowFlag[Flag Below-Threshold]
LowFlag --> Pool[Send to Talent Pool]
Threshold -- Yes --> Summary[Generate AI Summary]
Summary --> Strengths[Strengths & Highlights]
Strengths --> Gaps[Gaps & Risks]
Gaps --> Profile[Build Comprehensive Profile]
Profile --> Ranking[Rank Within Job Pipeline]
Ranking --> Recommend[Surface Top-N Recommendations]
Recommend --> Pipeline[Push to ATS Shortlisted Stage]
Pipeline --> HRView([Visible on Recruiter Dashboard])
Pool --> Periodic[Periodic Re-Rank Job]
Periodic --> NewJobs{New Jobs Posted?}
NewJobs -- Yes --> Combine
NewJobs -- No --> Idle([Idle — Await Trigger])
class Start,Inputs,Resume,Answers,JD,Contact,ExpSec,EduSec,SkillsSec,CertSec user
class Format,Threshold,NewJobs decision
class ParsePDF,ParseDOCX,OCR,ParsedText,Sectionise,SkillNorm,SkillMatch,ExpYears,ExpRel,EduVerify,AnsClean,AnsFit,Combine,Final,Summary,Strengths,Gaps,Profile,Ranking,Recommend,SkillScore,ExpScore,EduScore,AnsScore,Periodic ai
class Pipeline action
class LowFlag,Pool trust
class HRView success
class Idle action