/**
 * 屏幕共享样式
 */

/* 菜单样式保持原样 - 不修改 */

/* ============ 屏幕共享弹窗 ============ */
.screen-share-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.share-preview-container {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16/9;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.share-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.share-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.share-placeholder p {
    font-size: 14px;
    margin: 0;
}

.share-placeholder .share-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

#share-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.share-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.share-controls .btn {
    min-width: 120px;
}

.share-status {
    color: #07c160;
    font-size: 14px;
    text-align: center;
}

/* ============ 观看者弹窗 ============ */
.modal-fullscreen {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-fullscreen .modal-header {
    flex-shrink: 0;
}

.modal-fullscreen .viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    padding: 0;
    overflow: hidden;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.viewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.viewer-count {
    background: rgba(255, 71, 87, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #07c160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.viewer-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #999;
}

.viewer-placeholder p {
    margin: 8px 0;
    font-size: 14px;
}

/* ============ 屏幕共享卡片消息 ============ */
.screen-share-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 16px;
    min-width: 240px;
    max-width: 280px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.share-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.share-card-icon {
    font-size: 24px;
}

.share-card-title {
    font-weight: 600;
    font-size: 14px;
}

.share-card-body {
    margin-bottom: 12px;
}

.share-card-body p {
    margin: 0 0 8px 0;
    font-size: 13px;
    opacity: 0.9;
}

.share-card-viewers {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.share-join-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #667eea !important;
    border: none !important;
    font-weight: 600;
}

.share-join-btn:hover {
    background: white !important;
}

.share-join-btn:disabled {
    background: rgba(255, 255, 255, 0.5) !important;
    color: #999 !important;
    cursor: not-allowed;
}

/* ============ 按钮样式 ============ */
.btn-danger {
    background: #ff4757;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #ff3344;
}

.btn-success {
    background: #07c160;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #06a050;
}

/* ============ 移动端适配 ============ */
@media screen and (max-width: 768px) {
    .more-menu-item {
        width: 68px;
        min-width: 68px;
    }
    
    .modal-fullscreen {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .modal-fullscreen .viewer-body {
        /* 移动端全屏显示视频 */
        touch-action: manipulation;
    }
    
    #remote-video {
        /* 确保移动端视频正确显示 */
        width: 100% !important;
        height: 100% !important;
        max-width: 100vw;
        max-height: calc(100vh - 60px);
        background: #000;
    }
    
    .share-preview-container {
        aspect-ratio: 4/3;
    }
    
    .share-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .share-controls .btn {
        width: 100%;
    }
    
    .screen-share-card {
        min-width: 200px;
        max-width: 240px;
    }
    
    /* 移动端点击播放提示 */
    .viewer-body::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
    }
}

/* 已结束状态 */
.screen-share-card.share-ended {
    opacity: 0.7;
}

.screen-share-card.share-ended .share-card-header {
    background: linear-gradient(135deg, #666, #888);
}

.btn-disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
