/* Challenge Container */
#challenge-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) {
    #challenge-container {
        padding-bottom: 60px;
    }
}

#challengeHeader {
    background-image: linear-gradient(to right,rgba(155,259,255,.6), rgba(155,259,255,.3));
    background-color: rgb(85, 142, 161);
    width: 95%;
    border-radius: 15px 15px;
    padding: 3%;
    margin-top: 10px;
}

#challengeName {
    font-family: "Nerko One", sans-serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: white;
}

#challengeIcon {
    /* position: absolute; */
    display: none;
    top: 0;
    font-size: 25px;
    border-radius: 50%;
    background-size:cover;
    border: 15px solid white;
    padding: 10%;
    margin-bottom: -40px;
    background-color: #000000;
    color: white;
    z-index: 5;
}

#challengeImage {
    width: 20%;
    border-radius: 50%;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    #challengeName {
        font-size: 2.2rem;
    }
}

/* To keep the button container sticky */
.tab-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    /* width: 100%;  */
    top: 0;
    z-index: 4;
    /* Ensures it stays above other content */
    background-color: #f8f8f8;
    /* Match the header background */
    padding: 10px;
    padding-top: 50px;
    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 */
}

/* General button styling */
.tab-button {
    /* background: #2D2C3E; */
    border: none;
    margin: 0 30px;
    /* Space between buttons */
    padding: 10px 5px;
    /* Icon size */
    cursor: pointer;
    color: snow;
    /* color:white; */
    /* Default icon color */
    transition: color 0.3s ease, border-bottom 0.3s ease;
    /* Smooth transitions */
    position: relative;
    /* For underline */
    border-radius: 20%;
}

.tab-button:hover {
    background-color: lightblue;
}

.tab-button:nth-child(1) {
    border: 1px solid white;
}

.tab-button:nth-child(2) {
    border: 1px solid white;
}

.tab-button:nth-child(3) {
    border: 1px solid white;
}

.tab-button:nth-child(4) {
    border: 1px solid white;
}

.tab-button:nth-child(5) {
    border: 1px solid white;
    width: 48px;
}

.tab-button:nth-child(6) {
    border: 1px solid white;
}

.tab-button:nth-child(7) {
    border: 1px solid white;
}

/* Styling for active tab */
.tab-button.active {
    color: rgb(54, 119, 140);
    /* Active color */
    border: 2px solid rgb(136, 193, 212);
    /* background-color: #28a74631; */
    /* Underline for active tab */
}

/* Hover effect for buttons */
.tab-button:hover {
    color: #333;
    /* Darker color on hover */
}

/* Align icons centrally within buttons */
.tab-button i {
    display: block;
    margin: auto;
}

/* Add custom styles to icons if needed */
.tab-button i {
    font-size: 2.5rem;
    /* Adjust icon size */
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    .tab-button i {
        font-size: 1.7rem;
        /* Adjust icon size */
    }

    .tab-button {
        margin: 0 4px;
    }
}



/* Tab Content */
#tabContent, #challenge-story-container {
    height: calc(100% - 50px);
    width: 100%;
    /* Adjust for tab header height */
    padding-top: 0;
    padding-inline: 30px;
    overflow-y: scroll;
    display: none;
    align-items: flex-start;
    background-color: rgba(250, 249, 249, 0.194);
    border-radius: 35px;
    margin-top: 0px;
}

/* Tab Content */
.tab-content {
    /* padding: 30px; */
    overflow-y: scroll;
    display: none;
    align-content: center;
}

.tab-content.active {
    display: block;
}

/* Container to center text or adjust display as needed */
.story-container, #tabContent, #challenge-story-container {
    /* border: 2px solid red; */
    /* width: 85%; */
    /* Ensure the container takes up the full width */
    text-align: left;
    /* Align text to the left */
    padding: 0px 5px;
    /* Add some padding for aesthetics */
    margin-bottom: 20px;
    /* Add space between story elements */
    overflow-wrap: break-word;
    /* Ensures long words are broken properly */
    word-wrap: break-word;
    /* Compatibility with older browsers */
}

