/**
 * Prediction Status Monitoring Styles
 * CSS for video generation progress indicators
 */

/* Status Container */
.prediction-status-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.prediction-status-container.active {
    border-color: #007bff;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

/* Status Header */
.prediction-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Status Badges */
.prediction-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.prediction-status.status-starting {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.prediction-status.status-processing {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    animation: pulse-processing 2s infinite;
}

.prediction-status.status-succeeded {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.prediction-status.status-failed {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.prediction-status.status-canceled {
    background-color: #e2e3e5;
    color: #495057;
    border: 1px solid #d6d8db;
}

/* Pulse animation for processing status */
@keyframes pulse-processing {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Duration Display */
.prediction-duration {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* Progress Bar Container */
.prediction-progress-container {
    margin: 8px 0;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.prediction-progress-bar {
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #007bff, #0056b3);
    position: relative;
}

.prediction-progress-bar.processing {
    background: linear-gradient(90deg, #007bff, #0056b3, #007bff);
    background-size: 200% 100%;
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Progress Details */
.prediction-progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.prediction-progress {
    font-size: 0.8rem;
    font-style: italic;
    color: #6c757d;
}

.prediction-remaining {
    font-size: 0.75rem;
    color: #28a745;
    font-weight: 500;
}

/* Compact Mode */
.prediction-status-container.compact {
    padding: 8px;
    margin: 4px 0;
}

.prediction-status-container.compact .prediction-status-header {
    margin-bottom: 4px;
}

.prediction-status-container.compact .prediction-status {
    font-size: 0.75rem;
    padding: 2px 6px;
}

.prediction-status-container.compact .prediction-duration {
    font-size: 0.75rem;
    padding: 1px 4px;
}

/* Card Integration */
.video-card .prediction-status-container {
    margin: 8px 0 0 0;
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(4px);
}

.video-card.generating {
    position: relative;
    overflow: hidden;
}

.video-card.generating::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: card-shimmer 2s infinite;
    z-index: 1;
}

@keyframes card-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Overlay Mode */
.prediction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.prediction-overlay .prediction-status-container {
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .prediction-status-container {
        padding: 10px;
    }
    
    .prediction-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .prediction-progress-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .prediction-status {
        font-size: 0.8rem;
    }
    
    .prediction-duration {
        font-size: 0.8rem;
    }
}

/* Loading States */
.prediction-status-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.prediction-status-container.loading .prediction-progress {
    animation: text-pulse 1.5s infinite;
}

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

/* Success Animation */
.prediction-status-container.completed {
    animation: success-highlight 0.5s ease;
}

@keyframes success-highlight {
    0% { background-color: #f8f9fa; }
    50% { background-color: #d4edda; }
    100% { background-color: #f8f9fa; }
}

/* Error State */
.prediction-status-container.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.prediction-status-container.error .prediction-progress {
    color: #dc3545;
}

/* Notification Styles */
.prediction-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 350px;
    z-index: 9999;
    animation: slide-in-right 0.3s ease;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.prediction-notification.success {
    border-left: 4px solid #28a745;
}

.prediction-notification.error {
    border-left: 4px solid #dc3545;
}

.prediction-notification .notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prediction-notification .notification-close:hover {
    color: #495057;
}

/* Simplified Loading System */
.loading-dots span {
    animation: loading-dots-animation 1.5s infinite;
    font-size: 1.5rem;
    margin: 0 2px;
    opacity: 0.3;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.3s; }
.loading-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes loading-dots-animation {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Failure Overlay */
.failure-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 53, 69, 0.9);
    border-radius: 8px;
    z-index: 10;
}

.failure-overlay .text-white {
    text-align: center;
}

.failure-overlay .btn {
    margin-top: 12px;
}