/**
 * Bunny Stream Product Videos - Frontend Styles
 */

/* Main container for the carousel */
.bunny-stream-carousel-wrapper {
    position: relative;
    margin: 20px 0;
    padding: 0 10px; /* 添加左右内边距，为导航箭头留出空间 */
    width: 100%;
    box-sizing: border-box;
    overflow: visible; /* 允许导航箭头显示在容器外部 */
}

/* Carousel container */
.bunny-stream-videos-container {
    display: flex;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    width: 100%;
    max-width: 100%;
    scroll-snap-type: x mandatory; /* 添加滚动对齐效果 */
    -ms-overflow-style: none;  /* 隐藏IE和Edge的滚动条 */
    scrollbar-width: none;  /* 隐藏Firefox的滚动条 */
}

/* 隐藏Chrome的滚动条 */
.bunny-stream-videos-container::-webkit-scrollbar {
    display: none;
}

/* Video item */
.bunny-stream-video-item {
    flex: 0 0 100%;
    padding: 0 5px; /* 减少移动端的内边距 */
    box-sizing: border-box;
    transition: transform 0.3s ease;
    width: 100%;
    scroll-snap-align: start; /* 添加滚动对齐效果 */
}

/* Desktop view - 3 videos per row */
@media (min-width: 768px) {
    .bunny-stream-video-item {
        flex: 0 0 33.333%;
    }
}

/* Custom column override */
.bunny-stream-videos-container[data-columns="2"] .bunny-stream-video-item {
    flex: 0 0 100%;
}

@media (min-width: 768px) {
    .bunny-stream-videos-container[data-columns="2"] .bunny-stream-video-item {
        flex: 0 0 50%;
    }
}

.bunny-stream-videos-container[data-columns="4"] .bunny-stream-video-item {
    flex: 0 0 100%;
}

@media (min-width: 768px) {
    .bunny-stream-videos-container[data-columns="4"] .bunny-stream-video-item {
        flex: 0 0 25%;
    }
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    .bunny-stream-video-item {
        padding: 0 2px; /* 更小的内边距 */
    }
    
    .bunny-stream-carousel-wrapper {
        margin: 10px 0;
    }
    
    .bunny-stream-video-title {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Video card styling */
.bunny-stream-video-card {
    border-radius: 8px;
    overflow: hidden;
    /* 移除背景色，防止与标题背景冲突 */
    background-color: transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 移除悬停效果 - 完全移除 */

/* Video wrapper */
.bunny-stream-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    width: 100%;
    max-width: 100%;
}

/* Bunny Stream player iframe */
.bunny-stream-video-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px; /* 与卡片保持一致的圆角 */
}

/* Video iframe container */
.bunny-stream-video-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 加载动画 */
.bunny-stream-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ffffff;
    animation: bunny-stream-spin 1s linear infinite;
}

@keyframes bunny-stream-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Video title */
.bunny-stream-video-title {
    padding: 10px 10px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    color: #000; /* 黑色文字在浅色背景上 */
    line-height: 1.3;
    width: 100%;
    box-sizing: border-box;
    display: block !important;
    visibility: visible !important;
    margin-top: -5px;
    position: relative; /* 为伪元素定位做准备 */
    border-radius: 0 0 8px 8px; /* 圆角效果 */
    overflow: hidden;
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0, #e8e8e8, #f8f8f8); /* 更柔和的浅灰色渐变 */
    animation: gradientAnimation 12s ease infinite; /* 减慢动画速度 */
    background-size: 300% 300%; /* 调整背景尺寸使动画更明显 */
}

/* 添加上层渐变叠加效果 - 更明显的变化 */
.bunny-stream-video-title::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, 
        rgba(255,255,255,0.1), 
        rgba(240,240,240,0.5), /* 浅灰色 */
        rgba(220,220,220,0.5), /* 深灰色 */
        rgba(255,255,255,0.1));
    z-index: -1;
    animation: shimmerEffect 8s infinite; /* 减慢闪光效果 */
}

/* 动态渐变动画关键帧 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 闪光效果动画关键帧 - 更加柔和 */
@keyframes shimmerEffect {
    0% { opacity: 0.1; transform: translateX(-100%); }
    50% { opacity: 0.4; }
    100% { opacity: 0.1; transform: translateX(100%); }
}

/* 移除毛玻璃效果相关的样式 */

/* 卡片底部圆角 */
.bunny-stream-video-card {
    border-radius: 8px;
    overflow: hidden;
}

/* Navigation arrows */
.bunny-stream-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.3s ease;
    user-select: none;
}

.bunny-stream-nav-arrow:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.bunny-stream-prev {
    left: 10px;
}

.bunny-stream-next {
    right: 10px;
}

.bunny-stream-nav-arrow.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 移动端样式优化 */
@media (max-width: 767px) {
    .bunny-stream-nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .bunny-stream-prev {
        left: 5px;
    }
    
    .bunny-stream-next {
        right: 5px;
    }
}

/* Navigation dots */
.bunny-stream-dots {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.bunny-stream-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.bunny-stream-dot.active {
    background-color: #333;
}

/* Error and notice messages */
.bunny-stream-error {
    color: #d63638;
    padding: 10px;
    background-color: #ffebe8;
    border-left: 4px solid #d63638;
    margin: 10px 0;
}

.bunny-stream-notice {
    color: #333;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 4px solid #000;
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.5;
}

/* Touch-enabled indicators */
.bunny-stream-touch-scroll {
    display: none;
    text-align: center;
    color: #666;
    margin: 10px 0;
    font-size: 14px;
}

@media (max-width: 767px) {
    .bunny-stream-touch-scroll {
        display: block;
    }
}
