/* Container for the entire tree */
#exercise-tree-container {
    /* position: absolute; */
    display: flex;
    flex-direction: column;
    /* Stack levels vertically */
    align-items: center;
    /* Center align levels and exercises */
    width: 100%;
    margin-top: 0px;
    padding-bottom: 250px;
    overflow-y: scroll;
    /* Vertical scroll */
    max-height: 100vh;
    /* Make container vertically scrollable */
    box-sizing: border-box;
}

/* Level header styles */
.level-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
    width: 100%;
    /* Full width to separate levels */
}

/* Exercise item container */
.exercise-item {
    position: relative;
    /* Set position relative to allow absolute positioning of children */
    display: inline-block;
    /* Align items next to each other based on available width */
    margin: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Smooth hover effect */
    width: calc(100% - 0px);
    /* Responsive width */
    max-width: 370px;
    /* Maximum width to limit growth */
    height: auto;
    /* Auto height to maintain aspect ratio */
    min-height: 250px;
    filter: grayscale(.2);
    padding: 0;
}

.current-exercise  {
    scale: 1.0;
    border: 2px solid greenyellow;
}

.current-exercise img {
    /* share challenge.css animations */
    animation: slow-pulse 7s 1s infinite ease-in-out alternate-reverse;
}

/* Image within the exercise item */
.exercise-item img {
    width: 100%;
    height: auto;
    /* Maintain aspect ratio */
    display: block;
}

/* Overlay for completed exercises */
.exercise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Overlay for completed exercises */
.exercise-overlay.completed {
    background-color: rgba(191, 194, 188, 0.8);
}

/* Overlay for current exercises */
.exercise-overlay.current {
    background-color: rgba(0, 0, 0, 0.0);
}

/* Overlay for locked exercises */
.exercise-overlay.locked {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Exercise icon, name, and button container */
.exercise-details {
    position: absolute;
    top: 50%;
    /* Center vertically */
    left: 50%;
    /* Center horizontally */
    transform: translate(-50%, -50%);
    /* Adjust position to truly center */
    width: 100%;
    /* Make sure the content doesn't overflow */
    height: 100%;
    text-align: center;
    /* Center text and elements horizontally */
    border-radius: 5px;
}

/* Icon styles */
.exercise-icon {
    font-size: 2rem;
    margin-bottom: 100px;
    color: white;
    display: block;
    /* Block to center under the previous element */
}

/* Button styles */
.locked-icon {
    display: block;
    font-size: 2rem;
    color: red;
}

/* Button styles */
.unlocked-icon {
    display: block;
    font-size: 2rem;
    color: green;
}

/* Exercise name styles */
.exercise-name {
    display: flex;
    align-items: center;
    /* Vertically centers the content */
    justify-content: center;
    /* Horizontally centers the content */
    color: white;
    min-width: 100%;
    min-height: 40px;
    font-size: 1rem;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    /* Background behind the text */
    padding: 5px 0;
    /* Padding around the text */
}

/* Button styles */
.exercise-button {
    min-width: 60%;
    background-color: rgba(0, 128, 0, 0.8);
    color: #ffffff;
    font-size: large;
    text-transform: capitalize;
    border: 1px solid white;
    padding: 8px 16px;
    margin-top: 40px;
    margin-bottom: 40px;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.exercise-button:hover {
    background-color: rgba(0, 128, 0, 1);
}

/* Hover effect */
.exercise-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.current-exercise-button {
    /* share challenge.css animations */
    animation: pulse 5s 0s infinite ease-in-out alternate-reverse;
}

/* Responsive settings */
@media (min-width: 600px) {
    #exercise-tree-container {
        flex-direction: row;
        /* Flex direction changes for wider screens */
        flex-wrap: wrap;
        /* Allow items to wrap to the next line */
        justify-content: center;
    }

    .exercise-item {
        width: calc(50% - 20px);
        /* Two items per row on medium screens */
    }
}

@media (min-width: 900px) {
    .exercise-item {
        width: calc(33.33% - 20px);
        /* Three items per row on large screens */
    }
}