/*
   任务完成小通知 - Compact Task Completion Notification
   - 小巧简洁
   - 右下角显示
   - 无声音
   - 自动消失
*/

/* 通知容器 */
.task-notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    pointer-events: none;
}

/* 单个通知 */
.task-notification {
    background: rgba(20, 28, 46, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInFromRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.task-notification:hover {
    transform: translateX(-4px);
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(249, 115, 22, 0.2);
}

/* 左侧图标 */
.task-notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.task-notification.success .task-notification-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    animation: successPulse 0.5s ease-out;
}

.task-notification.error .task-notification-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* 内容区 */
.task-notification-content {
    flex: 1;
    min-width: 0;
}

.task-notification-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-notification-message {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 关闭按钮 */
.task-notification-close {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.task-notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

/* 底部进度条 */
.task-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.task-notification-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    animation: notificationProgress 2s linear forwards;
}

/* 消失动画 */
.task-notification.removing {
    animation: slideOutToRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 动画定义 */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(400px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutToRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(400px) scale(0.95);
    }
}

@keyframes notificationProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .task-notification-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .task-notification {
        padding: 10px 12px;
    }

    .task-notification-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .task-notification-title {
        font-size: 12px;
    }

    .task-notification-message {
        font-size: 10px;
    }
}

/* 深色主题优化 */
@media (prefers-color-scheme: dark) {
    .task-notification {
        background: rgba(15, 23, 42, 0.98);
    }
}

/* 性能优化 */
.task-notification {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.task-notification:not(.removing) {
    will-change: auto;
}
