/**
 * 营销视频播放器样式
 * 响应式设计，支持移动端和桌面端
 */

.marketing-video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

#main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* 动画播放按钮 */
.animated-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    animation: pulsate 2s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.animated-play-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.play-button-inner {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

/* 脉冲动画 */
@keyframes pulsate {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* 自定义控制栏 */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.video-container:hover .custom-controls,
.video-container:focus-within .custom-controls {
    opacity: 1;
}

/* 进度条 */
.progress-container {
    margin-bottom: 10px;
}

/* 当进度条隐藏时的样式 */
.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 6px;
}

.progress-filled {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.progress-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-filled::after {
    opacity: 1;
}

/* 主控制区域 */
.controls-main {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
}

/* 播放/暂停按钮 */
.play-pause-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
}

.play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.play-pause-btn i {
    font-size: 18px;
    margin-left: 2px;
}

/* 时间显示 */
.time-display {
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* 当音量控制隐藏时的样式 */
.volume-control.hidden {
    display: none;
}

.mute-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mute-btn i {
    font-size: 14px;
}

.volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.volume-control:hover .volume-slider {
    width: 60px;
}

.volume-range {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.volume-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 全屏按钮 */
.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    margin-left: auto;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-btn i {
    font-size: 14px;
}

/* 覆盖层样式 */
.pause-overlay,
.cta-overlay,
.resume-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(5px);
}

.overlay-content,
.cta-content,
.resume-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pause-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.overlay-content h3,
.cta-content h3,
.resume-content h3 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.overlay-content p,
.cta-content p,
.resume-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 按钮样式 */
.resume-btn,
.cta-btn,
.cta-close,
.resume-yes,
.resume-no {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 5px;
}

.resume-btn,
.cta-btn,
.resume-yes {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
}

.resume-btn:hover,
.cta-btn:hover,
.resume-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.cta-close,
.resume-no {
    background: #f0f0f0;
    color: #666;
}

.cta-close:hover,
.resume-no:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.resume-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.resume-time {
    font-weight: 600;
    color: #ff6b6b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .marketing-video-player {
        border-radius: 8px;
        margin: 15px 0;
    }
    
    .animated-play-button {
        width: 70px;
        height: 70px;
    }
    
    .play-button-inner {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .custom-controls {
        padding: 15px 10px 10px;
    }
    
    .controls-main {
        gap: 10px;
    }
    
    .play-pause-btn {
        width: 36px;
        height: 36px;
    }
    
    .play-pause-btn i {
        font-size: 16px;
    }
    
    .time-display {
        font-size: 12px;
        min-width: 70px;
    }
    
    .mute-btn,
    .fullscreen-btn {
        width: 28px;
        height: 28px;
    }
    
    .mute-btn i,
    .fullscreen-btn i {
        font-size: 12px;
    }
    
    .volume-control:hover .volume-slider {
        width: 50px;
    }
    
    .volume-range {
        width: 50px;
    }
    
    .overlay-content,
    .cta-content,
    .resume-content {
        padding: 20px;
        margin: 15px;
        max-width: 320px;
    }
    
    .overlay-content h3,
    .cta-content h3,
    .resume-content h3 {
        font-size: 20px;
    }
    
    .overlay-content p,
    .cta-content p,
    .resume-content p {
        font-size: 14px;
    }
    
    .resume-btn,
    .cta-btn,
    .cta-close,
    .resume-yes,
    .resume-no {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .pause-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .animated-play-button {
        width: 60px;
        height: 60px;
    }
    
    .play-button-inner {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .controls-main {
        gap: 8px;
    }
    
    .time-display {
        font-size: 11px;
        min-width: 60px;
    }
    
    .overlay-content,
    .cta-content,
    .resume-content {
        padding: 15px;
        margin: 10px;
        max-width: 280px;
    }
    
    .resume-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .resume-btn,
    .cta-btn,
    .cta-close,
    .resume-yes,
    .resume-no {
        width: 100%;
        max-width: 200px;
    }
}

/* 全屏模式样式 */
.marketing-video-player:fullscreen .video-container {
    height: 100vh;
}

.marketing-video-player:fullscreen #main-video {
    height: 100vh;
    object-fit: contain;
}

/* 加载状态 */
.video-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container.loading::before {
    opacity: 1;
}

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

/* 错误状态 */
.video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 5;
}

.video-error h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.video-error p {
    font-size: 14px;
    opacity: 0.8;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    .custom-controls,
    .progress-filled,
    .play-pause-btn,
    .mute-btn,
    .fullscreen-btn,
    .volume-slider,
    .overlay-content,
    .cta-content,
    .resume-content {
        transition: none;
    }
    
    .video-container::before {
        animation: none;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .custom-controls {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .progress-bar {
        background: rgba(255, 255, 255, 0.5);
    }
    
    .progress-filled {
        background: #fff;
    }
    
    .play-pause-btn,
    .mute-btn,
    .fullscreen-btn {
        background: rgba(255, 255, 255, 0.3);
        border: 1px solid #fff;
    }
}
