<?php $pageTitle = 'Create Announcement'; ?>
<div class="mb-3"><a href="<?= base_url('admin/announcements') ?>" class="text-secondary"><i class="fas fa-arrow-left me-1"></i> Back</a></div>
<div class="card-cix">
    <div class="card-cix-header"><h5 class="mb-0"><i class="fas fa-bullhorn text-orange me-2"></i> New Announcement</h5></div>
    <?php if (!empty($error)): ?><div class="alert-cix alert-cix-error"><?= $error ?></div><?php endif; ?>
    <form method="POST" action="<?= base_url('admin/announcement-create') ?>">
        <?= csrf_field() ?>
        <div class="form-group-cix"><label class="form-label-cix">Title *</label><input type="text" name="title" class="form-control-cix" required></div>
        <div class="form-group-cix"><label class="form-label-cix">Content *</label><textarea name="content" class="form-control-cix" rows="6" required></textarea></div>
        <div class="form-group-cix"><label class="form-label-cix">Target Roles</label><select name="target_roles[]" class="form-control-cix" multiple><option value="student">Students</option><option value="teacher">Teachers</option><option value="super_admin">Admins</option></select></div>
        <div class="form-group-cix"><label class="form-label-cix">Expires At</label><input type="datetime-local" name="expires_at" class="form-control-cix"></div>
        <div class="form-check mb-3"><input class="form-check-input" type="checkbox" name="is_pinned" value="1"><label class="form-check-label text-secondary">Pin this announcement</label></div>
        <button type="submit" class="btn-cix btn-cix-accent"><i class="fas fa-paper-plane"></i> Publish</button>
    </form>
</div>
