/**
 * 任务状态面板样式
 * 用于显示异步任务处理进度
 */

/* 任务状态面板 */
.task-status-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 2rem;
  min-width: 400px;
  max-width: 500px;
  z-index: 1000;
  border: 1px solid #e5e7eb;
}

.task-status-content h3 {
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.task-status-content p {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* 进度条容器 */
.task-progress {
  margin: 1.5rem 0;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  transition: width 0.5s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 状态文本 */
.status-text {
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0;
  transition: color 0.3s ease;
}

.status-text.status-completed {
  color: #10b981;
  font-weight: 500;
}

.status-text.status-failed {
  color: #ef4444;
  font-weight: 500;
}

.status-text.status-timeout {
  color: #f59e0b;
  font-weight: 500;
}

.status-text.status-error {
  color: #dc2626;
  font-weight: 500;
}

/* 查看状态按钮 */
.btn-check-status {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.5rem 1.5rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-check-status:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-check-status:active {
  transform: translateY(0);
}

.btn-check-status:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* 遮罩层 */
.task-status-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* 响应式设计 */
@media (max-width: 640px) {
  .task-status-panel {
    min-width: 320px;
    max-width: 90vw;
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .task-status-content h3 {
    font-size: 1.125rem;
  }
}

/* 动画效果 */
@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.task-status-panel {
  animation: fade-in-scale 0.3s ease-out;
}

/* 加载动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-text:not(.status-completed):not(.status-failed):not(.status-error):not(.status-timeout) {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 成功状态动画 */
@keyframes success-bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

.status-text.status-completed {
  animation: success-bounce 0.6s ease-out;
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
  .task-status-panel {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }
  
  .task-status-content h3 {
    color: #f9fafb;
  }
  
  .task-status-content p {
    color: #d1d5db;
  }
  
  .progress-bar {
    background-color: #374151;
  }
  
  .status-text {
    color: #d1d5db;
  }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  .progress-fill::after {
    animation: none;
  }
  
  .status-text {
    animation: none !important;
  }
  
  .task-status-panel {
    animation: none;
  }
}