.carousel-container {
    position: relative;
    margin-bottom: 9.5vh;
    top: -10%;
}

.carousel-slide {
    display: flex;
    transition: transform 0.3s ease-in-out;
    justify-content: center; /* Center the images */
}

.carousel-slide img {
    flex-shrink: 0; /* Prevents images from shrinking */
    transition: transform 0.5s ease, opacity 0.5s ease;
    box-shadow: -16px 16px 32px rgba(0, 0, 0, 1);
    border-radius: 15px; /* Makes the image circular */
    transform: scale(0.8); /* Scaled down size */
    opacity: 0.3; /* Lower opacity for far images */
    cursor: pointer;
}

.image-container {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transform: scale(1);
    transition: 0.3s;
    transform: translateY(2%);
}

.image-container:hover {
    transition: 0.3s;
    transform: scale(1.05);
    transform: translateY(0%);
}

.image-container:active {
    transition: 0.2s ease-out;
    transform: scale(0.95);
}

.carousel-slide img.selected {
    opacity: 0.5;
    transform: scale(1);
}

/* Base styles for overlay text */
.overlay-text {
    position: absolute;
    bottom: 2vh; /* Position text at the bottom of the image */
    right: 1vw; /* Position text at the right of the image */
    font-size: calc(0.8vw + 0.8vh);
    font-weight: bold;
    font-style: italic;
    text-align: left;
    opacity: 0; /* Set opacity to visible */
    z-index: 10;
    transition: transform 0.4s; /* Include transform in the transition */
    text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
    transform: scale(0); /* Start scaled down to match image */
}

/* Base styles for overlay image */
.carousel-slide .carousel-image {
    width: 20vw;
    aspect-ratio: 16 / 9;
    margin-left: 2.2vw;
    object-fit: cover; 
    transition: transform 0.5s ease, opacity 0.5s ease;
    transform: scale(0.9);
    opacity: 0.3;
    cursor: pointer;
    border: 2px transparent;
    transition: 0.3s;
}

.carousel-slide .carousel-image.active {
    transform: scale(1);
    border: 2px solid #c0c0c0;
    transition: 0.3s;
}

.carousel-slide .image-container .overlay-image {
    width: 4vw;
    position: absolute;
    object-fit: contain;
    text-align: center;
    cursor: pointer;
    margin-left: -12vw;
    bottom: 35%;
    border-radius: 100%;
    box-shadow: -8px 8px 32px rgba(0, 0, 0, 1);
    transition: 0.4s;
    z-index: 1;
    opacity: 0;
    border: 32px black;
}

.carousel-slide .image-container:active  .overlay-image {
    transition: 0.15s;   
}

.carousel-slide .image-container:hover .overlay-image {
    transition: 0.3s;
    opacity: 1;
    border: 4px white;
}

.prev, .next {
    position: absolute;
    top: 27%;
    font-size: calc(1vw + 1vh + .5vmin);
    color: white;
    background-color: rgba(0,0,0,0.5); /* Semi-transparent black background */
    padding: calc(1vw + 1vh - 0.5vmin);
    border-radius: 5%;
    cursor: pointer;
    border: 0; /* No border */
    transform: scale(1);
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Hover effect */
.prev:hover, .next:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease, color 0.2s ease;
    color: rgb(255, 210, 11);
    background-color: rgba(0,0,0,0.7); /* Darker on hover */
}

/* Active (click) effect */
.prev:active, .next:active {
    transform: scale(0.9);
    color: rgb(108, 40, 175);
    background-color: rgba(0,0,0,0.9); /* Even darker when active */
}

.prev { left: 3%; }
.next { right: 3%; }
