/* Workflow Execution Indicators CSS */

/* Workflow indicator container */
.workflow-indicator {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.workflow-indicator:empty {
  display: none;
}

/* Spinning animation for running workflows */
@keyframes spin {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(360deg); 
  }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Fade out animation for completed workflows */
@keyframes fadeOut {
  0% { 
    opacity: 1; 
    transform: scale(1);
  }
  70% { 
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 0.3;
    transform: scale(0.95);
  }
  100% { 
    opacity: 0;
    transform: scale(0.9);
  }
}

.fade-out {
  animation: fadeOut 3s ease-out forwards;
}

/* Pulse animation for long-running workflows (>30s) */
@keyframes pulse {
  0%, 100% { 
    opacity: 1; 
  }
  50% { 
    opacity: 0.5; 
  }
}

.long-running {
  animation: pulse 2s ease-in-out infinite;
}

/* Bounce animation for new workflow start */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Badge styling adjustments for workflow indicators */
.workflow-indicator .badge {
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
  min-width: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.workflow-indicator .badge:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Different states */
.workflow-indicator .badge.bg-primary {
  background-color: #0d6efd !important;
}

.workflow-indicator .badge.bg-success {
  background-color: #198754 !important;
}

.workflow-indicator .badge.bg-danger {
  background-color: #dc3545 !important;
}

.workflow-indicator .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000;
}

/* Icon adjustments */
.workflow-indicator .bi {
  font-size: 0.875rem;
}

.workflow-indicator .bi-arrow-repeat {
  transform-origin: center;
}

/* Multiple workflows indicator */
.workflow-indicator .workflow-count {
  margin-left: 0.25rem;
  font-weight: bold;
}

/* Tooltip styling for workflow names */
.workflow-indicator[title] {
  position: relative;
}

/* Position indicators properly in task elements */
.task-element .workflow-indicator,
.task-item .workflow-indicator {
  position: relative;
  z-index: 10;
}

/* Ensure indicators are visible in collapsed tasks */
.accordion-button .workflow-indicator {
  margin-left: 0.75rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .workflow-indicator .badge {
    font-size: 0.7rem;
    padding: 0.2em 0.4em;
  }
  
  .workflow-indicator .bi {
    font-size: 0.75rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .workflow-indicator .badge {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
  
  .workflow-indicator .badge:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  }
}