body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #111;
    color: #fff;
}

/* Carousel Container */
.carousel-container {
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

/* Main Display */
.main-display {
    position: relative;
    width: 800px;
    height: 450px; /* Fixed size for consistency */
    margin: 0 auto;
    background-color: #222; /* Background for the main display */
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-display img,
.main-display video {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

/* Navigation Buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1;
}

.nav-button.prev {
    left: 10px;
}

.nav-button.next {
    right: 10px;
}

/* Thumbnail Bar */
.thumbnail-bar {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    background-color: #333; /* Background for the thumbnail bar */
    padding: 10px;
    border-radius: 10px;
}

.thumbnail {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 5px;
    transition: border 0.3s;
}

.thumbnail:hover, .thumbnail.active {
    border: 2px solid #fff;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    position: relative;
    width: 1200px; /* Consistent width */
    height: 675px; /* Consistent height */
    background-color: #222;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.overlay-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* Overlay Navigation Buttons */
.overlay-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 18px;
    z-index: 10;
    display: none; /* Hidden until hovered */
}

.overlay-content:hover .overlay-nav {
    display: block; /* Show on hover */
}

.overlay-nav.prev {
    left: 10px;
}

.overlay-nav.next {
    right: 10px;
}