/* Video Hover Display - Frontend Styles */

.vhd-container {
    margin: 20px 0;
    clear: both;
}

.vhd-wrapper {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
}

.vhd-media-container {
    position: relative;
    width: 100%;
    /* Fixed height - all images/videos will be this tall */
    height: 600px;
    overflow: hidden;
    background: #000;
}

.vhd-image,
.vhd-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Set minimum dimensions to fill container */
    min-width: 100%;
    min-height: 100%;
    /* Maintain aspect ratio - will expand beyond container if needed */
    width: auto;
    height: 100%;
    /* Center and crop excess */
    object-fit: cover;
    object-position: center center;
    transition: opacity 0.3s ease;
}

.vhd-image {
    opacity: 1;
    z-index: 1;
}

.vhd-video {
    opacity: 0;
    z-index: 2;
}

/* Video active state */
.vhd-wrapper.vhd-video-active .vhd-image {
    opacity: 0;
}

.vhd-wrapper.vhd-video-active .vhd-video {
    opacity: 1;
}

/* Link styling */
.vhd-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.vhd-link:hover,
.vhd-link:focus {
    text-decoration: none;
    outline: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vhd-container {
        margin: 15px 0;
    }

    .vhd-media-container {
        height: 500px;
    }
}

@media (max-width: 480px) {
    .vhd-container {
        margin: 10px 0;
    }

    .vhd-media-container {
        height: 400px;
    }
}

/* Loading state */
.vhd-wrapper.vhd-loading .vhd-media-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vhd-spin 0.8s linear infinite;
    z-index: 3;
}

@keyframes vhd-spin {
    to {
        transform: rotate(360deg);
    }
}