.custom-background-video-widget-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.custom-background-video-widget {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s ease;
    height: 400px; /* Fixed height (adjust as needed) */
    display: flex;
    flex-direction: column; /* Ensures content stacks vertically */
    justify-content: space-between; /* Distributes content within the widget */
    background-size: cover; /* Makes the background cover the entire widget */
    background-position: center; /* Centers the background image */
}

.custom-background-video-widget:hover .hover-media {
    opacity: 1;
}

.custom-background-video-widget .hover-media {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-background-video-widget .hover-video-element,
.custom-background-video-widget .hover-image-element {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures video/image fills the container without distortion */
}

/* Gradient overlay */
.custom-background-video-widget .gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* Make sure the gradient is above the background */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)); /* Gradient from transparent to black */
    pointer-events: none; /* Ensure the overlay doesn't interfere with interactions */
}

/* Hover effect for video/image media */
.custom-background-video-widget:hover .hover-media video,
.custom-background-video-widget:hover .hover-media img {
    opacity: 1; /* Make sure hover media appears on hover */
}

.custom-background-video-widget .hover-media video,
.custom-background-video-widget .hover-media img {
    opacity: 0; /* Hide hover media by default */
    transition: opacity 0.3s ease-in-out;
}

.custom-background-video-widget:hover .hover-media video,
.custom-background-video-widget:hover .hover-media img {
    opacity: 1; /* Show hover media when hovered */
}

.widget-content {
    position: relative;
    z-index: 2; /* Ensure content is above the gradient */
    padding: 20px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligns the content at the bottom */
    height: 100%; /* Ensures widget content occupies full height */
}

.widget-content h2,
.widget-content p {
    margin: 0;
}

/*.widget-content .button i { 
    margin-right: 8px; /* Adjust space between icon and text 
}*/
.custom-background-video-widget .button i {
    vertical-align: middle;
    transition: margin 0.3s ease;
}

.widget-content .button {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 182px;
}
.widget-content .button:hover {
    background-color: #555;
}

.selector .button-content {
    display: flex;
    align-items: center;
}

.selector .button-content i {
    margin-right: 10px; /* Default spacing when the icon is on the left */
}

.selector .button-content i[style*="order: 1"] {
    margin-left: 10px; /* Spacing when the icon is on the right */
    margin-right: 0;   /* Remove the default left margin */
}


/* Responsive design */

@media (max-width: 1600px) {
    .custom-background-video-widget {
        width: 100%; /* Stacks widgets on smaller screens */
        height: 415px; /* Adjust height for smaller screens */
    }
}
@media (max-width: 1400px) {
    .custom-background-video-widget {
        width: 100%; /* Stacks widgets on smaller screens */
        height: 330px; /* Adjust height for smaller screens */
    }
}
@media (max-width: 768px) {
    .custom-background-video-widget {
        width: 100%; /* Stacks widgets on smaller screens */
        height: 250px; /* Adjust height for smaller screens */
    }
}

@media (max-width: 480px) {
    .custom-background-video-widget {
        height: 200px; /* Further adjust height for mobile devices */
    }

    .widget-content {
        padding: 15px; /* Reduce padding for smaller devices */
    }
}
