<?php
// /elms/lecturer/profile.php
declare(strict_types=1);

require_once __DIR__ . '/../includes/lecturer_auth.php';

$PAGE_TITLE = 'Profile';
$ACTIVE = 'profile';

$lecturer = $LECTURER_USER ?? lecturer_user();

require_once __DIR__ . '/../includes/lecturer_layout_top.php';
?>

<div class="row g-3">
    <div class="col-lg-4">
        <div class="lux-card">
            <div class="lux-card-body text-center">
                <div class="avatar mx-auto mb-3" style="width:84px;height:84px;border-radius:28px;font-size:1.6rem;">
                    <?= lecturer_h(lecturer_initials((string)($lecturer['name'] ?? 'Lecturer'))) ?>
                </div>

                <h5 class="fw-bold mb-1"><?= lecturer_h($lecturer['name'] ?? 'Lecturer') ?></h5>
                <div class="text-muted small mb-3"><?= lecturer_h($lecturer['email'] ?? '') ?></div>

                <span class="badge-lux">
                    <i class="bi bi-shield-check"></i> Lecturer
                </span>
            </div>
        </div>
    </div>

    <div class="col-lg-8">
        <div class="lux-card">
            <div class="lux-card-header">
                <h5 class="mb-1 fw-bold">Account Details</h5>
                <div class="text-muted small">Your lecturer account information.</div>
            </div>

            <div class="lux-card-body">
                <div class="row g-3">
                    <div class="col-md-6">
                        <label class="form-label small fw-bold">Name</label>
                        <input type="text" class="form-control" value="<?= lecturer_h($lecturer['name'] ?? '') ?>" readonly>
                    </div>

                    <div class="col-md-6">
                        <label class="form-label small fw-bold">Email</label>
                        <input type="text" class="form-control" value="<?= lecturer_h($lecturer['email'] ?? '') ?>" readonly>
                    </div>

                    <div class="col-md-6">
                        <label class="form-label small fw-bold">Role</label>
                        <input type="text" class="form-control" value="Lecturer" readonly>
                    </div>

                    <div class="col-md-6">
                        <label class="form-label small fw-bold">User ID</label>
                        <input type="text" class="form-control" value="<?= (int)($lecturer['id'] ?? 0) ?>" readonly>
                    </div>
                </div>

                <div class="alert alert-light border mt-4 mb-0">
                    <i class="bi bi-info-circle"></i>
                    Profile changes should be managed by the administrator.
                </div>
            </div>
        </div>
    </div>
</div>

<?php require_once __DIR__ . '/../includes/lecturer_layout_bottom.php'; ?>