/**
 * 视频悬停预览样式 - 类似B站效果
 */

/* 视频悬停预览容器 */
.video-hover-preview {
    position: fixed;
    z-index: 9999;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.video-hover-preview.show {
    opacity: 1;
    transform: scale(1);
}

.video-hover-preview video {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: #000;
}

/* 预览进度条 */
.preview-progress {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
}

.preview-progress-bar {
    height: 100%;
    background: #00a1d6;
    width: 0;
    transition: width 0.1s linear;
}

/* 预览时间 */
.preview-time {
    position: absolute;
    bottom: 4px;
    left: 8px;
    font-size: 12px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 视频消息容器 - 添加悬停效果 */
.video-message {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.video-message:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-message:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 视频缩略图 */
.video-thumbnail {
    position: relative;
    width: 200px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-thumbnail video {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

/* 播放按钮覆盖层 */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    transition: all 0.2s ease;
}

/* 视频预览弹窗 */
.video-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-preview-modal.show {
    display: flex;
}

.video-preview-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.video-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #222;
    color: #fff;
}

.video-preview-title {
    font-size: 16px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
}

.video-preview-body video {
    width: 100%;
    max-height: 70vh;
    outline: none;
}

.video-preview-footer {
    padding: 12px 16px;
    background: #222;
    text-align: center;
}

.video-download-btn {
    display: inline-block;
    padding: 8px 24px;
    background: #00a1d6;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.video-download-btn:hover {
    background: #00b5e5;
    color: #fff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .video-hover-preview {
        display: none !important;
    }
    
    .video-thumbnail {
        width: 160px;
    }
    
    .video-play-overlay {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .video-preview-content {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .video-preview-body video {
        max-height: 50vh;
    }
}
