/* Global Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.dark-mode {
    background-color: #333;
    color: #f2f2f2;
}

/* Quiz Container */
.quiz-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Quiz Card Styles */
.quiz-card {
    position: relative;
    margin-top:50px;
    background-color: #e2e1e1;
    border: 1px solid #dddddd;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.quiz-card.dark-mode {
    background-color: #444;
    border-color: #666;
}

.quiz-card.completed {
    border-color: #66cc66;
}

.quiz-card.next {
    animation: slide-in 0.5s ease-in-out;
}

@keyframes slide-in {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Option Buttons */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    background-color: #f9f9f9;
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 10px;
    text-align: left;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    font-size: 16px;
}
.option,
.submit-btn {
    width: 100%; /* Ensure the button and options fill their container */
}
.option.selected {
    background-color: #cce5ff;
    border-color: #80bfff;
}

.option.crossed-off {
    background-color: #f2dede;
    border-color: #e0b4b4;
    text-decoration: line-through;
}

.option.dark-mode {
    background-color: #555;
    border-color: #777;
}

/* Submit Button */
.submit-btn {

    margin-top: 10px;
    background-color: #66cc66;
    border: none;
    border-radius: 4px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #55aa55;
}

.submit-btn.dark-mode {
    background-color: #77dd77;
}

/* Results Styles */
.results {
    margin-top: 30px;
}

.results table {
    width: 100%;
    border-collapse: collapse;
}

.results th, .results td {
    border: 1px solid #dddddd;
    padding: 8px;
    text-align: left;
}

.results th {
    background-color: #f9f9f9;
}

.results td.problem-col button {
    background-color: #f9f9f9;
    border: 2px solid #050505;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.results td.problem-col button:hover {
    background-color: #e0e0e0;
}

/* Control Buttons */
.control-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.end-training-btn {
    position: absolute;
    top: 30px;
    right: -15px;
    padding: 10px 20px;
    background-color: #f00;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
}

.end-training-btn:hover {
    background-color: #c00;
}
.control-buttons button {
    background-color: #008cba;
    border: none;
    border-radius: 4px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.control-buttons button.active {
    background-color: #005f6b;
}

.control-buttons button:hover {
    background-color: #007ba7;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    margin-top: 20px;
    text-align: center;
}

.dark-mode-toggle label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Confetti Styles */
.quiz-completed {
    text-align: center;
}

.start-again-btn {
    margin-top: 20px;
    background-color: #66cc66;
    border: none;
    border-radius: 4px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.start-again-btn:hover {
    background-color: #55aa55;
}

.start-again-btn.dark-mode {
    background-color: #77dd77;
}

/* Highlighted Text */
.highlighted {
    background-color: yellow;
}

/* Cookie Popup */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    text-align: center;
    z-index: 1000;
}
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1225px;
    height: 600px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10; /* Ensure the popup has a higher z-index */
    border: 5px solid black;
}
.popup.show {
    display: flex;
}

/* Content inside the popup */
.popup-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 60px);
    box-sizing: border-box;
    position: relative;
}

/* Hide scrollbars for various browsers */
.popup-content::-webkit-scrollbar {
    display: none;
}

.popup-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.popup h2 {
    margin-top: 0;
}
.close-btn {
    height: 40px;
    width: 40px;
    position: absolute;
    top: -12px;
    right: 10px;
    background: none;
    border: none;
    font-size: 40px;
    cursor: pointer;
}


/* Styles for correct and incorrect options */
.option.correct {
    background-color: #4CAF50;
    color: white;
}

.option.incorrect {
    background-color: #F44336;
    color: white;
}
.cookie-popup button {
    background-color: #66cc66;
    border: none;
    border-radius: 4px;
    padding: 10px;
    color: white;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.cookie-popup button:hover {
    background-color: #55aa55;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    /* Set the elements to 90% of the screen's width */
    .quiz-card,
    .quiz-card.completed,
    .popup {
        width: 90%;
        max-width: 400px; /* Ensure it doesn't exceed 400px */
        margin: 10px auto; /* Center the elements horizontally */
        padding: 15px;
    }
    
    /* Adjust the positioning and padding as needed */
    .quiz-card {
        top: 70px;
        left: auto; /* Remove left offset */
    }
    .quiz-card h2 {
        font-size: 21px; /* Adjust this value to make the font smaller on mobile devices */
    }
    .popup {
        top: 400px;
        height: 100%;
        border: 3px solid black;
    }

    .option {
        padding: 8px;
        font-size: 16px;
    }

    .results {
        width: 90%; /* Set to 90% of screen width */
        max-width: 450px;
        margin: 10px auto; /* Center the results table horizontally */
        left: auto; /* Remove left offset */
    }

    .submit-btn, .highlight-toggle-btn, .start-again-btn {
        padding: 8px;
    }

    .results th, .results td {
        padding: 6px;
    }
}
