/* 视频播放器控制面板样式 */

/* 视频设置面板打开时的躲避动画 */
.video-player.video-settings-open .container,
.video-player.video-settings-open header,
.video-player.video-settings-open .mode-switcher,
.video-player.video-settings-open .breadcrumb,
.video-player.video-settings-open .category-grid,
.video-player.video-settings-open .video-items {
    transform: translateX(-15px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(0.95);
}

/* 视频设置按钮 */
.video-settings-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.video-settings-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 视频设置面板 */
.video-settings-panel {
    position: absolute;
    right: 70px;
    top: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    width: 250px;
    z-index: 10;
    display: none;
    animation: fadeIn 0.2s ease;
}

.video-settings-panel.show {
    display: block;
}

/* 移动端视频设置面板动画 */
@media (max-width: 768px) {
    .video-settings-panel {
        animation: none;
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .video-settings-panel.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.video-settings-panel h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

/* 设置分组 */
.setting-group {
    margin-bottom: 15px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    color: rgba(125, 125, 125, 0.8);
    margin-bottom: 8px;
    font-size: 14px;
}

/* 画质选择 */
.quality-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quality-option {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    user-select: none;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.quality-option.active {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 176, 155, 0.3);
}

.quality-option span {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* 下载按钮 */
.download-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #009688, #8bc34a);
    transform: translateY(-1px);
}

/* 缓存按钮和状态 */
.cache-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.cache-btn:hover {
    background: linear-gradient(135deg, #009688, #8bc34a);
    transform: translateY(-1px);
}

.cache-btn.cached {
    background: linear-gradient(135deg, #00b09b, #96c93d);
}

.cache-btn.cached:hover {
    background: linear-gradient(135deg, #009688, #8bc34a);
}

.cache-btn.caching {
    background: #FF9800;
    cursor: not-allowed;
}

.cache-status {
    font-size: 12px;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    text-align: center;
}

.cache-status.cached {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.cache-status.caching {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.cache-status.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    /* 视频设置面板在移动端的特殊处理 */
    .video-settings-panel {
        position: fixed;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: calc(100vw - 40px);
        max-width: 350px;
        max-height: 80vh;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
    }
    
    /* 设置按钮在移动端的调整 */
    .video-settings-btn {
        right: 15px;
        top: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    /* 设置项在移动端的间距调整 */
    .setting-group {
        margin-bottom: 20px;
    }
    
    .setting-label {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    /* 画质选择按钮在移动端的优化 */
    .quality-option {
        padding: 10px 14px;
        font-size: 14px;
        min-width: 90px;
    }
    
    /* 按钮在移动端的优化 */
    .cache-btn, .download-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕的进一步优化 */
    .video-settings-panel {
        width: calc(100vw - 20px);
        padding: 15px;
        border-radius: 8px;
    }
    
    .video-settings-panel h3 {
        font-size: 15px;
    }
    
    .quality-options {
        gap: 6px;
    }
    
    .quality-option {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 80px;
    }
}

/* 移动端视频设置面板的背景遮罩 */
@media (max-width: 768px) {
    .video-settings-panel.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    
    /* 移动端视频设置面板滚动条样式 */
    .video-settings-panel::-webkit-scrollbar {
        width: 4px;
    }
    
    .video-settings-panel::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }
    
    .video-settings-panel::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
    
    .video-settings-panel::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* 移动端进度条优化 */
@media (max-width: 768px) {
    .cache-progress-container {
        margin-top: 12px !important;
    }
    
    .cache-progress-bar {
        height: 8px !important;
        border-radius: 4px !important;
    }
    
    .cache-progress-text {
        font-size: 12px !important;
        margin-top: 6px !important;
    }
}

/* 防止移动端设置面板内容被截断 */
@media (max-width: 768px) and (max-height: 600px) {
    .video-settings-panel {
        max-height: 70vh;
        padding: 15px;
    }
    
    .setting-group {
        margin-bottom: 15px;
    }
    
    .video-settings-panel h3 {
        margin-bottom: 12px;
        font-size: 14px;
    }
}

/* 横屏模式的特殊处理 */
@media (max-width: 768px) and (orientation: landscape) {
    .video-settings-panel {
        max-height: 85vh;
        width: calc(100vw - 60px);
        max-width: 400px;
    }
}

/* 针对非常小的屏幕进行优化 */
@media (max-width: 320px) {
    .video-settings-panel {
        width: calc(100vw - 10px);
        padding: 12px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .cache-btn, .download-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}
