/* WebSocket Real-Time Progress Styles */

/* Compact Horizontal Progress UI */
#progressContainer {
  margin: 20px 0 !important;
  padding: 16px 20px !important;
  background: linear-gradient(135deg, #1e2936 0%, #2a3f54 100%) !important;
  border-radius: 8px !important;
  border: 2px solid var(--accent-primary) !important;
  box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.2) !important;
  height: auto !important;
  width: 100% !important;
  display: block !important;
}

@keyframes borderPulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.2);
  }
  50% {
    box-shadow: 0 4px 30px rgba(var(--accent-primary-rgb), 0.4);
  }
}

#progressContainer .progress-step-compact {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 6px 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
  opacity: 0.5 !important;
  transform: scale(1) !important;
}

#progressContainer .progress-step-compact .status-icon {
  font-size: 1.1em !important;
  transition: transform 0.3s ease !important;
}

#progressContainer .progress-step-compact:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-2px) scale(1.05) !important;
}

/* Animated progress bar */
#mainProgressBar {
  position: relative !important;
  overflow: hidden !important;
  transition: width 0.6s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.3s ease !important;
  transform-origin: left center !important;
}

#mainProgressBar::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
}

@keyframes shimmer {
  0% { 
    left: -100%; 
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% { 
    left: 200%; 
    opacity: 0;
  }
}

#progressContainer #timeEstimate {
  font-size: 16px !important;
  color: var(--accent-primary) !important;
  font-weight: bold !important;
  font-family: 'Courier New', monospace !important;
  text-align: center !important;
  padding: 10px !important;
  background: rgba(var(--accent-primary-rgb), 0.1) !important;
  border-radius: 6px !important;
  height: auto !important;
}

#progressContainer .progress-steps {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
}

#progressContainer .progress-step {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px !important;
  padding: 15px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.3s ease !important;
  height: auto !important;
}

#progressContainer .progress-step:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateX(5px) !important;
}

#progressContainer .step-header {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 10px !important;
}

#progressContainer .status-icon {
  font-size: 24px !important;
  min-width: 30px !important;
  text-align: center;
  transition: all 0.3s ease;
}

#progressContainer .status-icon.pending {
  filter: grayscale(100%) !important;
  opacity: 0.5 !important;
}

#progressContainer .status-icon.running {
  opacity: 1 !important;
}

#progressContainer .status-icon.completed {
  animation: checkmark 0.5s ease !important;
}

