/* Hryoubloom Product Video Gallery Styles */

.hryoubloom-product-video-gallery {
    max-width: 600px;
    margin: 0 auto 30px;
}

/* 主图轮播区域 */
.video-gallery-main {
    position: relative;
    width: 100%;
    height: 400px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.video-slide, .product-image-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-slide.active, .product-image-slide.active {
    opacity: 1;
}

.video-slide video, .video-slide iframe {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: cover;
    border: none;
}

.product-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 400px;
}

/* 缩略图区域 */
.video-gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
}

.video-gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.video-gallery-thumbnails::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.video-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.video-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* 视频缩略图 */
.video-thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.video-thumbnail-item:hover {
    border-color: #007cba;
    transform: scale(1.05);
}

.video-thumbnail-item.active {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.video-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.video-play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-left: 2px;
}

/* 产品缩略图 */
.product-thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-thumbnail-item:hover {
    border-color: #007cba;
    transform: scale(1.05);
}

.product-thumbnail-item.active {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.product-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hryoubloom-product-video-gallery {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .video-gallery-main {
        height: 300px;
    }
    
    .video-slide video, .video-slide iframe {
        max-height: 300px;
    }
    
    .product-image-slide img {
        max-height: 300px;
    }
    
    .video-thumbnail-item,
    .product-thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .video-play-icon {
        width: 24px;
        height: 24px;
    }
    
    .video-play-icon::before {
        border-left-width: 6px;
        border-top-width: 4px;
        border-bottom-width: 4px;
        margin-left: 1px;
    }
}

@media (max-width: 480px) {
    .video-gallery-main {
        height: 250px;
    }
    
    .video-slide video, .video-slide iframe {
        max-height: 250px;
    }
    
    .product-image-slide img {
        max-height: 250px;
    }
    
    .video-thumbnail-item,
    .product-thumbnail-item {
        width: 50px;
        height: 50px;
    }
    
    .video-play-icon {
        width: 20px;
        height: 20px;
    }
    
    .video-play-icon::before {
        border-left-width: 5px;
        border-top-width: 3px;
        border-bottom-width: 3px;
        margin-left: 1px;
    }
}

/* 加载状态 */
.hryoubloom-product-video-gallery.loading {
    opacity: 0.6;
    pointer-events: none;
}

.hryoubloom-product-video-gallery.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 视频控制按钮 */
.video-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 10;
}

.video-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.video-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 视频信息覆盖层 */
.video-info-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 80%;
    z-index: 10;
}

.video-info-overlay h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.video-info-overlay p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

/* 全屏模式 */
.video-gallery-main.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: black;
    border-radius: 0;
}

.video-gallery-main.fullscreen .video-slide video,
.video-gallery-main.fullscreen .video-slide iframe {
    max-height: 100vh;
    height: 100vh;
}

.video-gallery-main.fullscreen .product-image-slide img {
    max-height: 100vh;
    height: 100vh;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
}