#tabContent {
    /* overflow-y: hidden; */
    border-bottom: 1px solid white;
}

#challenge-story-container {
    flex-direction: column;
    min-height: 60vh;
    overflow-y: hidden;
}


/* Styling for the text with the typewriter effect */

#typedOutContainer {
    min-height: 20vh;
    padding-inline: 10px;
    padding-top: 10px;
}

.typed-out {
    font-size: 1.1rem;
    /* Adjust font size */
    line-height: 1.5;
    /* Adjust line height for better readability */
    /* color: #333; */
    /* Text color */
    display: inline-block;
    /* Allows width manipulation for typing effect */
    overflow-wrap: break-word;
    /* Ensures long words are broken properly */
    word-wrap: break-word;
    /* Compatibility with older browsers */
    white-space: normal;
    /* Allows normal wrapping of text */
    /* font-family: "Nerko One", cursive; */
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

/* Add media queries for different screen sizes */
@media (max-width: 600px) {

    /* For small screens like phones */
    .typed-out {
        font-size: calc(0.6em + 1.5vw);
        /* Adjust font size using viewport width */
    }
}

@media (min-width: 601px) and (max-width: 1024px) {

    /* For medium screens like tablets */
    .typed-out {
        font-size: calc(0.8em + 1vw);
    }
}

@media (min-width: 1025px) {

    /* For large screens like desktops */
    .typed-out {
        font-size: calc(1em + 0.5vw);
    }
}

.challenge-story-image {
    /* position: absolute; */
    max-width: calc(min(80vw, 500px));
    height: auto;
    /* margin-top: 50px; */
    /* left: 25%; */
    display: block;
    margin-left: auto;
    margin-right: auto;
    opacity: 100%;
    filter: grayscale(70%);
    border-radius: 50%;
    transition: opacity 5s ease-in-out;
    transition: transform 5s ease-in-out;
}

#completeChallengeContainer {
    /* height: 50px; */
    width: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#completeChallengeButton, #cancelChallengeButton {
    min-width: 140px;
    background-color: transparent;
    color: black;
    border: 1px solid black;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* Adjust padding for mobile screens */
@media screen and (max-width: 767px) {
    #completeChallengeContainer {
        padding-bottom: 30px;
        /* Add bottom padding for mobile screens */
    }
}

#completeChallengeButton:hover, #cancelChallengeButton:hover {
    background-color: black;
    color: white;
}

#completeChallengeButton:disabled, #cancelChallengeButton:disabled {
    opacity: 20%;
    cursor: not-allowed;
}

.background-story-text {
    /* margin-bottom: 10px; */
    padding-block: 2%;
    /* padding-inline: 7%; */
}

.input-item {
    margin-bottom: 10px;
    display: list-item;
    list-style-type: square;
    list-style-position: outside;
}

/* AI Interactions */

#interaction-history {
    max-height: 500px;
    /* Adjust based on your layout */
    overflow-y: auto;
    /* padding: 10px; */
}

.player-message {
    background-color: rgba(85, 142, 161, 0.029);
    padding: 8px;
    border-radius: 15px;
    margin-bottom: 10px;
}

.ai-message {
    background-color: rgba(85, 142, 161, 0.155);
    padding: 8px;
    border-radius: 15px;
    margin-bottom: 10px;
}

.interaction-input-container {
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    padding-top: 5px;
    font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    /* padding: 5px; */
}

#interactionContent{
    width:100%;
}

textarea#interaction-input {
    width: 90%;
    border-radius: 5px;
    resize: none;
    /* Disable manual resizing */
    overflow: hidden;
    /* Hide scrollbars until needed */
    font-family:'Poppins', Tahoma, Geneva, Verdana, sans-serif;
}

