/* 视频教程专用样式 */

/* 视频播放器模态框 */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.video-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-video {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.close-video:hover {
    background: #f3f4f6;
}

.video-container {
    padding: 2rem 2rem 0 2rem;
}

.video-info {
    padding: 1rem 2rem 2rem 2rem;
}

.video-info h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.5rem;
}

/* 视频控制按钮 */
.video-controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    justify-content: center;
}

.video-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.video-controls button:hover {
    background: #5a67d8;
}

.video-controls button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* 进度条 */
.video-progress {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#progress-text {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    display: block;
}

/* 交互式教程样式 */
.interactive-tutorial {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.tutorial-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
    min-height: 200px;
}

.step-illustration {
    font-size: 4rem;
    color: #667eea;
}

.tutorial-visual img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.tutorial-content {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tutorial-content h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.2rem;
}

.tutorial-content p {
    margin: 0 0 1rem 0;
    color: #4b5563;
    line-height: 1.6;
}

.tutorial-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.tutorial-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.step-tips {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 1rem 0;
    color: #92400e;
    font-size: 0.9rem;
}

/* 步骤导航 */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 1rem;
}

.step-navigation button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.step-navigation button:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
}

.step-navigation button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.step-counter {
    font-weight: 600;
    color: #374151;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-modal {
        padding: 1rem;
    }
    
    .video-modal-content {
        max-height: 95vh;
    }
    
    .video-container {
        padding: 1rem;
    }
    
    .video-info {
        padding: 0.5rem 1rem 1rem 1rem;
    }
    
    .video-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .video-controls button {
        width: 100%;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-navigation button {
        width: 100%;
    }
    
    .close-video {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* 视频缩略图悬停效果 */
.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail:hover::before {
    opacity: 1;
}

.video-thumbnail:hover .play-button {
    transform: scale(1.2);
}

/* 教程分类卡片动画 */
.category-card {
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 视频质量标识 */
.video-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* 新视频标识 */
.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 收藏按钮 */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 50px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.video-card:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: #ef4444;
}

/* 视频标签 */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.video-tag {
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .video-modal-content {
        background: #1f2937;
        color: white;
    }
    
    .tutorial-content {
        background: #374151;
        border-color: #4b5563;
    }
    
    .step-navigation {
        background: #374151;
    }
    
    .step-counter {
        background: #1f2937;
        border-color: #4b5563;
        color: white;
    }
    
    .close-video {
        background: #374151;
        color: white;
    }
    
    .close-video:hover {
        background: #4b5563;
    }
}