/* Container for the entire tree */
#challenge-tree-container  /* Container for the entire tree */
 {
    /* position: absolute; */
    display: flex;
    flex-direction: column; /* Stack levels vertically */
    align-items: center; /* Center align levels and challenges */
    /* padding: 10px; */
    width: 100%;
    margin-top: 0px;
    padding-bottom: 250px;
    overflow-y: auto; /* 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 */
}

/* Challenge item container */
.challenge-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;

    /* border-bottom: 3px solid green; */
}

.current-challenge {
    scale: 1.0;
    border: 2px solid greenyellow;
}

.current-challenge img {
    scale: 1.0;
    border: 2px solid greenyellow;
    animation: slow-pulse 5s 0s infinite ease-in-out alternate-reverse;
}

@keyframes slow-pulse {
    0% {
        transform: scale(100%);
    }

    50% {
        transform: scale(103%)
    }

    100% {
        transform: scale(100%);

    }
}

/* Image within the challenge item */
.challenge-item img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block;
}

/* Overlay for completed challenges */
.challenge-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 128, 0, 0.8);  */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Overlay for completed challenges */
.challenge-overlay.completed {
    background-color: rgba(191, 194, 188, 0.8);
}

/* Overlay for current challenges */
.challenge-overlay.current {
    background-color: rgba(0, 0, 0, 0.0); 
}

/* Overlay for locked challenges */
.challenge-overlay.locked {
    background-color: rgba(0, 0, 0, 0.7); 
}

/* Challenge icon, name, and button container */
.challenge-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 */
    /* padding: 5px; */
    border-radius: 5px;
}

/* Icon styles */
.challenge-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;
}

/* Challenge name styles */
.challenge-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 */
.challenge-button {
    min-width: 60%;
    background-color: rgba(0, 128, 0, 0.8);
    /* background-color: rgba(0, 0, 0, 0.819); */
    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;
}

.challenge-button:hover {
    background-color: rgba(0, 128, 0, 1);
}

/* Hover effect */
.challenge-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.current-challenge-button{
    animation: pulse 5s 0s infinite ease-in-out alternate-reverse;
}

@keyframes pulse {
    0% {
        transform: scale(100%);
    }

    50% {
        transform: scale(103%)
    }

    100% {
        transform: scale(100%);

    }
}

/* Responsive settings */
@media (min-width: 600px) {
    #challenge-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;
    }

    .challenge-item {
        width: calc(50% - 20px); /* Two items per row on medium screens */
    }
}

@media (min-width: 900px) {
    .challenge-item {
        width: calc(33.33% - 20px); /* Three items per row on large screens */
    }
}

