/**
 * Product Videos Frontend Styles
 * 
 * @package Custom_Site_Functions
 * @since 1.1
 */

/* Product videos container */
.product-videos {
    margin: 20px 0;
}

.product-videos .videos-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.videos-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Individual video styling */
.product-video {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Multiple videos layout */
@media (min-width: 768px) {
    .videos-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* If only one video, make it larger but not full width */
    .videos-container:has(.product-video:only-child) {
        //grid-template-columns: minmax(300px, 600px);
        justify-content: center;
    }
}

/* Single product page specific styling */
.single-product .product-videos {
    margin: 20px 0;
    padding: 20px 0;
}

.single-product .product-videos .videos-title {
    font-size: 1.4em;
    margin-bottom: 20px;
}

/* Shop page / archive styling */
.archive .product-videos,
.shop .product-videos {
    margin: 15px 0;
}

.archive .product-videos .videos-title,
.shop .product-videos .videos-title {
    font-size: 1.1em;
    margin-bottom: 12px;
}

/* Shortcode specific styling */
.product-videos.shortcode-videos {
    margin: 25px 0;
}

/* Loading state */
.video-wrapper.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .product-videos {
        margin: 15px 0;
    }
    
    .videos-container {
        gap: 15px;
    }
    
    .product-videos .videos-title {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .product-video {
        background: #2d3748;
    }
    
    .product-videos .videos-title {
        color: #e2e8f0;
    }
    
    .single-product .product-videos {
        border-top-color: #4a5568;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .product-video {
        border: 2px solid #000;
    }
    
    .product-video:hover {
        border-color: #0066cc;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .product-video {
        transition: none;
    }
    
    .product-video:hover {
        transform: none;
    }
    
    .video-wrapper.loading {
        animation: none;
        background: #f0f0f0;
    }
}
