/* === QUIZ BUILDER CONTAINER === */
#csuk_quiz_builder_container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* === HEADINGS === */
#csuk_quiz_builder_container h2 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

/* === GENERATE CONTAINER === */
.mcq-generate-container {
    border: 2px solid #000;
    border-radius: 20px;
    padding: 20px;
}


/* === YOUTUBE SECTION STYLING === */
#tab-youtube .youtube-flex-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 20px;
}

/* Right side: form inputs */
#tab-youtube .youtube-form-content {
    flex: 1 1 300px;
    min-width: 300px;
}

/* Left side: video embed */
#tab-youtube .youtube-video-preview {
    flex: 1 1 350px;
    min-width: 300px;
    max-width: 500px;
	border: black dashed 1px;
    min-height: 200px;
    border-radius: 20px;
}

#tab-youtube .video-embed iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}



/* ===========================
   QUIZ BUILDER (Teachers)
   =========================== */

#csuk_teacher_quiz_form {
    max-width: 850px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', sans-serif;
}

#csuk_teacher_quiz_form h2,
#csuk_teacher_quiz_form h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

#csuk_teacher_quiz_form label {
    font-weight: bold;
    display: block;
    margin-top: 12px;
    color: #444;
}

.quiz_title_block {
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f1f5f9;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.quiz_title_block label {
    font-weight: bold;
    color: #333;
}

.quiz_title_block input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Input fields */
#csuk_teacher_quiz_form input[type="text"],
#csuk_teacher_quiz_form input[type="number"],
#csuk_teacher_quiz_form input[type="url"],
#csuk_teacher_quiz_form input[type="datetime-local"],
#csuk_teacher_quiz_form textarea,
#csuk_teacher_quiz_form select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    transition: 0.3s ease;
}

#csuk_teacher_quiz_form input:focus,
#csuk_teacher_quiz_form textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 6px rgba(0, 115, 170, 0.2);
    outline: none;
}

/* === Question Blocks === */
.question_block {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-left: 6px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.question_block:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.question_block h3 {
    margin-top: 0;
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.question_block label {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    display: block;
    color: #333;
}

.question_block .question-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    transition: 0.3s;
    min-height: 80px;
}

.question_block input[name="feedback[]"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* === Answer Options === */
.answer_options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 15px;
}

.answer_options div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f4f7fa;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.answer_options input[type="text"] {
    flex-grow: 1;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: 0.3s;
}

.answer_options input[type="text"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.2);
}

.answer_options label {
    font-weight: normal;
    color: #333;
    margin: 0;
}

.answer_options input[type="radio"] {
    transform: scale(1.3);
    cursor: pointer;
}

/* === Buttons === */
#add_question,
#csuk_submit_quiz,
.csuk_quiz_save_btn {
    display: block;
    width: 100%;
    background: #0073aa;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 25px;
    transition: 0.3s ease;
    font-size: 16px;
    font-weight: bold;
}

#add_question:hover,
#csuk_submit_quiz:hover,
.csuk_quiz_save_btn:hover {
    background: #005f8c;
}

/* === Save Options Tabs (reusing existing styles) === */
#quiz_save_options {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px dashed #ccc;
}

#quiz_save_options input[type="text"],
#quiz_save_options input[type="datetime-local"] {
    margin-bottom: 15px;
}


/* AI Modal Styling */
#csuk_ai_modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Ensure it appears above everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dark overlay */
}

/* Modal Content Box */
.ai-modal-content {
    background-color: white;
    width: 40%;
    max-width: 600px;
    padding: 20px;
    border-radius: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Close Button */
.close-ai-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

/* Input Fields */
#csuk_ai_topics, #csuk_ai_num_questions {
    width: 90%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Generate Button */
#csuk_ai_generate_button {
    background-color: #0073aa;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
}

#csuk_ai_generate_button:hover {
    background-color: #005f8d;
}

/* Output Div */
#csuk_ai_output {
    margin-top: 15px;
    text-align: left;
    font-size: 14px;
    color: #333;
}



