/* Bilingual content for the public User Guide page (/guide).
   Each module carries an info-graphic process (START → steps → DONE) and
   the user roles that can access it. */

export interface GuideStep {
  title: string;
  text: string;
}

export interface GuideModule {
  key: string;
  title: string;
  summary: string;
  roles: string[]; // role keys — labels come from roleLabels
  steps: GuideStep[];
}

export interface GuideSection {
  key: string;
  title: string;
  modules: GuideModule[];
}

export type GuideLocale = "en" | "bn";

const EN: { roleLabels: Record<string, string>; sections: GuideSection[] } = {
  roleLabels: {
    public: "Public (no login)",
    applicant: "Applicant (verified)",
    admin: "Institution Admin",
    staff: "Principal / Teacher / Staff login",
    member: "Student / Parent login",
    central: "Central Controller",
  },
  sections: [
    {
      key: "start",
      title: "Getting Started",
      modules: [
        {
          key: "onboarding",
          title: "Institution Registration & Activation",
          summary: "From signing up to the first login of your institution portal.",
          roles: ["public", "central", "admin"],
          steps: [
            { title: "Register", text: "Open Register, choose the institution type and fill in the institution + admin details." },
            { title: "Central approval", text: "The Central Controller reviews the request and approves the institution from the Central Panel." },
            { title: "Choose a package", text: "Pick a subscription package; the portal activates once the subscription starts." },
            { title: "First login", text: "Sign in with the admin email — you land on the Institution Portal dashboard." },
          ],
        },
        {
          key: "setup",
          title: "First-Time Portal Setup",
          summary: "The Control Panel and Academic Info prepare everything the modules need.",
          roles: ["admin"],
          steps: [
            { title: "Control Panel", text: "Toggle the modules you operate, rename academic terms, enable the admission fee and the public tracking page, and set payment collection accounts + email (SMTP)." },
            { title: "Academic Info", text: "Select classes, sections, subjects, sessions, groups, shifts and rooms — or apply the standard class list for your institution type." },
            { title: "User Guide", text: "Open this guide anytime from the sidebar to see each module's flow." },
          ],
        },
      ],
    },
    {
      key: "admissions",
      title: "Admissions",
      modules: [
        {
          key: "apply",
          title: "Online Application (public)",
          summary: "How a guardian applies online and receives the reference number.",
          roles: ["public"],
          steps: [
            { title: "Open /apply", text: "Find the institution by code or name — the wizard starts at Student info." },
            { title: "Fill the wizard", text: "Student → Guardian & Contact → Address & Note; optionally set a tracking-account password; Review and submit." },
            { title: "Reference & email", text: "The reference number (APP-XXXXX) appears on screen and is emailed when mail is configured. The application lands in the institution's Admissions queue (fee recorded if enabled)." },
          ],
        },
        {
          key: "track",
          title: "Application Tracking",
          summary: "Public status, queue position and fee transaction submission.",
          roles: ["public", "applicant"],
          steps: [
            { title: "Open /track", text: "Enter the institution code + application reference (or follow the link from the email/success screen)." },
            { title: "Verify identity", text: "Confirm with the phone/email used in the application or the tracking-account password." },
            { title: "Track", text: "See status, queue position and fee state; submit the payment gateway + transaction ID for the institution to verify." },
          ],
        },
        {
          key: "decide",
          title: "Approving Applications (portal)",
          summary: "From the Admissions queue to an enrolled student.",
          roles: ["admin"],
          steps: [
            { title: "Admission Form", text: "Review applications; record/waive the application fee with the wallet button (applicant-submitted transaction IDs appear here)." },
            { title: "Approve", text: "Approve with an optional custom roll — the student record is created and enrolled automatically." },
            { title: "Reject", text: "Rejected applications stay in the list for reference." },
          ],
        },
      ],
    },
    {
      key: "people",
      title: "Students, Members & HR",
      modules: [
        {
          key: "students",
          title: "Student Management",
          summary: "Profiles, photos, documents, identity and promotion.",
          roles: ["admin", "staff"],
          steps: [
            { title: "Students page", text: "Enrolled students appear after admission approval — search, filter by class/section." },
            { title: "Profile", text: "Upload the photo, edit details, manage documents (NID/birth) and media." },
            { title: "Student Identity", text: "Maintain roll, registration and ID-card data — delegate to staff maintainers from here." },
            { title: "Promotions", text: "At year end, promote students to the next class in bulk." },
          ],
        },
        {
          key: "credentials",
          title: "Member Logins",
          summary: "Creating accounts for students, parents, teachers, principal and staff.",
          roles: ["admin"],
          steps: [
            { title: "Member Credentials", text: "Students page (student/parent logins) or Human Resource (staff-side logins incl. Principal, Vice Principal, Executive Member)." },
            { title: "Create", text: "Pick the person, set username + password — members sign in with the institution code + username." },
            { title: "Members use /me", text: "Their portal: results, fees, notices, leaves, payslips and profile." },
          ],
        },
        {
          key: "hr",
          title: "Human Resource",
          summary: "Staff directory, attendance, leave, payroll and audit.",
          roles: ["admin", "staff"],
          steps: [
            { title: "Staff", text: "Add staff with photo and signature (printed on result sheets)." },
            { title: "Attendance & leave", text: "Mark daily attendance; request and approve leaves." },
            { title: "Salary", text: "Pay monthly salaries with full payment details (TrxID/bank/card) — staff see payslips in /me." },
            { title: "Login Audit", text: "Review every sign-in attempt (success/failure, IP) to audit member activity." },
          ],
        },
      ],
    },
    {
      key: "academics",
      title: "Fees, Exams & Results",
      modules: [
        {
          key: "fees",
          title: "Fees Management",
          summary: "Fee heads, schedules, collection and member statements.",
          roles: ["admin", "member"],
          steps: [
            { title: "Fee heads", text: "Define admission/tuition/exam/other heads with default amounts." },
            { title: "Schedules", text: "Assign fees to classes or individual students with due dates — or use subject-based monthly fees from the Control Panel." },
            { title: "Collect", text: "Record payments with method + transaction details; members see their statement and where-to-pay accounts in /me." },
          ],
        },
        {
          key: "exams",
          title: "Exams & Marks",
          summary: "From exam creation to published marks.",
          roles: ["admin", "staff"],
          steps: [
            { title: "Create exam", text: "Exams per branch/class/section/shift with start-end dates." },
            { title: "Routine", text: "Schedule papers with marks splits (CQ/MCQ/Applied) and pass marks; clash detection keeps rooms conflict-free." },
            { title: "Marks input", text: "Teachers enter marks subject-wise or student-wise; publishing the routine locks editing." },
          ],
        },
        {
          key: "results",
          title: "Result Sheets",
          summary: "Formats, formulas, signatures and verification.",
          roles: ["admin", "public"],
          steps: [
            { title: "Pick a format", text: "Single, Periodical, Combined, Final Result (3 weighted sets) or High School — the ⓘ Result Formula badge explains each calculation." },
            { title: "Sheets", text: "Marksheets carry the grading scale, GPA (High School, with the Bangladesh paired-paper pass rule), merit list and the principal's signature." },
            { title: "Verify", text: "Every sheet carries a QR — anyone can confirm authenticity on the public Verify page." },
          ],
        },
      ],
    },
    {
      key: "daily",
      title: "Daily Operations",
      modules: [
        {
          key: "communication",
          title: "Notices & Communication",
          summary: "Reaching students, parents and staff.",
          roles: ["admin", "member"],
          steps: [
            { title: "Notice Board", text: "Publish notices shown in member portals." },
            { title: "Broadcasts", text: "Send SMS/Email/WhatsApp to classes, students or staff from the Communication Panel." },
            { title: "Conversations", text: "Two-way messages with applicants and guardians." },
          ],
        },
        {
          key: "modules",
          title: "Support Modules",
          summary: "Library, hostel, transport, inventory, events and certificates.",
          roles: ["admin"],
          steps: [
            { title: "Enable", text: "Toggle each module from the Control Panel — only what you operate shows in the sidebar." },
            { title: "Operate", text: "Library issues/returns, hostel rooms & members, transport routes & payments, inventory stock, events and committees." },
            { title: "Certificates", text: "Print ID cards and certificates carrying the identity data and verification codes." },
          ],
        },
        {
          key: "help",
          title: "Support & Accessibility",
          summary: "Getting help and who can access what.",
          roles: ["admin", "member", "central"],
          steps: [
            { title: "Support tickets", text: "Institutions raise tickets; the Central Controller resolves them." },
            { title: "Accessibility", text: "Admins run the portal; Principal/Teacher/Staff logins cover attendance, marks, leaves and payslips; Students/Parents see results, fees and notices; public pages (apply, track, verify, guide) need no login." },
            { title: "This guide", text: "Available from every sidebar and the login page — bilingual (English/বাংলা)." },
          ],
        },
      ],
    },
  ],
};

