.img-fluid {
    max-height: 400px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.thumbnail-item .position-relative {
    overflow: hidden;
}

.video-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.video-indicator span {
    color: white;
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-item:hover .video-indicator {
    background-color: rgba(0, 0, 0, 0.1);
}

.gallery-container {
    position: relative;
    padding: 20px 0;
}

.preview-media {
    height: 500px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.thumbnails-slider {
    display: flex;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 10px 0;
    justify-content: center;
}

.thumbnail-item {
    flex: 0 0 auto;
    width: 120px;
    cursor: pointer;
}

.thumbnail-item img {
    height: 100px;
    object-fit: cover;
    transition: all 0.2s ease-in-out;
    border: 3px solid transparent;
}

.thumbnail-item img:hover {
    transform: scale(1.05);
    border-color: #28a745;
}

.thumbnail-item.active img {
    border-color: #28a745;
}


/* Video thumbnail specific styling */

.video-thumb-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.play-icon {
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass through to container */
}

.play-icon i {
    color: white;
    font-size: 24px;
}

.video-thumbnail img::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(40, 167, 69, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background-color: rgba(40, 167, 69, 1);
}

.prev-btn {
    left: -20px;
}

.next-btn {
    right: -20px;
}


/* Improved video player styles */

#preview-video {
    background-color: #000;
    cursor: pointer;
}

.video-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#preview-container:hover .video-controls-overlay {
    opacity: 1;
}

.large-play-button {
    width: 80px;
    height: 80px;
    background-color: rgba(40, 167, 69, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.large-play-button i {
    color: white;
    font-size: 40px;
}

@media (max-width: 768px) {
    .preview-media {
        height: 300px;
    }
    .thumbnail-item {
        width: 80px;
    }
    .thumbnail-item img {
        height: 60px;
    }
    .mb-sm-2 {
        margin-bottom: 20px;
    }
}