/* ==========================================================================
   Video Preview & Emotion Display (New Feature)
   ========================================================================== */

/* 视频预览容器 */
.video-container {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 180px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    backdrop-filter: blur(12px);
}

/* 最小化状态 - 完全隐藏视频窗口，表情显示在头像 */
.video-container.minimized {
    display: none !important;
}

.video-container:hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* 视频元素 */
.video-container video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* 视频控制栏 */
.video-controls {
    padding: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 情绪显示 */
.emotion-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.3s ease;
}

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

.emotion-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.emotion-score {
    font-weight: 700;
    color: #6366F1;
    font-size: 0.95rem;
}

.emotion-text {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: capitalize;
    margin-left: auto;
    padding-left: 8px;
}

/* 视频切换按钮 */
.btn-video-toggle {
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(79, 70, 229, 0.9));
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-video-toggle:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 1), rgba(67, 56, 202, 1));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: scale(1.02);
}

.btn-video-toggle:active {
    transform: scale(0.98);
}

/* 最小化切换按钮 */
.btn-minimize-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.btn-minimize-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 恢复按钮（悬浮球） */
.btn-restore {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(79, 70, 229, 0.9));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s ease;
    user-select: none;
}

.btn-restore:hover {
    transform: scale(1.15);
}

.btn-restore:active {
    cursor: grabbing;
}

/* Header 中的视频启用按钮 */
.btn-header-video {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-header-video:hover {
    background: var(--accent-color);
    color: white;
}

/* 之前的固定底部按钮（如果还需要的话，可以保留，但现在我们要放到 header） */
.btn-enable-video {
    /* 这里保留旧样式作为备用，或者直接注释掉，因为我们现在用 Header 里的按钮 */
    display: none; 
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .video-container {
        width: 140px;
        bottom: 48px;
        right: 12px;
    }
    
    .video-controls {
        padding: 8px;
        gap: 6px;
    }
    
    .emotion-display {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .emotion-icon {
        font-size: 1.1rem;
    }
    
    .emotion-score {
        font-size: 0.85rem;
    }
    
    .emotion-text {
        font-size: 0.7rem;
        display: none; /* 小屏幕隐藏文字 */
    }
    
    .btn-video-toggle {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    /* 小屏幕也保留"视觉"文字 */
    .btn-header-video {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 极小屏幕优化 */
@media (max-width: 320px) {
    .video-container {
        width: 120px;
    }
}
