/* --- Thumbnail Carousel --- */
.thumbnail-carousel-container {
    position: fixed;
    top: 65%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2500;
    opacity: 0.8;
    visibility: visible;
    max-height: 500px;
    overflow: hidden;
    transition: opacity 0.55s ease-in-out, 
                max-height 0.55s ease-in-out, 
                margin-bottom 0.55s ease-in-out, 
                padding 0.55s ease-in-out;
    width: 100%;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.thumbnail-carousel-container.hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.thumbnail-carousel {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 1rem;
    padding: 0.5rem 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scrollbar-color: #8b8b8bab #f0f0f0;

    -webkit-mask-image: linear-gradient(to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) 5%, 
        rgba(0, 0, 0, 1) 95%,  
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) 5%,
        rgba(0, 0, 0, 1) 95%,
        rgba(0, 0, 0, 0) 100%
    );
}

@media screen and (min-width: 600px) {
    .thumbnail-carousel {
        align-items: center;
        justify-content: center;
    }
}

/* Hide scrollbar in Chrome/Safari/Opera */
.thumbnail-carousel::-webkit-scrollbar {
    display: none;
}

.thumbnail-item img {
    cursor: pointer;
    display: block;
    object-fit: cover;
    width: 150px;
    height: 100px;
    border-radius: 8px;
    border: 4px solid rgb(175, 175, 175, 0.15);
    box-shadow: 0 2px 4px rgba(115, 115, 115,  0.35);
}

/* --- Scene Overlay --- */
.container.overlay-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    pointer-events: auto;
}

.container.overlay-active::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 580px) {
    #scene-overlay {
        width: 95%;
        padding: 15px;
    }
}

/* --- Transition Overlay --- */
#bg-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #00000086;
    border-radius: inherit;
    z-index: 100;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    pointer-events: auto;
}

#bg-transition-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}