#progressContainer .status-icon.error {
  animation: shake 0.5s ease !important;
}

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

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.step-name {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.status-text {
  font-size: 14px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  min-width: 80px;
  text-align: center;
}

.status-text.running {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.status-text.completed {
  background: rgba(var(--accent-primary-rgb), 0.2);
  color: var(--accent-primary);
}

.status-text.error {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

@keyframes pulse-text {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(var(--accent-primary-rgb), 1) 0%, rgba(var(--accent-primary-rgb), 0.7) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

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

/* Dark theme adjustments */
body.dark-theme .progress-container {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border-color: var(--accent-primary);
}

/* Responsive design */
@media (max-width: 768px) {
  .progress-container {
    padding: 20px;
  }
  
  .step-header {
    flex-wrap: wrap;
  }
  
  .step-name {
    flex-basis: 100%;
    margin-bottom: 8px;
  }
  
  .status-text {
    margin-left: auto;
  }
}

/* White theme overrides */
body.white-theme .progress-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border: 2px solid var(--accent-primary);
  box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.2);
}

body.white-theme #timeEstimate {
  color: #2e7d32;
  background: rgba(76, 175, 80, 0.1);
}

body.white-theme .progress-step {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.white-theme .step-name {
  color: #333;
}

body.white-theme .progress-bar {
  background: linear-gradient(90deg, #4caf50 0%, #2e7d32 100%);
}

/* ============================================
   DASHBOARD VISUAL IMPACT ANIMATIONS
   ============================================ */

/* Score gauge drawing animation */
@keyframes drawGauge {
  from {
    stroke-dasharray: 0 364.42;
  }
}

@keyframes drawGaugeMini {
  from {
    stroke-dasharray: 0 251.33;
  }
}

/* Card entrance animation */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Score number count up effect */
@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Score glow pulse for attention */
@keyframes scoreGlow {
  0%, 100% {
    filter: drop-shadow(0 0 4px currentColor);
  }
  50% {
    filter: drop-shadow(0 0 12px currentColor);
  }
}

/* Subtle hover glow */
@keyframes hoverGlow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
}

/* Button shine sweep effect */
@keyframes buttonShine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* Staggered list item entrance */
@keyframes listItemSlide {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Pulsing attention border */
@keyframes attentionBorder {
  0%, 100% {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0 rgba(var(--accent-primary-rgb), 0.4);
  }
  50% {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(var(--accent-primary-rgb), 0.1);
  }
}

/* Dashboard animated score gauge */
.score-gauge-animated {
  animation: drawGauge 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.score-gauge-mini-animated {
  animation: drawGaugeMini 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Staggered mini score animations */
.mini-score-0 .score-gauge-mini-animated { animation-delay: 0s; }
.mini-score-1 .score-gauge-mini-animated { animation-delay: 0.1s; }
.mini-score-2 .score-gauge-mini-animated { animation-delay: 0.2s; }
.mini-score-3 .score-gauge-mini-animated { animation-delay: 0.3s; }
.mini-score-4 .score-gauge-mini-animated { animation-delay: 0.4s; }

/* Dashboard card entrance */
.dashboard-animate-in {
  animation: slideUpFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.dashboard-animate-in-delay-1 { animation-delay: 0.1s; }
.dashboard-animate-in-delay-2 { animation-delay: 0.2s; }
.dashboard-animate-in-delay-3 { animation-delay: 0.3s; }

/* Score text animation */
.score-text-animated {
  animation: countUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

/* Mini score hover effect */
.mini-score-container {
  transition: transform 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.mini-score-container:hover {
  transform: translateY(-4px) scale(1.05);
}

.mini-score-container:hover svg circle:last-of-type {
  filter: drop-shadow(0 0 8px currentColor);
}

/* Enhanced button with shine */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
}

.btn-shine:hover::after {
  animation: buttonShine 0.6s ease forwards;
}

/* Insight list item animation */
.insight-item {
  animation: listItemSlide 0.4s ease forwards;
  opacity: 0;
}

.insight-item:nth-child(1) { animation-delay: 0.1s; }
.insight-item:nth-child(2) { animation-delay: 0.15s; }
.insight-item:nth-child(3) { animation-delay: 0.2s; }
.insight-item:nth-child(4) { animation-delay: 0.25s; }
.insight-item:nth-child(5) { animation-delay: 0.3s; }

/* Attention-grabbing recommended fix card */
.recommended-fix-card {
  animation: attentionBorder 2s ease infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recommended-fix-card:hover {
  transform: translateY(-2px);
  animation-play-state: paused;
}

/* Score color classes for consistency */
.score-excellent { color: #10b981; }
.score-good { color: #3b82f6; }
.score-warning { color: #f59e0b; }
.score-poor { color: #ef4444; }

.score-bg-excellent { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.4); }
.score-bg-good { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.4); }
.score-bg-warning { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.4); }
.score-bg-poor { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); }

/* Light theme adjustments for dashboard animations */
body.white-theme .score-excellent { color: #059669; }
body.white-theme .score-good { color: #2563eb; }
body.white-theme .score-warning { color: #d97706; }
body.white-theme .score-poor { color: #dc2626; }

body.white-theme .score-bg-excellent { background: rgba(16, 185, 129, 0.1); }
body.white-theme .score-bg-good { background: rgba(59, 130, 246, 0.1); }
body.white-theme .score-bg-warning { background: rgba(245, 158, 11, 0.1); }
body.white-theme .score-bg-poor { background: rgba(239, 68, 68, 0.1); }
