/**
 * Custom Gallery Video Styles
 * Responsive video player integration for WooCommerce
 */

/* Video Wrapper */
.custom-gallery-video-wrapper {
    width: 100%;
    margin-top: 1.5rem;
}

/* Responsive Video Container - 16:9 Aspect Ratio */
.custom-gallery-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio (9/16 = 0.5625) */
    height: 0;
    overflow: hidden;
    background-color: #0a0a0a;
    border: 1px solid #2a2a2a;
}

/* Video iframe - positioned absolutely to fill container */
.custom-gallery-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Integration with WooCommerce Gallery */
.woocommerce-product-gallery .custom-gallery-video-wrapper {
    margin-top: 0;
}

/* Thumbnail view (if video appears in thumbnails) */
.flex-control-thumbs .custom-gallery-video-wrapper {
    position: relative;
}

.flex-control-thumbs .custom-gallery-video-container {
    padding-bottom: 100%;
    /* Square for thumbnails */
    cursor: pointer;
}

.flex-control-thumbs .custom-gallery-video-container::before {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ffffff;
    z-index: 1;
    pointer-events: none;
}

/* Dark theme integration */
.custom-gallery-video-wrapper {
    background-color: #1a1a1a;
}

/* Loading state */
.custom-gallery-video-container[data-loading="true"]::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.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: video-spinner 0.8s linear infinite;
}

@keyframes video-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-gallery-video-wrapper {
        margin-top: 1rem;
    }
}

/* Smooth transitions */
.custom-gallery-video-container {
    transition: border-color 0.2s ease;
}

.custom-gallery-video-container:hover {
    border-color: #ffffff;
}

/* Accessibility - Focus state */
.custom-gallery-video-container:focus-within {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}