/* exercise.css */

/* General styling for all exercises */
#exercise-container {
    position: absolute;
    display: none;
    /* background-image: linear-gradient(rgba(247,247,255,.6), rgba(247,259,255,1)); */
    background-color: white;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding-inline: 3%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 15px;
    overflow:hidden;
    margin-top: 5px;
    font-family: Poppins, Verdana, Geneva, Tahoma, sans-serif;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    #exercise-container {
        padding-bottom: 60px;
    }
}

#exercise-intro, #actual-exercise{
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap:20px;
    padding:2%;
    text-align: center;
    width: 90%;
    max-width: 300px;
}

#exerciseHeader {
    background-image: linear-gradient(to right,rgba(155,259,255,.6), rgba(155,259,255,.3));
    background-color: rgb(85, 142, 161);
    width: 90%;
    border-radius: 15px 15px;
    padding-block: 1rem;
}

#intro-exercise-name {
    font-family: "Nerko One", sans-serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
    /* background-color: #000000c2; */
    color: white;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    #intro-exercise-name {
        font-size: 1.7rem;
    }
}

#exerciseIcon {
    display: none;
    font-size: 25px;
    border-radius: 50%;
    background-size:cover;
    border: 15px solid white;
    padding: 10%;
    margin-top: -20px;
    margin-bottom: -80px;
    z-index: 5;
}


#exercise-name {
    color: rgba(250, 128, 114, 0.75);
    margin-bottom: 20px;
    text-align: center;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    #exercise-name {
        font-size: 1.7rem;
    }
}

#intro-exercise-description{
    color:black;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    /* width: 100%;  */
    top: 0;
    z-index: 4;
    /* Ensures it stays above other content */
    /* Match the header background */
    padding: 10px;
    padding-top: 35px;
    margin-top: 30px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for depth */
    background-image: linear-gradient(to right,rgba(155,259,255,1), rgba(155,259,255,.5));
    background-color: rgb(61, 94, 105);
    border-radius: 25px;
    width: 100%;
    /* border-block: 2px solid black */
}

#completeExerciseContainer {
    /* height: 50px; */
    width: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: -10px;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    #completeExerciseContainer {
        padding-bottom: 30px;
        /* Add bottom padding for mobile screens */
    }
}

#completeExerciseButton {
    margin-top: 50px;
    min-width: 140px;
    background-color: transparent;
    color: black;
    border: 1px solid black;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#completeExerciseButton:hover {
    background-color: black;
    color: white;
}

#completeExerciseButton:disabled {
    opacity: 20%;
    cursor: not-allowed;
}

/* General Popup Styles */
.completion-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 300px;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Fade-in animation */
.completion-popup.fade-in {
    opacity: 1;
}

.completion-popup h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.completion-popup p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.continue-button {
    padding: 10px 20px;
    font-size: 1.1em;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.continue-button:hover {
    background-color: #218838;
}

.correct-click {
    background-color: green;
    animation: burstBubble 0.5s forwards;
}

@keyframes burstBubble {
    0% {
        transform: scale(1);
        opacity: 1;
        background-color: #FFD700;
        /* Gold color for a rewarding feel */
    }

    50% {
        transform: scale(1.2);
        opacity: 0.9;
    }

    100% {
        transform: scale(50%);
        opacity: 0;
    }
}

.wrong-click {
    background-color: red;
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translate(2px, 2px);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(-2px, -2px);
    }

    75% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(2px, 2px);
    }
}

/* AorB Exercise Styles */
.exercise-status-container {
    display: flex;
    justify-content: center;
    gap:5%;
    margin-bottom: 10px;
    width: 100%;
}

.timer, .points, .moves {
    display: inline-block;
    font-size: 1.7em;
    font-weight: bold;
    min-width: 35%;
}

.buttons-container {
    display: flex;
    justify-content: space-around;
    gap: 0px;
    margin-top: 20px;
    width: 100%;
}

.buttons-container.multiple-choice {
    display: flex;
    flex-direction: column;
    gap:10px;
    align-items: center;
    /* margin-top: 20px; */
    width: 100%;
}

.button-row {
    display: flex;
    justify-content: space-around;
    gap:30px;
    width: 100%;
    margin: 10px 0;
}

.choice-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    /* height: 60px; */
    font-size: 2.2em;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    transition: background-color 0.3s ease;
    background-color: #f8f9fa;
    color: black;
}

.choice-button:hover {
    background-color: #f8f9fa;
    color: black;
}

/* Styles for fractions in buttons */
.choice-button .fraction {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.choice-button .numerator,
.choice-button .denominator {
    font-size: 1.2em;
}

.choice-button .fraction-line {
    width: 100%;
    height: 1px;
    background-color: black;
    margin: 2px 0;
}

.choice-button.correct-click {
    background-color: #28a745;
    color: white;
}

.choice-button.wrong-click {
    background-color: #dc3545;
    color: white;
}

.correct-flash {
    animation: correctFlash 0.5s;
}

.wrong-flash {
    animation: wrongFlash 0.5s;
}

@keyframes correctFlash {
    0% {
        color: transparent;
    }

    50% {
        color: #28a745;
        scale:120%;
    }
}

@keyframes wrongFlash {
    0% {
        color: transparent;
    }

    50% {
        color: #dc3545;
        scale:120%;
    }

}

#prompt {
    font-size: 1.2rem;
}

.prompt-highlighted {
    color:rgba(250, 128, 114, 0.75);
    font-size: 3.2rem;
}


/* Responsive Design */
@media (max-width: 600px) {
    .virtual-grid-box {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }

    .choice-button {
        width: 100px;
        /* height: 50px; */
        font-size: 1.7em;
    }

    .exercise-status-container {
        /* flex-direction: column; */
        align-items: center;
    }

    .timer, .points, .moves {
        margin: 5px 0;
    }
}

/* Accessibility: Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Level Introduction Exercise Styles */

.level-intro-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.info-container {
    padding: 20px;
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 30vh;
    overflow-y: scroll;
}

.info-text {
    font-size: 1em;
    margin-bottom: 20px;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    .info-text {
        font-size: 0.95em;
    }
}

.info-image {
    max-width: calc(min(100%,250px));
    height: auto;
    margin-bottom: 20px;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    /* transform: translateY(-10%); */
    font-size: 2em;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.left-arrow {
    left: 0;
}

.right-arrow {
    right: 0;
}

.nav-arrow.disabled {
    color: #ccc;
    cursor: default;
}

.indicators-container {
    display: flex;
    justify-content: center;
    margin-block: 20px;
}

.indicator {
    width: 12px;
    height: 12px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 5px;
}

.indicator.active {
    background-color: #333;
}