#interaction-send-button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 5px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 26px;
    width:50px;
}

#interaction-send-button:hover {
    background-color: #45a049;
}

#solutionContent {
    display: none;
    width:100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Label for each answer */
.solution-answer-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    margin-top: 30px;
    margin-left: 10px;
    align-self: flex-start;
    /* Space between label and input */
}

.solution-answer-container label {
    /* Fixed width for labels to align with inputs */
    /* font-weight: bold; */
    /* Make labels bold */
    /* margin-right: 10px; */
    margin-left: 2px;
    text-align: left;
    /* Space between label and input */
    flex: 1;
    min-width: 30%;
}

/* Input fields for answers */
.solution-answer, textarea#interaction-input {
    width: 100px;
    min-width: 100px;
    flex: 1;
    /* Allow input fields to grow */
    padding: 5px;
    /* Padding inside input fields */
    margin-right: 10px;
    /* Space between input fields */
    font-size: 16px;
    /* Font size for readability */ 
}

textarea#interaction-input{
    line-height: 2;
}

/* Unit dropdown or input */
.solution-unit {
    flex: 1;
    width: 100px;
    /* Allow unit input fields to grow */
    padding: 5px;
    /* Padding inside input fields */
    margin-right: 10px;
    /* Space between unit and next element */
    font-size: 16px;
    /* Font size for readability */
}

/* Style for the question */
.solution-question {
    font-size: 17px;
    /* Slightly larger font for the question */
    /* font-weight: bold; */
    /* Bold the question text */
    margin-bottom: 15px;
    /* Space below the question */
}

#submitSolutionButton {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: transparent;
    color: black;
    border: 2px solid black;
    border-radius: 15px;
    cursor: pointer;
}

#submitSolutionButton:disabled {
    opacity: 20%;
}

#submitSolutionButton:hover {
    background-color: black;
    color: white;
}

#solution-message {
    margin-top: 40px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.solution-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.solution-name {
    flex: 1;
    font-weight: bold;
    margin-right: 10px;
}

.solution-value, .solution-unit {
    flex: 2;
    padding: 5px;
    margin-right: 10px;
}

.hint-item, .sidebar-item {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.hint-item strong, .sidebar-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.hint-item p, .sidebar-item p {
    margin: 0;
    color: #555;
}

/* Style for images in hints and sidebars */
.hint-image, .sidebar-image {
    width: 100%;
    /* Make the image take full width of its parent */
    padding: 10px 0;
    /* Add padding to create space around images */
    display: block;
    /* Block display to keep the image on a new line */
    border-radius: 5px;
    /* Rounded corners for images */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Add a subtle shadow for depth */
}

/* Sticky button style */
.show-hint-button, .show-sidebar-button {
    /* position: sticky; */
    /* top: 0; */
    
    z-index: 10;
    cursor: pointer;
    margin-bottom: 10px;
    align-self: center;
}

/* Content container style */
#hintsContent, #sidebarContent {
    /* overflow-y: hidden; */
    /* Enable vertical scrolling */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width:100%
}

#hintsContainer, #sidebarsContainer {
    /* max-height: 80vh; */
    border-inline: 3px solid green;
    margin-top: 20px;
    overflow-y: scroll;
}

.tab-content {
    max-height: 600px;
    /* Set a reasonable height for scrolling */
    overflow-y: auto;
    /* Enable vertical scrolling */
    padding-top: 10px;
    /* Ensure content appears below sticky button */
}

/* Style for the emanating elements */
.emanate-element {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: gold;
    /* Example color */
    border-radius: 50%;
    /* Makes the element circular */
    opacity: 1;
    animation: emanate 1s ease-out forwards;
    /* Animation properties */
}

/* Keyframes for emanation effect */
@keyframes emanate {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(3) translateY(-100px);
        /* Emanate upwards */
        opacity: 0;
    }
}