<?php

namespace App\Controllers;

class Home extends BaseController
{
    public function index()
    {
        return $this->render('public/home', [
            'title'=>'Healthcare that comes to you | TibaLeta',
            'metaDescription'=>'Book trusted doctors, nurses, physiotherapists and home healthcare professionals with TibaLeta.',
        ]);
    }

    public function page(string $slug)
    {
        $pages = [
            'about' => ['About TibaLeta','Care should fit into life—not the other way around.','TibaLeta connects families with verified healthcare professionals for safe, convenient care at home. Our platform combines practitioner discovery, dispatch, records, payments and follow-up in one coordinated experience.'],
            'services' => ['Care for every stage of life','From one-off visits to ongoing home care.','Book doctor home visits, nursing, physiotherapy, home sample collection, elderly care, maternal support, chronic care and secure virtual consultations.'],
            'how-it-works' => ['Care in three simple steps','Tell us what you need. We coordinate the rest.','Choose a service and location, get matched with an eligible verified practitioner, then manage arrival, treatment records, payment and follow-up from your account.'],
            'for-practitioners' => ['Practice beyond the clinic','Build a flexible home-care practice with TibaLeta.','Verified professionals can set availability, service areas and services, receive suitable nearby requests, document visits securely and track earnings in one dashboard.'],
            'partners' => ['Connect your healthcare network','One platform for labs, pharmacies, hospitals and insurers.','TibaLeta is designed to coordinate home sample collection, medication fulfilment, referrals and partner workflows around each patient journey.'],
            'resources' => ['Health resources','Clear, practical guidance for patients and families.','Explore home-care guides, prevention resources, recovery support and practical information prepared for everyday healthcare decisions.'],
            'faq' => ['Frequently asked questions','Everything you need to know before requesting care.','Learn how practitioner verification, pricing, home visits, family profiles, payments, privacy and emergency escalation work on TibaLeta.'],
            'contact' => ['Talk to TibaLeta','Questions about care, partnerships or practitioner onboarding?','Use the contact form to reach our care support team. For emergencies, use the appropriate local emergency service rather than requesting routine home care.'],
            'privacy' => ['Privacy notice','Your health information deserves strong protection.','TibaLeta is designed around consent, least-privilege access, encrypted transport, audit logging and separation of clinical information from ordinary account data.'],
            'terms' => ['Terms of service','Clear responsibilities for patients, practitioners and partners.','These platform terms cover account use, bookings, payments, cancellations, practitioner obligations, acceptable use and limitations of the service.'],
        ];
        if (!isset($pages[$slug])) throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
        [$heading,$eyebrow,$copy]=$pages[$slug];
        return $this->render('public/page',['title'=>$heading.' | TibaLeta','heading'=>$heading,'eyebrow'=>$eyebrow,'copy'=>$copy,'slug'=>$slug]);
    }
}
