/*
 * Utility classes and animations.
 * Helper classes for common patterns and reusable animations.
 */

/* =============================================================================
   Cursor Utilities
   ============================================================================= */

.cursor-pointer {
  cursor: pointer;
}

/* =============================================================================
   Height Utilities
   ============================================================================= */

.chart-height-md {
  position: relative;
  height: 220px;
}

.progress-thin {
  height: 3px;
}

/* =============================================================================
   Animations
   ============================================================================= */

/* Pulse animation for live indicators */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Spin animation for loading spinners */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Highlight animation for new items */
@keyframes highlightNew {
  0% { background-color: var(--warning-highlight, #fff3cd); }
  100% { background-color: transparent; }
}

/* =============================================================================
   Live Indicator
   ============================================================================= */

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--success-color, #28a745);
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success-color, #28a745);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* =============================================================================
   Header Icon with Loading Spinner
   ============================================================================= */

.header-icon-container {
  position: relative;
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
}

.header-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  transition: opacity var(--transition-normal, 0.2s ease-in-out);
}

.header-icon-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--text-secondary, #6c757d);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-sizing: border-box;
}

/* =============================================================================
   New Item Highlight
   ============================================================================= */

.new-run-highlight {
  animation: highlightNew 3s ease-out;
}

/* =============================================================================
   Mobile Responsive Adjustments
   ============================================================================= */

@media (max-width: 767.98px) {
  .live-indicator span {
    font-size: 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .live-indicator {
    margin-top: 0.25rem;
  }

  .live-indicator span {
    font-size: 0.7rem;
  }
}
