/* ==================================================
   EXECUTION STATUS STYLES
   Real-time execution tracking and status badges
   ================================================== */

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-base);
}

.status-badge-icon {
    font-size: var(--text-sm);
}

/* Queued Status - Orange with bounce animation */
.status-badge.queued {
    background: rgba(255, 184, 77, 0.15);
    border: 1px solid rgba(255, 184, 77, 0.3);
    color: var(--status-queued);
}

.status-badge.queued .status-badge-icon {
    animation: bounce 1s ease-in-out infinite;
}

/* Processing Status - Teal with pulse glow */
.status-badge.processing {
    background: rgba(0, 212, 170, 0.15);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--status-processing);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 212, 170, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 212, 170, 0.6), 0 0 40px rgba(0, 212, 170, 0.3);
    }
}

/* Completed Status - Green with subtle glow */
.status-badge.completed {
    background: rgba(20, 241, 149, 0.15);
    border: 1px solid rgba(20, 241, 149, 0.3);
    color: var(--status-completed);
    box-shadow: 0 0 15px rgba(20, 241, 149, 0.2);
}

/* Failed Status - Red with emphasis */
.status-badge.failed {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: var(--status-failed);
}

/* Cancelled Status - Gray muted */
.status-badge.cancelled {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--status-cancelled);
}

/* ===== Progress Bars ===== */

.execution-progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.execution-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-tertiary) 0%, var(--color-primary) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on progress bar */
.execution-progress-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 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Indeterminate progress (for queued state) */
.execution-progress-fill.indeterminate {
    width: 40% !important;
    animation: indeterminate-slide 2s ease-in-out infinite;
}

@keyframes indeterminate-slide {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(250%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ===== Execution Monitor Card (Fixed Bottom-Right) ===== */

.execution-monitor-card {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 400px;
    max-height: 600px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), var(--shadow-glow-primary);
    padding: var(--space-lg);
    z-index: var(--z-fixed);
    animation: slide-in-bottom 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slide-in-bottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.execution-monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.execution-monitor-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.execution-monitor-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.execution-monitor-close:hover {
    color: var(--text-primary);
}

.execution-monitor-list {
    flex: 1;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

/* Individual Execution Item */
.execution-item {
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}

.execution-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-primary);
}

.execution-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.execution-item-agent-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.execution-item-progress {
    margin-bottom: var(--space-sm);
}

.execution-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.execution-item-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Queue Position Indicator */
.queue-position {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 184, 77, 0.1);
    border: 1px solid rgba(255, 184, 77, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--status-queued);
}

.queue-position-icon {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Execution Result Display */
.execution-result {
    padding: var(--space-lg);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-top: var(--space-lg);
}

.execution-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.execution-result-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.execution-result-content {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
}

.execution-result-image,
.execution-result-video {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.execution-result-text {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.execution-result-json {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

/* Execution Actions */
.execution-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.execution-action-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.execution-action-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-primary);
}

.execution-action-btn.primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-tertiary) 100%);
    border: none;
    color: var(--text-inverse);
    box-shadow: 0 0 15px rgba(20, 241, 149, 0.3);
}

.execution-action-btn.primary:hover {
    box-shadow: var(--shadow-glow-primary);
    transform: translateY(-2px);
}

/* Responsive Execution Monitor */
@media (max-width: 768px) {
    .execution-monitor-card {
        width: calc(100% - var(--space-lg) * 2);
        bottom: var(--space-md);
        right: var(--space-md);
        max-height: 400px;
    }
    
    .execution-result {
        padding: var(--space-md);
    }
    
    .execution-actions {
        flex-direction: column;
    }
    
    .execution-action-btn {
        width: 100%;
    }
}

/* Processing Spinner */
.processing-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 212, 170, 0.3);
    border-top-color: var(--status-processing);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
