.modal-content {
    position: relative;
    overflow: hidden; /* To contain the absolutely positioned carousel */
}

.carousel-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Place behind modal content */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Initially hidden */
    transition: opacity 3s ease-in-out; /* Smooth transition */
}

.carousel-background.visible {
    opacity: 1; /* Visible state */
}

.carousel-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the entire area */
    opacity: 0;
    transition: opacity 1s ease-in-out; /* Smooth transition */
}

.carousel-image.active {
    opacity: 1;
}

/* Add semi-transparent background to modal parts for readability */
.modal-header, .modal-body, .modal-footer {
    background-color: rgba(255, 255, 255, 0.8); /* Example semi-transparent white */
    position: relative; /* To ensure they are above the carousel */
    z-index: 1;
}