const BN: typeof EN = {
  roleLabels: {
    public: "পাবলিক (লগইন ছাড়া)",
    applicant: "আবেদনকারী (যাচাইকৃত)",
    admin: "প্রতিষ্ঠান অ্যাডমিন",
    staff: "প্রিন্সিপাল / শিক্ষক / স্টাফ লগইন",
    member: "শিক্ষার্থী / অভিভাবক লগইন",
    central: "কেন্দ্রীয় নিয়ন্ত্রক",
  },
  sections: [
    {
      key: "start",
      title: "শুরু করা",
      modules: [
        {
          key: "onboarding",
          title: "প্রতিষ্ঠান নিবন্ধন ও সক্রিয়করণ",
          summary: "সাইন-আপ থেকে প্রতিষ্ঠান পোর্টালে প্রথম লগইন পর্যন্ত।",
          roles: ["public", "central", "admin"],
          steps: [
            { title: "নিবন্ধন", text: "Register খুলে প্রতিষ্ঠানের ধরন বেছে নিন এবং প্রতিষ্ঠান + অ্যাডমিন তথ্য পূরণ করুন।" },
            { title: "কেন্দ্রীয় অনুমোদন", text: "কেন্দ্রীয় নিয়ন্ত্রক Central Panel থেকে আবেদন পর্যালোচনা করে প্রতিষ্ঠান অনুমোদন করেন।" },
            { title: "প্যাকেজ নির্বাচন", text: "সাবস্ক্রিপশন প্যাকেজ নিন; সাবস্ক্রিপশন শুরু হলেই পোর্টাল সক্রিয় হয়।" },
            { title: "প্রথম লগইন", text: "অ্যাডমিন ইমেইল দিয়ে সাইন ইন করুন — প্রতিষ্ঠান পোর্টাল ড্যাশবোর্ডে পৌঁছাবেন।" },
          ],
        },
        {
          key: "setup",
          title: "পোর্টালের প্রাথমিক সেটআপ",
          summary: "Control Panel ও Academic Info মডিউলগুলোর সব প্রস্তুতি সম্পন্ন করে।",
          roles: ["admin"],
          steps: [
            { title: "Control Panel", text: "যে মডিউলগুলো চালান সেগুলো চালু করুন, একাডেমিক শব্দ পরিবর্তন করুন, ভর্তি ফি ও পাবলিক ট্র্যাকিং পেজ সক্রিয় করুন, পেমেন্ট কালেকশন অ্যাকাউন্ট ও ইমেইল (SMTP) সেট করুন।" },
            { title: "Academic Info", text: "শ্রেণি, শাখা, বিষয়, শিক্ষাবর্ষ, গ্রুপ, শিফট ও রুম নির্বাচন করুন — বা প্রতিষ্ঠানের ধরন অনুযায়ী স্ট্যান্ডার্ড শ্রেণি তালিকা প্রয়োগ করুন।" },
            { title: "ব্যবহার নির্দেশিকা", text: "প্রতিটি মডিউলের প্রবাহ দেখতে সাইডবার থেকে এই গাইড যেকোনো সময় খুলুন।" },
          ],
        },
      ],
    },
    {
      key: "admissions",
      title: "ভর্তি",
      modules: [
        {
          key: "apply",
          title: "অনলাইন আবেদন (পাবলিক)",
          summary: "অভিভাবক কীভাবে অনলাইনে আবেদন করে রেফারেন্স নম্বর পান।",
          roles: ["public"],
          steps: [
            { title: "/apply খুলুন", text: "কোড বা নাম দিয়ে প্রতিষ্ঠান খুঁজুন — উইজার্ড শিক্ষার্থীর তথ্য দিয়ে শুরু হয়।" },
            { title: "ফর্ম পূরণ", text: "শিক্ষার্থী → অভিভাবক ও যোগাযোগ → ঠিকানা ও মন্তব্য; ইচ্ছা করলে ট্র্যাকিং-অ্যাকাউন্ট পাসওয়ার্ড দিন; পর্যালোচনা করে জমা দিন।" },
            { title: "রেফারেন্স ও ইমেইল", text: "রেফারেন্স নম্বর (APP-XXXXX) স্ক্রিনে দেখা যায় ও ইমেইল কনফিগার থাকলে ইমেইলেও আসে। আবেদনটি প্রতিষ্ঠানের ভর্তি তালিকায় যায় (ফি চালু থাকলে সংযুক্ত থাকে)।" },
          ],
        },
        {
          key: "track",
          title: "আবেদন ট্র্যাকিং",
          summary: "পাবলিক অবস্থা, অপেক্ষমান অবস্থান ও ফি লেনদেন জমা।",
          roles: ["public", "applicant"],
          steps: [
            { title: "/track খুলুন", text: "প্রতিষ্ঠানের কোড + আবেদনের রেফারেন্স দিন (বা ইমেইল/সফল স্ক্রিনের লিংক ব্যবহার করুন)।" },
            { title: "পরিচয় যাচাই", text: "আবেদনে ব্যবহৃত ফোন/ইমেইল বা ট্র্যাকিং-অ্যাকাউন্টের পাসওয়ার্ড দিয়ে নিশ্চিত করুন।" },
            { title: "ট্র্যাক", text: "অবস্থা, অবস্থান ও ফি'র অবস্থা দেখুন; প্রতিষ্ঠানের যাচাইয়ের জন্য পেমেন্ট গেটওয়ে + লেনদেন আইডি জমা দিন।" },
          ],
        },
        {
          key: "decide",
          title: "আবেদন অনুমোদন (পোর্টাল)",
          summary: "ভর্তি তালিকা থেকে নথিভুক্ত শিক্ষার্থী পর্যন্ত।",
          roles: ["admin"],
          steps: [
            { title: "ভর্তি ফরম", text: "আবেদন পর্যালোচনা করুন; ওয়ালেট বাটনে আবেদন ফি রেকার্ড/মকুব করুন (আবেদনকারীর জমা দেওয়া লেনদেন আইডি এখানেই দেখা যায়)।" },
            { title: "অনুমোদন", text: "ঐচ্ছিক কাস্টম রোলসহ অনুমোদন দিন — শিক্ষার্থীর রেকর্ড স্বয়ংক্রিয়ভাবে তৈরি ও নথিভুক্ত হয়।" },
            { title: "প্রত্যাখ্যান", text: "প্রত্যাখ্যাত আবেদন তালিকায় সংরক্ষিত থাকে।" },
          ],
        },
      ],
    },
    {
      key: "people",
      title: "শিক্ষার্থী, সদস্য ও মানবসম্পদ",
      modules: [
        {
          key: "students",
          title: "শিক্ষার্থী ব্যবস্থাপনা",
          summary: "প্রোফাইল, ছবি, ডকুমেন্ট, পরিচয় ও প্রমোশন।",
          roles: ["admin", "staff"],
          steps: [
            { title: "শিক্ষার্থী পেজ", text: "ভর্তি অনুমোদনের পর শিক্ষার্থীরা যুক্ত হয় — শ্রেণি/শাখা ফিল্টার ও সার্চ সহ।" },
            { title: "প্রোফাইল", text: "ছবি আপলোড, তথ্য সম্পাদনা, ডকুমেন্ট (এনআইডি/জন্ম) ও মিডিয়া ব্যবস্থাপনা।" },
            { title: "Student Identity", text: "রোল, রেজিস্ট্রেশন ও আইডি-কার্ডের তথ্য — প্রয়োজনে স্টাফ রক্ষকদের দায়িত্ব দিন।" },
            { title: "প্রমোশন", text: "বছর শেষে পরবর্তী শ্রেণিতে একসাথে উন্নীত করুন।" },
          ],
        },
        {
          key: "credentials",
          title: "সদস্য লগইন",
          summary: "শিক্ষার্থী, অভিভাবক, শিক্ষক, প্রিন্সিপাল ও স্টাফদের অ্যাকাউন্ট।",
          roles: ["admin"],
          steps: [
            { title: "Member Credentials", text: "শিক্ষার্থী পেজ (শিক্ষার্থী/অভিভাবক) বা Human Resource (প্রিন্সিপাল, ভাইস প্রিন্সিপাল, নির্বাহী সদস্যসহ স্টাফ-সাইড লগইন)।" },
            { title: "তৈরি", text: "ব্যক্তি বেছে ইউজারনেম + পাসওয়ার্ড দিন — সদস্যরা প্রতিষ্ঠান কোড + ইউজারনেম দিয়ে লগইন করে।" },
            { title: "/me ব্যবহার", text: "তাদের পোর্টাল: ফলাফল, ফি, নোটিশ, ছুটি, পে-স্লিপ ও প্রোফাইল।" },
          ],
        },
        {
          key: "hr",
          title: "মানবসম্পদ",
          summary: "কর্মী তালিকা, হাজিরা, ছুটি, বেতন ও অডিট।",
          roles: ["admin", "staff"],
          steps: [
            { title: "কর্মী", text: "ছবি ও স্বাক্ষরসহ কর্মী যোগ করুন (স্বাক্ষর ফলাফলের শীটে ছাপা হয়)।" },
            { title: "হাজিরা ও ছুটি", text: "দৈনিক হাজিরা দিন; ছুটির আবেদন ও অনুমোদন করুন।" },
            { title: "বেতন", text: "সম্পূর্ণ পেমেন্ট তথ্যসহ (TrxID/ব্যাংক/কার্ড) মাসিক বেতন পরিশোধ করুন — কর্মীরা /me-তে পে-স্লিপ দেখেন।" },
            { title: "লগইন অডিট", text: "সদস্যদের কার্যক্রম যাচাইয়ের জন্য প্রতিটি লগইনের চেষ্টা (সফল/ব্যর্থ, IP) পর্যালোচনা করুন।" },
          ],
        },
      ],
    },
    {
      key: "academics",
      title: "ফি, পরীক্ষা ও ফলাফল",
      modules: [
        {
          key: "fees",
          title: "ফি ব্যবস্থাপনা",
          summary: "ফি হেড, শিডিউল, আদায় ও সদস্যদের বিবরণী।",
          roles: ["admin", "member"],
          steps: [
            { title: "ফি হেড", text: "ভর্তি/টিউশন/পরীক্ষা/অন্যান্য হেড ডিফল্ট পরিমাণসহ তৈরি করুন।" },
            { title: "শিডিউল", text: "শ্রেণি বা শিক্ষার্থীভিত্তিক ফি নির্ধারণ করুন — বা Control Panel থেকে বিষয়ভিত্তিক মাসিক ফি ব্যবহার করুন।" },
            { title: "আদায়", text: "মাধ্যম + লেনদেন তথ্যসহ পেমেন্ট রেকর্ড করুন; সদস্যরা /me-তে বিবরণী ও কোথায় পরিশোধ করবেন তা দেখেন।" },
          ],
        },
        {
          key: "exams",
          title: "পরীক্ষা ও নম্বর",
          summary: "পরীক্ষা তৈরি থেকে প্রকাশিত নম্বর পর্যন্ত।",
          roles: ["admin", "staff"],
          steps: [
            { title: "পরীক্ষা তৈরি", text: "শাখা/শ্রেণি/শিফট অনুযায়ী শুরু-শেষ তারিখসহ পরীক্ষা তৈরি করুন।" },
            { title: "রুটিন", text: "নম্বর বিভাজনসহ (CQ/MCQ/অ্যাপ্লাইড) পেপার শিডিউল করুন; ক্ল্যাশ ডিটেকশন রুম দ্বন্দ্বমুক্ত রাখে।" },
            { title: "নম্বর এন্ট্রি", text: "শিক্ষকরা বিষয়ভিত্তিক বা শিক্ষার্থীভিত্তিক নম্বর দেন; রুটিন প্রকাশ করলে সম্পাদনা লক হয়।" },
          ],
        },
        {
          key: "results",
          title: "ফলাফলের শীট",
          summary: "ফরম্যাট, সূত্র, স্বাক্ষর ও যাচাই।",
          roles: ["admin", "public"],
          steps: [
            { title: "ফরম্যাট বাছুন", text: "সিঙ্গেল, পিরিয়ডিক্যাল, সমন্বিত, চূড়ান্ত (৩ ওয়েটেড সেট) বা হাই স্কুল — ⓘ ফলাফলের সূত্র ব্যাজ প্রতিটি হিসাব ব্যাখ্যা করে।" },
            { title: "শীট", text: "মার্কশীটে গ্রেডিং স্কেল, জিপিএ (হাই স্কুল — বাংলাদেশ জোড়া পেপার পাস নিয়মসহ), মেধা তালিকা ও প্রিন্সিপালের স্বাক্ষর থাকে।" },
            { title: "যাচাই", text: "প্রতিটি শীটে QR থাকে — যে কেউ পাবলিক যাচাই পেজে সত্যতা নিশ্চিত করতে পারেন।" },
          ],
        },
      ],
    },
    {
      key: "daily",
      title: "দৈনন্দিন কার্যক্রম",
      modules: [
        {
          key: "communication",
          title: "নোটিশ ও যোগাযোগ",
          summary: "শিক্ষার্থী, অভিভাবক ও কর্মীদের কাছে পৌঁছানো।",
          roles: ["admin", "member"],
          steps: [
            { title: "নোটিশ বোর্ড", text: "সদস্যদের পোর্টালে দেখা নোটিশ প্রকাশ করুন।" },
            { title: "ব্রডকাস্ট", text: "যোগাযোগ প্যানেল থেকে শ্রেণি, শিক্ষার্থী বা কর্মীদের SMS/ইমেইল/হোয়াটসঅ্যাপ পাঠান।" },
            { title: "কথোপকথন", text: "আবেদনকারী ও অভিভাবকদের সাথে দ্বিমুখী বার্তা।" },
          ],
        },
        {
          key: "modules",
          title: "সহায়ক মডিউল",
          summary: "লাইব্রেরি, হোস্টেল, পরিবহন, ইনভেন্টরি, ইভেন্ট ও সার্টিফিকেট।",
          roles: ["admin"],
          steps: [
            { title: "চালু করুন", text: "Control Panel থেকে প্রতিটি মডিউল টগল করুন — যেগুলো চালান শুধু সেগুলোই সাইডবারে দেখা যায়।" },
            { title: "পরিচালনা", text: "লাইব্রেরি ইস্যু/রিটার্ন, হোস্টেল রুম ও সদস্য, পরিবহন রুট ও পেমেন্ট, ইনভেন্টরি স্টক, ইভেন্ট ও কমিটি।" },
            { title: "সার্টিফিকেট", text: "পরিচয় তথ্য ও যাচাই কোডসহ আইডি কার্ড ও সার্টিফিকেট ছাপুন।" },
          ],
        },
        {
          key: "help",
          title: "সহায়তা ও প্রবেশাধিকার",
          summary: "সহায়তা পাওয়া এবং কে কী ব্যবহার করতে পারে।",
          roles: ["admin", "member", "central"],
          steps: [
            { title: "সাপোর্ট টিকেট", text: "প্রতিষ্ঠান টিকেট তোলে; কেন্দ্রীয় নিয়ন্ত্রক সমাধান করেন।" },
            { title: "প্রবেশাধিকার", text: "অ্যাডমিনরা পোর্টাল চালান; প্রিন্সিপাল/শিক্ষক/স্টাফ লগইনে হাজিরা, নম্বর, ছুটি ও পে-স্লিপ; শিক্ষার্থী/অভিভাবকরা ফলাফল, ফি ও নোটিশ দেখেন; পাবলিক পেজে (আবেদন, ট্র্যাক, যাচাই, গাইড) লগইন লাগে না।" },
            { title: "এই গাইড", text: "প্রতিটি সাইডবার ও লগইন পেজ থেকে উপলব্ধ — দ্বিভাষিক (English/বাংলা)।" },
          ],
        },
      ],
    },
  ],
};

export function getGuide(locale: GuideLocale) {
  return locale === "bn" ? BN : EN;
}
