/**
 * global-task.css - 全局后台任务状态栏样式
 */

/* ==========================================
   🌟 全局后台任务状态栏样式（常驻显示）
   ========================================== */
.global-task-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2b2c2f;
    border: 2px solid #10a37f;
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    cursor: default;
    min-width: 140px;
}

/* 任务栏指示器（小圆点） */
.task-bar-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10a37f;
    transition: background 0.3s;
    flex-shrink: 0;
}

/* 空闲状态 - 绿色 */
.global-task-bar.idle {
    border-color: #10a37f;
}
.global-task-bar.idle .task-bar-indicator {
    background: #10a37f;
}
.global-task-bar.idle .task-bar-icon {
    color: #10a37f;
}

/* 有任务状态 - 黄色 */
.global-task-bar.running {
    border-color: #e6a23c;
    animation: taskBarPulse 2s ease-in-out infinite;
}
.global-task-bar.running .task-bar-indicator {
    background: #e6a23c;
    animation: indicatorPulse 1.5s ease-in-out infinite;
}
.global-task-bar.running .task-bar-icon {
    color: #e6a23c;
}

/* 完成闪烁 - 短暂绿色高亮 */
.global-task-bar.completed-flash {
    border-color: #67c23a;
    box-shadow: 0 0 20px rgba(103, 194, 58, 0.5);
}
.global-task-bar.completed-flash .task-bar-indicator {
    background: #67c23a;
}

@keyframes taskBarPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(230, 162, 60, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(230, 162, 60, 0.6); }
}

@keyframes indicatorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.task-bar-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #ececf1;
}

.task-bar-icon {
    font-size: 1rem;
}

.task-bar-text {
    white-space: nowrap;
}

.task-bar-expand {
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}
.task-bar-expand:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* 任务详情展开面板 */
.task-bar-details {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: #2b2c2f;
    border: 1px solid #444;
    border-radius: 12px;
    min-width: 280px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.task-bar-details:empty::after {
    content: '暂无任务';
    display: block;
    padding: 20px;
    text-align: center;
    color: #888;
}

.task-detail-item {
    padding: 12px 15px;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.task-detail-item:last-child {
    border-bottom: none;
}

.task-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-detail-type {
    font-weight: bold;
    color: #ececf1;
    font-size: 0.85rem;
}

.task-detail-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e6a23c;
    color: white;
}

.task-detail-status.completed {
    background: #67c23a;
}

.task-detail-status.failed {
    background: #f56c6c;
}

.task-detail-progress {
    height: 4px;
    background: #444;
    border-radius: 2px;
    overflow: hidden;
}

.task-detail-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e6a23c, #f59e0b);
    transition: width 0.3s;
}

.task-detail-message {
    font-size: 0.8rem;
    color: #888;
}
