/* Video Autoplay Enhancer - Frontend Styles */

.vae-video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.vae-video-container video {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.vae-fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vae-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.vae-fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

/* Fullscreen mode adjustments */
.vae-video-container:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.vae-video-container:-moz-full-screen {
    width: 100%;
    height: 100%;
}

.vae-video-container:fullscreen {
    width: 100%;
    height: 100%;
}

.vae-video-container:-webkit-full-screen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vae-video-container:-moz-full-screen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vae-video-container:fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* WooCommerce specific styles */
.woocommerce-product-gallery .vae-video-container {
    margin: 0;
    border-radius: 0;
}

.woocommerce-product-gallery__wrapper .vae-video-container {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vae-fullscreen-btn {
        padding: 6px 10px;
    }
    
    .vae-fullscreen-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Hide default video controls on autoplay */
.vae-video-container video::-webkit-media-controls {
    opacity: 0.7;
}

.vae-video-container video::-webkit-media-controls:hover {
    opacity: 1;
}

/* Ensure proper aspect ratio */
.vae-video-container::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio by default */
}

.vae-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Override for specific size classes */
.alignleft .vae-video-container,
.alignright .vae-video-container {
    max-width: 50%;
}

.aligncenter .vae-video-container {
    margin-left: auto;
    margin-right: auto;
}

/* Loading state */
.vae-video-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vae-spin 0.8s linear infinite;
}

@keyframes vae-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
