:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #5c67b3;
    --success-color: #28a745;
    --error-color: #dc3545;
    --background-color: #f8f9fa;
    --text-color: #333;
    --header-bg-color: #343a40;
    --footer-bg-color: #f0f0f5;
    --footer-link-hover: #5c67b3;
    --link-hover-color: #ffc107;
}

/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

header {
    text-align: center;
    padding: 20px 0;
    background-color: var(--header-bg-color);
    color: white;
}

header h1 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

header a:hover {
    color: var(--link-hover-color);
}

/* Module Selection Card */
.module-select-container {
    max-width: 400px;
    background-color: #ffffff; /* White background for module selection */
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    margin: 0 auto;
}

/* Learning Objectives Container */
.learning-objectives-container {
    max-width: 600px;
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: left;
}

/* Learning Objective Checkbox Styling */
.learning-objective {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    background-color: #f8f9fa; /* Light grey background for learning objective cards */
}

.learning-objective:hover {
    background-color: #e9ecef; /* Light hover effect */
    border-color: var(--accent-color); /* Accent border color on hover */
}

/* Learning Objectives Title and Buttons */
.learning-objectives-title {
    font-weight: bold;
    margin: 0;
}

.learning-objectives-controls {
    display: flex;
    gap: 10px;
}

.learning-objectives-controls button {
    margin-left: 5px;
}

/* Selected Learning Objective Styling */
.learning-objective.selected {
    background-color: #cce5ff; /* Light blue to indicate selected */
    border-color: var(--primary-color);
}

/* Flashcard Section */
#flashcard {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    background-color: white;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 20px;
}

#question-body {
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* Option Wrapper Styles */
.option-wrapper {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.option-wrapper:hover {
    background-color: #f1f1f1;
}

/* Checkbox and Label Styling */
.form-check .form-check-input {
    margin-left: 0.8em;
    margin-right: 0.8em;
    cursor: pointer;
}

.learning-objective-checkbox {
    margin-left: 0.8em;
    margin-right: 0.8em;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer; /* Ensures that clicking on the label checks/unchecks the checkbox */
    flex-grow: 1; /* Takes up the remaining space for better spacing */
}

/* Selected Option */
.selected-option {
    background-color: #cce5ff; /* Light blue for selected options */
    border-color: #007bff;
}

/* Feedback Styles */
.correct-option {
    border: 2px solid #28a745; /* Green border to indicate correctness */
    background-color: #e6ffe6; /* Light green background for correct answers */
}

.incorrect-option {
    border: 2px solid #dc3545; /* Red border for incorrect answers */
    background-color: #ffe6e6; /* Light red background for incorrect answers */
    color: #721c24; /* Dark red text color for incorrect answers */
}

.missed-correct-option {
    background-color: #e6ffe6; /* Light green background to indicate missed correct answers */
    border: 1px dashed #28a745; /* Dashed border for correct answers that were not selected */
}

/* Icon Styling for Feedback */
.option-icon {
    position: absolute;
    right: 15px;
    font-size: 1.2em;
}

/* Button Styles */
button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#submit-answer {
    background-color: #007bff;
    color: white;
}

#submit-answer:hover:not(:disabled) {
    background-color: #0056b3;
}

#next-question {
    background-color: #6c757d;
    color: white;
}

#next-question:hover:not(.d-none) {
    background-color: #5a6268;
}

/* Hiding Elements */
.d-none {
    display: none;
}

#start-quiz {
    background-color: var(--success-color);
    color: white;
    font-size: 1.1em;
    padding: 10px 20px;
}

#start-quiz:hover:not(:disabled) {
    background-color: #218838;
}

#select-all, #deselect-all {
    font-size: 0.9em;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    background-color: #ffffff;
    color: var(--secondary-color);
}

#select-all:hover, #deselect-all:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Footer Styles */
.flashlearn-footer {
    background-color: var(--footer-bg-color);
    padding: 40px 20px;
    color: var(--text-color);
    border-top: 1px solid #ddd;
    font-size: 14px;
}

.footer-brand h3 {
    font-family: 'Arial', sans-serif;
    color: var(--accent-color);
    font-weight: bold;
}

.footer-brand p {
    color: #666;
}

.footer-links h5,
.footer-contact h5 {
    font-weight: bold;
    margin-bottom: 15px;
}

.footer-links ul {
    padding: 0;
    list-style-type: none;
}

.footer-links ul li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: var(--footer-link-hover);
}

.footer-contact p a {
    color: var(--footer-link-hover);
    text-decoration: none;
}

.footer-contact p a:hover {
    text-decoration: underline;
}

.social-icons a {
    color: #333;
    font-size: 20px;
    margin-right: 10px;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--footer-link-hover);
}

.footer-copyright {
    margin-top: 20px;
    color: #999;
}

/* Mobile-Friendly Adjustments */
@media (max-width: 768px) {
    #flashcard {
        width: 95%;
    }

    .option-wrapper {
        padding: 8px;
        margin-bottom: 8px;
    }

    button {
        width: 100%;
        margin-top: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .module-select-container,
    .learning-objectives-container {
        width: 90%;
        margin: 0 auto;
    }

    .learning-objectives-controls {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
}
