/* progress.css - Progress bar and status enhancements */

/* =========================
   Progress Container
========================= */
.progress-container {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 14px;
}

.progress-percent {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 16px;
  min-width: 45px;
  text-align: right;
}

/* =========================
   Progress Bar
========================= */
.progress-bar-wrapper {
  position: relative;
  height: 32px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.progress-bar {
  height: 100%;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #295237 0%, #55823B 100%);
  border-radius: 16px;
  transition: width 0.4s ease-out;
  position: relative;
  overflow: hidden;
}

/* Animated shimmer effect */
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* =========================
   Progress Details
========================= */
.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
}

.progress-detail {
  font-weight: 500;
}

.progress-eta {
  font-style: italic;
  color: #94a3b8;
}

/* =========================
   Status States
========================= */
.progress-container.status-uploading .progress-bar-fill {
  background: linear-gradient(90deg, #295237 0%, #55823B 100%);
}

.progress-container.status-processing .progress-bar-fill {
  background: linear-gradient(90deg, #295237 0%, #55823B 100%);
}

.progress-container.status-complete .progress-bar-fill {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.progress-container.status-error .progress-bar-fill {
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

/* =========================
   Status Box Enhancements
========================= */
.status-box {
  min-height: 280px;
  max-height: 400px;
  white-space: pre-wrap;
  overflow-y: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #f8f9fa;
  color: #1f2937;
  padding: 12px;
  border-radius: 6px;
}

.status-box:empty::before {
  content: 'Waiting for job to start...';
  color: #94a3b8;
  font-style: italic;
}

/* =========================
   Action Buttons
========================= */
.actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================
   Timestamp Styling
========================= */
.log-timestamp {
  color: #94a3b8;
  font-weight: 600;
  margin-right: 8px;
}

.log-success {
  color: #2bd61c;
  font-weight: 600;
}

.log-error {
  color: #dc2626;
  font-weight: 600;
}

.log-info {
  color: #295237;
  font-weight: 600;
}

/* =========================
   Pulse Animation for Active State
========================= */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(41, 82, 55, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(41, 82, 55, 0);
  }
}

.progress-container.status-processing {
  animation: pulse-glow 2s infinite;
}

/* =========================
   Responsive Adjustments
========================= */
@media (max-width: 768px) {
  .progress-container {
    padding: 12px;
  }
  
  .progress-bar-wrapper {
    height: 28px;
  }
  
  .progress-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .progress-percent {
    align-self: flex-end;
  }
  
  .progress-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .actions-row .btn {
    width: 100%;
  }
}

/* =========================
   Success Checkmark Animation
========================= */
@keyframes checkmark {
  0% {
    transform: scale(0) rotate(45deg);
  }
  50% {
    transform: scale(1.2) rotate(45deg);
  }
  100% {
    transform: scale(1) rotate(45deg);
  }
}

.progress-container.status-complete .progress-label::before {
  content: '✓ ';
  color: #059669;
  font-weight: 700;
  display: inline-block;
  animation: checkmark 0.4s ease-out;
}

/* =========================
   Error Icon Animation
========================= */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.progress-container.status-error .progress-label::before {
  content: '✗ ';
  color: #dc2626;
  font-weight: 700;
  display: inline-block;
  animation: shake 0.4s ease-out;
}

/* =========================
   Loading Dots Animation
========================= */
@keyframes loading-dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.progress-label.loading::after {
  content: '';
  animation: loading-dots 1.5s infinite;
}