<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Edit Quiz</title>

<link rel="icon" type="image/png" href="/admin_assets/images/favicon.webp">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background: #020617;
            display: flex;
        }

        /* SIDEBAR */
        .sidebar {
            width: 240px;
            height: 100vh;
            background: #0f172a;
            padding: 20px;
            position: fixed;
        }

        .logo {
            color: #fff;
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 30px;
        }

        .menu a {
            display: block;
            color: #94a3b8;
            padding: 12px;
            border-radius: 10px;
            margin-bottom: 10px;
            text-decoration: none;
        }

        .menu a:hover,
        .menu .active {
            background: #1e293b;
            color: #fff;
        }

        /* MAIN */
        .main {
            margin-left: 250px;
            padding: 40px;
            width: 100%;
        }

        /* HEADER */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
        }

        .header h2 {
            color: #fff;
        }

        /* CARD */
        .card {
            max-width: 750px;
            margin: auto;
            background: #1e293b;
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        .card-header {
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            padding: 20px 25px;
            color: #fff;
            font-size: 18px;
            font-weight: 600;
        }

        .card-body {
            padding: 30px;
        }

        /* FORM */
        .form-label {
            color: #cbd5f5;
            font-weight: 500;
            margin-bottom: 6px;
        }

        .form-control {
            width: 100%;
            padding: 10px;
            border-radius: 10px;
            border: none;
            background: #273449;
            color: #fff;
            margin-bottom: 15px;
        }

        .form-control:focus {
            outline: none;
            box-shadow: 0 0 0 2px #6366f1;
        }

        /* BUTTONS */
        .btn-update {
            background: linear-gradient(45deg, #22c55e, #16a34a);
            border: none;
            padding: 10px 22px;
            border-radius: 25px;
            color: #fff;
            font-weight: 600;
            cursor: pointer;
            transition: 0.3s;
        }

        .btn-update:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
        }

        .btn-cancel {
            background: #334155;
            border: none;
            padding: 10px 22px;
            border-radius: 25px;
            color: #fff;
            margin-right: 10px;
            text-decoration: none;
        }

        .btn-cancel:hover {
            background: #475569;
        }

        .text-end {
            text-align: right;
        }
    </style>
</head>

<body>

    <!-- SIDEBAR -->
    <div class="sidebar">
        <div class="logo">Instructor Panel</div>

        <div class="menu">
            <a href="/mentor/dashboard">Dashboard</a>
            <a href="/mentor/content">Content</a>
            <a href="/mentor/models" class="active">3D Models</a>
            <a href="/mentor/quiz">Quiz</a>
            <a href="/mentor/quiz-list">Quiz Lists</a>
            <a href="/mentor/leaderboard">Leaderboard</a>
        </div>
    </div>

    <!-- MAIN -->
    <div class="main">

        <!-- HEADER -->
        <div class="header">
            <h2>✏️ Edit Quiz</h2>
            <div style="color:#fff;">Mentor Panel</div>
        </div>

        <!-- CARD -->
        <div class="card">

            <div class="card-header">
                Edit Quiz Details
            </div>

            <div class="card-body">

                <form action="/mentor/update-quiz" method="POST">

                    <input type="hidden" name="id" value="<%= quiz.id %>">

                    <!-- Course -->
                    <label class="form-label">Select Course</label>
                    <select name="course_id" class="form-control" required>
                        <% courses.forEach(course=> { %>
                            <option value="<%= course.course_id %>" <%=course.course_id==quiz.course_id ? "selected"
                                : "" %>>
                                <%= course.course_name %>
                            </option>
                            <% }) %>
                    </select>

                    <!-- Title -->
                    <label class="form-label">Quiz Title</label>
                    <input type="text" name="quiz_title" class="form-control" value="<%= quiz.quiz_title %>" required>

                    <!-- BUTTONS -->
                    <div class="text-end">

                        <a href="/mentor/quiz-list" class="btn-cancel">
                            Cancel
                        </a>

                        <button type="submit" class="btn-update">
                            Update Quiz
                        </button>

                    </div>

                </form>

            </div>

        </div>

    </div>

</body>

</html>