redesign this
""
 <div class="modal fade" id="createQuizModal" tabindex="-1" aria-labelledby="createQuizModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-xl modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="createQuizModalLabel">Create New Quiz</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <form id="createQuizForm" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                    <input type="hidden" name="action" value="create_quiz">
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-lg-7 border-end-lg border-secondary-subtle pe-lg-3 mb-3 mb-lg-0">
                                <div class="mb-2">
                                    <label for="createQuizTitle" class="form-label">Quiz Title*</label>
                                    <input type="text" class="form-control" id="createQuizTitle" name="quizTitle" required>
                                </div>
                                <div class="mb-2">
                                    <label for="createQuizDescription" class="form-label">Description</label>
                                    <textarea class="form-control" id="createQuizDescription" name="quizDescription" rows="2"></textarea>
                                </div>
                                <div class="row">
                                    <div class="col-md-6 mb-2">
                                        <label for="createQuizCourse" class="form-label">Course (Optional)</label>
                                        <select class="form-select" id="createQuizCourse" name="quizCourse">
                                            <option value="">All Courses</option>
                                            <?php foreach ($courses_list as $course): ?>
                                                <option value="<?php echo $course['id']; ?>"><?php echo htmlspecialchars($course['name'] . ($course['code'] ? ' ('.$course['code'].')' : '')); ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
                                    <div class="col-md-6 mb-2">
                                        <label for="createQuizSubject" class="form-label">Subject (Optional)</label>
                                        <select class="form-select" id="createQuizSubject" name="quizSubject">
                                            <option value="">All Subjects</option>
                                            <?php foreach ($subjects_list as $subject): ?>
                                                <option value="<?php echo $subject['id']; ?>"><?php echo htmlspecialchars($subject['name']); ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-4 mb-2">
                                        <label for="createQuizTimeLimit" class="form-label">Time Limit (min)*</label>
                                        <input type="number" class="form-control" id="createQuizTimeLimit" name="quizTimeLimit" min="1" value="30" required>
                                    </div>
                                    <div class="col-md-4 mb-2">
                                        <label for="createQuizDeadline" class="form-label">Deadline*</label>
                                        <input type="datetime-local" class="form-control" id="createQuizDeadline" name="quizDeadline" required>
                                    </div>
                                    <div class="col-md-4 mb-2">
                                        <label for="createQuizStatus" class="form-label">Status</label>
                                        <select class="form-select" id="createQuizStatus" name="quizStatus">
                                            <option value="draft" selected>Draft</option>
                                            <option value="active">Active</option>
                                        </select>
                                    </div>
                                </div>
                                <hr class="my-2">
                                <h6 class="form-label mb-1">Available Questions</h6>
                                <div class="row mb-2 question-item-filters">
                                    <div class="col-md-6">
                                        <label for="modalCreateCourseFilter" class="form-label small">Filter by Course:</label>
                                        <select id="modalCreateCourseFilter" class="form-select form-select-sm">
                                            <option value="">All Courses</option>
                                            <?php foreach ($courses_list as $course): ?>
                                                <option value="<?php echo $course['id']; ?>"><?php echo htmlspecialchars($course['name'] . ($course['code'] ? ' ('.$course['code'].')' : '')); ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
                                    <div class="col-md-6">
                                        <label for="modalCreateSubjectFilter" class="form-label small">Filter by Subject:</label>
                                        <select id="modalCreateSubjectFilter" class="form-select form-select-sm">
                                            <option value="">All Subjects</option>
                                            <?php foreach ($subjects_list as $subject): ?>
                                                <option value="<?php echo $subject['id']; ?>"><?php echo htmlspecialchars($subject['name']); ?></option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>
                                </div>
                                <div id="availableQuestionsContainerCreate" class="question-selection-container">
                                    <?php if (!empty($all_questions_for_modal_filtering)): ?>
                                        <?php foreach ($all_questions_for_modal_filtering as $question): ?>
                                            <div class="form-check question-item" data-course-id="<?php echo $question['course_id'] ?? ''; ?>" data-subject-id="<?php echo $question['subject_id'] ?? ''; ?>">
                                                <input class="form-check-input question-checkbox" type="checkbox" 
                                                       name="selected_questions[]" value="<?php echo $question['id']; ?>" 
                                                       id="q_create_<?php echo $question['id']; ?>"
                                                       data-default-marks="<?php echo htmlspecialchars($question['marks_per_question'] ?? 1.0); ?>">
                                                <label class="form-check-label" for="q_create_<?php echo $question['id']; ?>">
                                                    <?php echo htmlspecialchars(mb_strimwidth($question['question_text'], 0, 60, "...")); ?> 
                                                    <small class="text-muted-color">(Def: <?php echo htmlspecialchars($question['marks_per_question'] ?? 1.0); ?>)</small>
                                                </label>
                                            </div>
                                        <?php endforeach; ?>
                                         <p class="text-muted-color text-center p-3 no-questions-match-filter" style="display:none;">No questions match the selected filters.</p>
                                    <?php else: ?>
                                        <p class="text-muted-color text-center p-3">No questions available. Please create questions first.</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="col-lg-5 ps-lg-3">
                                <h6 class="form-label mb-1">Selected Questions (<span id="createSelectedQuestionCount">0</span>)</h6>
                                <p class="small text-muted-color mb-2">Total Marks: <strong id="createTotalMarksQuiz">0.0</strong></p>
                                <div id="selectedQuestionsContainerCreate" class="question-selection-container bg-light-dark">
                                    <p class="text-muted-color text-center p-3">No questions selected yet.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-custom-secondary" data-bs-dismiss="modal">Close</button>
                        <button type="submit" class="btn btn-custom-primary">Create Quiz</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
""