/* ===========================
   QUIZ BUILDING ANIMATION
   =========================== */

.mcq-loading-container {
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.mcq-loading-text {
    font-size: 16px;
    color: #333;
}

.mcq-loader {
    display: block;
    margin: 12px auto 0;
    width: 400px;
    height: auto;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}



/* ===========================
   QUIZ SELECTION PAGE (Students)
   =========================== */
#csuk_quiz_list {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

#csuk_quiz_list h2 {
    font-size: 24px;
    color: #333;
}

#csuk_quiz_list ul {
    list-style: none;
    padding: 0;
}

#csuk_quiz_list li {
    background: #f8f8f8;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    transition: 0.3s ease;
}

#csuk_quiz_list li:hover {
    background: #e2e2e2;
}

.take-quiz-button {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: 0.3s ease;
}

.take-quiz-button:hover {
    background: #005f8c;
}

/* ==========================
   MODERN QUIZ STYLING
   ========================== */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #218838;
    --background-color: #f4f4f4;
    --card-bg: #fff;
    --text-color: #333;
    --highlight-color: rgba(76, 175, 80, 0.2);
}

/* Quiz Container */
#quiz-container {
    margin: 40px auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15);
    text-align: center;
}

/* Quiz Header */
#quiz-container h2 {
    font-size: 24px;
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 15px;
}

/* Quiz Progress Bar */
#quiz-progress-container {
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

#quiz-progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary-color);
    transition: width 0.5s ease-in-out;
    border-radius: 10px;
}

/* Question Navigator */
#quiz-navigator {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.quiz-nav-btn {
    margin: 5px;
    padding: 10px 15px;
    border: 2px solid #ccc;
    border-radius: 5px;
    background: #f8f8f8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
	color: black;
}

.quiz-nav-btn:hover {
    background: #e8e8e8;
}

.quiz-nav-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #388E3C;
}

.quiz-nav-btn.answered {
    background: var(--primary-color);
    color: white;
}

/* Question Box */
.quiz-question {
    display: none;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Question Text */
.quiz-question h3 {
    font-size: 20px;
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 15px;
}

/* Answer Options */
.quiz-question label {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.quiz-question label:hover {
    background: var(--highlight-color);
    transform: scale(1.02);
}

.quiz-question input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

/* Buttons */
.quiz-question .submit-answer,
#submit-quiz,
#retake-quiz {
    display: block;
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s ease-in-out, transform 0.2s;
    font-size: 18px;
    font-weight: bold;
}

.quiz-question .submit-answer:hover,
#submit-quiz:hover,
#retake-quiz:hover {
    background: var(--secondary-color);
    transform: scale(1.02);
}

#submit-quiz {
    display: none;
}

#retake-quiz {
    display: none;
    background: #d9534f;
}

#retake-quiz:hover {
    background: #c9302c;
}

/* Feedback Styling */
.feedback {
    margin-top: 15px;
    font-size: 16px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.feedback.correct {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
}

.feedback.incorrect {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
}

/* Responsive Design */
@media (max-width: 600px) {
    #quiz-container {
        padding: 15px;
    }

    .quiz-nav-btn {
        padding: 10px 12px;
        font-size: 14px;
    }

    .quiz-question h3 {
        font-size: 18px;
    }

    .quiz-question label {
        font-size: 14px;
        padding: 10px;
    }

    .quiz-question .submit-answer {
        font-size: 16px;
        padding: 12px;
    }
}



/******************TAB SWITCHING*************************/

.ai-tab-buttons {
    margin-top: 20px;
    margin-bottom: 10px;
}

.ai-tab-btn {
    padding: 8px 14px;
    border: none;
    cursor: pointer;
    margin-right: 5px;
    background: #f0f0f0;
    border-radius: 4px;
}

.ai-tab-btn.active {
    background: #0054a6;
    color: white;
}

.ai-tab-content {
    display: none;
}

.ai-tab-content.active {
    display: block;
}
