<%- include("navbar") %>

    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
        rel="stylesheet">

    <style>
        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, #0f172a, #1e293b);
            min-height: 100vh;
        }

        /* OFFSET */
        .quiz-wrapper {
            margin-left: 250px;
            margin-top: 70px;
            padding: 40px;
        }

        /* MAIN CARD */
        .quiz-container {
            max-width: 1000px;
            margin: auto;
            background: #ffffff;
            padding: 45px;
            border-radius: 25px;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
            position: relative;
        }

        /* HEADER */
        .quiz-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 35px;
            padding-bottom: 20px;
            border-bottom: 1px solid #e2e8f0;
        }

        .quiz-header h2 {
            font-weight: 600;
            color: #0f172a;
        }

        /* TIMER */
        .timer-box {
            background: linear-gradient(90deg, #6366f1, #22d3ee);
            padding: 8px 18px;
            border-radius: 25px;
            font-size: 14px;
            font-weight: 500;
            color: #fff;
            animation: pulse 1.8s infinite;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
            }

            70% {
                box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
            }
        }

        /* QUESTION CARD */
        .question-card {
            background: #f1f5f9;
            padding: 28px;
            border-radius: 18px;
            margin-bottom: 28px;
            transition: .3s;
            border: 2px solid transparent;
        }

        .question-card:hover {
            border-color: #6366f1;
            background: #eef2ff;
        }

        .question-card p {
            margin-bottom: 18px;
            font-weight: 600;
            color: #1e293b;
        }

        /* OPTIONS */
        .option {
            display: flex;
            align-items: center;
            padding: 13px 18px;
            border-radius: 12px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: .3s;
            background: #ffffff;
            border: 1px solid #e2e8f0;
            font-size: 14px;
        }

        .option:hover {
            background: #6366f1;
            color: white;
            border-color: #6366f1;
        }

        .option input {
            margin-right: 10px;
            accent-color: #6366f1;
        }

        /* Selected effect */
        .option input:checked+span {
            font-weight: 600;
        }

        /* BUTTON */
        .submit-btn {
            display: block;
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 14px;
            background: linear-gradient(90deg, #6366f1, #8b5cf6);
            color: white;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: .3s;
            margin-top: 25px;
            box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
        }

        .submit-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
        }

        /* RESPONSIVE */
        @media(max-width:992px) {
            .quiz-wrapper {
                margin-left: 0;
                padding: 25px;
            }

            .quiz-container {
                padding: 25px;
            }
        }
    </style>


    <div class="quiz-wrapper">

        <div class="quiz-container">

            <div class="quiz-header">
                <h2>📝 Quiz Assessment</h2>
                <div class="timer-box">⏳ Time: 30:00</div>
            </div>

            <form action="/submit-quiz" method="post">
                <input type="hidden" name="quiz_id" value="<%= quizId %>">

                <% questions.forEach((q,index)=>{ %>

                    <div class="question-card">
                        <p>Q<%= index+1 %>. <%= q.question %>
                        </p>

                        <label class="option">
                            <input type="radio" name="answer_<%= q.id %>" value="1" required>
                            <span>
                                <%= q.option1 %>
                            </span>
                        </label>

                        <label class="option">
                            <input type="radio" name="answer_<%= q.id %>" value="2">
                            <span>
                                <%= q.option2 %>
                            </span>
                        </label>

                        <label class="option">
                            <input type="radio" name="answer_<%= q.id %>" value="3">
                            <span>
                                <%= q.option3 %>
                            </span>
                        </label>

                        <label class="option">
                            <input type="radio" name="answer_<%= q.id %>" value="4">
                            <span>
                                <%= q.option4 %>
                            </span>
                        </label>
                    </div>

                    <% }) %>

                        <button type="submit" class="submit-btn">
                            🚀 Submit Quiz
                        </button>

            </form>

        </div>

    </div>

    <%- include("footer") %>