<?php
$userName = $_SESSION['full_name'] ?? 'Guru';
$userEmoji = $_SESSION['profile_emoji'] ?? '👨‍🏫';
$educationLevel = isset($teacher) ? ($teacher['education_level'] ?? '') : '';
$subjects = isset($teacher) && !empty($teacher['subjects']) ? implode(', ', json_decode($teacher['subjects'] ?? '[]')) : 'Panel Pengurusan TutorKita';
?>
<div class="page-header">
    <div>
        <h1 class="page-title" id="userGreeting">Selamat sejahtera, Cikgu <?php echo htmlspecialchars(explode(' ', $userName)[0]); ?>!</h1>
        <p class="page-subtitle" id="teacherSubjects">Subjek Diajar: <?php echo $subjects; ?></p>
    </div>
    <div style="display: flex; align-items: center; gap: 15px;">
        <div id="profileEmoji" style="font-size: 2.5rem;"><?php echo $userEmoji; ?></div>
        <div><strong><?php echo $userName; ?></strong><p style="margin:0;color:var(--text-secondary);font-size:0.9rem;"><?php echo $educationLevel ?: 'Guru'; ?></p></div>
</div>
