<?php $pageTitle = 'Create Question Bank'; ?>
<div class="mb-3"><a href="<?= base_url('admin/question-banks') ?>" 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-plus-circle text-orange me-2"></i> New Question Bank</h5></div>
    <?php if (!empty($error)): ?><div class="alert-cix alert-cix-error"><?= $error ?></div><?php endif; ?>
    <form method="POST" action="<?= base_url('admin/question-bank-create') ?>">
        <?= csrf_field() ?>
        <div class="row g-3">
            <div class="col-md-8"><div class="form-group-cix"><label class="form-label-cix">Bank Name *</label><input type="text" name="name" class="form-control-cix" required></div></div>
            <div class="col-md-4"><div class="form-group-cix"><label class="form-label-cix">Difficulty</label><select name="difficulty" class="form-control-cix"><option value="easy">Easy</option><option value="medium" selected>Medium</option><option value="hard">Hard</option></select></div></div>
            <div class="col-md-6"><div class="form-group-cix"><label class="form-label-cix">Category</label><input type="text" name="category" class="form-control-cix" placeholder="e.g., AI Basics, Prompting"></div></div>
            <div class="col-md-6"><div class="form-group-cix"><label class="form-label-cix">Course</label><select name="course_id" class="form-control-cix"><option value="">None</option><?php foreach ($courses as $c): ?><option value="<?= $c['id'] ?>"><?= e($c['title']) ?></option><?php endforeach; ?></select></div></div>
            <div class="col-12"><div class="form-group-cix"><label class="form-label-cix">Description</label><textarea name="description" class="form-control-cix" rows="3"></textarea></div></div>
        </div>
        <button type="submit" class="btn-cix btn-cix-accent mt-2"><i class="fas fa-save"></i> Create Bank</button>
    </form>
</div>
