#categoriseQuestion{
    margin: 0;
    font-size: 1.1em;
    font-family: 'Montserrat', sans-serif;
    padding-bottom: 20px;
    user-select: none;
}

#categoriseAnswers{
    list-style-type: none;
    display: flow-root;
    padding-left: 0;
    padding-bottom: 20px;
}

.categoriseAnswer{
    font-size: 0.85rem;
    font-weight: 500;
    max-height: 30rem;
    width: fit-content;
    padding: 0.35rem;
    border: 1px solid #BBB;
    margin: 0.25rem 0.25rem 0.25rem 0.25rem;
    background-color: #E6E6E6;
    border-radius: 5px;
    cursor: move;
    float: left;
    text-align: left;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.categoriseAnswer:hover{
    background-color: #d5d5d5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.categoriseAnswerImage{
    max-height: 25rem !important;
}

.categoriseAnswer.clickedOnSelectedAnswer{
    background-color: #ffe500; /* Yellow color for the background */
    outline: 2px solid #ffa500; /* Orange outline */
}

/* Grey out already categorised answers */
.greyedOutCategorisedAnswer{
    opacity: 0.5;
    pointer-events: none;
}

.categoriseAnswerCorrect{
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    max-height: 30rem;
    max-width: 20rem;
    width: auto;
    padding: 0.35rem;
    background-color: #b7f38c;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid;
    border-radius: 5px;
    margin: 0.25rem 0.25rem 0.25rem 0.25rem;
    float: left;
    text-align: left;
}

#selectedAnswerStickyTopContainer{
	display: none;
    position: sticky;
    top: 42px;
    left: 0;
    width: 100%;
    z-index: 50;
}

#selectedAnswerStickyTopContainer .categoriseAnswer{
	position: relative;
}

#selectedAnswerStickyBottomContainer{
    display: none;
    position: sticky;
    bottom: 0; /* Stick at the bottom */
    left: 0;
    width: 100%;
    z-index: 50;
}

#selectedAnswerStickyBottomContainer .categoriseAnswer{
    position: relative;
}

/* Answer list and category container styles */
#categoriseCategories{
    list-style-type: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.categoriseCategory{
    min-height: 80px;
    overflow: auto;
    width: 17rem;
    max-width: 80%;
    margin: 0.25rem 0.25rem 0.25rem 0.25rem;
    color: black;
    padding: 0.25rem 0.25rem 0.5rem 0.25rem;
    text-align: center;
    line-height: normal;
    height: auto;
    float: left;
    border-radius: 0.5rem;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #297373;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.categoriseCategory.cursorPointerForCategories{
    cursor: pointer;
	background-color: #2a8373;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.categoriseCategory.cursorPointerForCategories .categoriseAnswerCorrect{
    cursor: pointer !important;
}

.categoriseCategory .categoryText{
    font-weight: 100;
    color: yellow;
    margin: 5px 5px 5px 5px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    user-select: none;
}

.categoriseCategory .categoriseAnswer{
    max-width: 100%;
}

/* Glow effect when answer is placed into category */
@keyframes subtleGlow{
    0%{
        box-shadow: 0px 0px 5px 0px rgba(255, 100, 0, 0.8),
            0px 0px 10px 0px rgba(255, 215, 0, 0.6);
        outline: 1px solid rgb(255, 215, 0);
    }
    50%{
        box-shadow: 0px 0px 10px 0px rgba(255, 100, 0, 0.8),
            0px 0px 20px 0px rgba(255, 215, 0);
        outline: 1px solid rgb(255, 215, 0);
    }
    100%{
        box-shadow: 0px 0px 5px 0px rgba(255, 100, 0, 0.8),
            0px 0px 10px 0px rgba(255, 215, 0, 0.6);
        outline: 1px solid rgb(255, 215, 0);
    }
}
/* Move into category effect */
@keyframes moveIntoCategory{
    0%{
        transform: scale(0.9);
        opacity: 0;
    }
    100%{
        transform: scale(1);
        opacity: 1;
    }
}
/* Apply both animations in sequence */
.categoriseAnswer.movedIntoCategory{
    animation: moveIntoCategory 0.4s ease forwards, subtleGlow 0.5s ease-in-out;
}

.highlightCategoryAsDropTarget{
	background-color: #ffe500; /* Yellow color for the background */
	outline: 2px solid #ffa500; /* Orange color for the outline, instead of border so that it doesn't affect the width of the element */
}

.highlightCategoryAsDropTarget .categoryText{
	color: #000;
}

.categoriseAnswerIncorrect {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    max-height: 30rem;
    max-width: 20rem;
    width: auto;
    padding: 0.35rem;
    background-color: #f38c8c;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid;
    border-radius: 5px;
    margin: 0.25rem 0.25rem 0.25rem 0.25rem;
    float: left;
    text-align: left;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px){
    .categoriseCategory{
        width: 100%;
        margin: 0.5rem 0;
    }
    #categoriseAnswers{
        width: 80%;
    }
	#selectedAnswerStickyBottomContainer{
		width: 80%;
	}
	#selectedAnswerStickyTopContainer{
		width: 80%;
	}
}

@media only screen and (max-width: 480px){
    .categoriseCategory, .categoriseAnswer{
        font-size: 0.75rem;
    }

    .categoryText{
        font-size: 0.9rem;
    }
}

/* Improve dragging performance for categorise */
.ui-draggable-helper {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Smooth scrolling optimizations during drag */
body.dragging-active {
    overflow-x: hidden; /* Prevent horizontal scroll during drag */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

body.dragging-active * {
    pointer-events: none; /* Prevent interference during drag */
}

body.dragging-active .ui-draggable-helper,
body.dragging-active .ui-droppable {
    pointer-events: auto; /* Re-enable for drag elements */
}

/* Optimize animations during drag */
.categoriseAnswer {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* Reduce repaints during scroll */
#activityCanvas {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Smooth momentum scrolling on iOS */
body {
    -webkit-overflow-scrolling: touch;
}