/**
 * Background Job Modal
 * Reusable modal component for displaying background job progress
 */

/* Modal Overlay - Use high specificity to override existing modal styles */
#background-job-modal.background-job-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.3s ease-out;
    padding: 0 !important;
    margin: 0 !important;
}

#background-job-modal.background-job-modal.active {
    display: flex !important;
}

#background-job-modal .modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modal Content */
#background-job-modal .background-job-content {
    position: relative !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    max-width: 500px !important;
    width: 90% !important;
    padding: 0 !important;
    animation: slideUp 0.3s ease-out;
    z-index: 10001 !important;
    margin: auto !important;
}

/* Header */
#background-job-modal .background-job-header {
    text-align: center !important;
    padding: 2rem 2rem 1rem 2rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

#background-job-modal .background-job-header .job-icon {
    width: 60px !important;
    height: 60px !important;
    margin: 0 auto 1rem auto !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

#background-job-modal .background-job-header .job-icon i {
    font-size: 28px !important;
    color: #ffffff !important;
}

#background-job-modal .background-job-header h3,
#background-job-modal #background-job-title {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
}

/* Body */
#background-job-modal .background-job-body {
    padding: 1.5rem 2rem !important;
}

#background-job-modal #background-job-message {
    text-align: center !important;
    color: #6b7280 !important;
    font-size: 1rem !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.5 !important;
}

/* Progress Container */
#background-job-modal .progress-container {
    margin-bottom: 1rem !important;
}

#background-job-modal .progress-bar-wrapper {
    width: 100% !important;
    height: 8px !important;
    background-color: #e5e7eb !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    margin-bottom: 0.5rem !important;
    position: relative !important;
}

#background-job-modal .progress-bar-fill,
#background-job-modal #background-job-progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 999px !important;
    transition: width 0.3s ease-out !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Progress bar shimmer effect */
#background-job-modal .progress-bar-fill::before,
#background-job-modal #background-job-progress-bar::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: shimmer 2s infinite;
}

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

#background-job-modal #background-job-progress-text {
    display: block !important;
    text-align: right !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #667eea !important;
}

#background-job-modal #background-job-status,
#background-job-modal .background-job-status {
    text-align: center !important;
    font-size: 0.875rem !important;
    color: #9ca3af !important;
    margin: 0 !important;
}

/* Footer */
#background-job-modal .background-job-footer {
    padding: 1.5rem 2rem 2rem 2rem !important;
    background: #f9fafb !important;
    border-radius: 0 0 16px 16px !important;
    text-align: center !important;
}

#background-job-modal .notification-info {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
    color: #6b7280 !important;
    font-size: 0.9rem !important;
}

#background-job-modal .notification-info i {
    color: #667eea !important;
    font-size: 1rem !important;
}

/* Pulse animation for bell icon */
#background-job-modal .pulse-icon {
    animation: pulse 2s ease-in-out infinite;
}

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

#background-job-modal #continue-background-btn {
    width: 100% !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #6b7280 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

#background-job-modal #continue-background-btn:hover {
    background-color: #4b5563 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3) !important;
}

#background-job-modal #continue-background-btn:active {
    transform: translateY(0) !important;
}

#background-job-modal .auto-dismiss-text {
    margin: 0.75rem 0 0 0 !important;
    text-align: center !important;
}

#background-job-modal .auto-dismiss-text small {
    color: #9ca3af !important;
    font-size: 0.8rem !important;
}

#background-job-modal #dismiss-countdown {
    font-weight: 600 !important;
    color: #667eea !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    #background-job-modal .background-job-content {
        width: 95% !important;
        margin: 1rem !important;
    }
    
    #background-job-modal .background-job-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem !important;
    }
    
    #background-job-modal .background-job-header h3,
    #background-job-modal #background-job-title {
        font-size: 1.25rem !important;
    }
    
    #background-job-modal .background-job-body {
        padding: 1rem 1.5rem !important;
    }
    
    #background-job-modal .background-job-footer {
        padding: 1rem 1.5rem 1.5rem 1.5rem !important;
    }
    
    #background-job-modal .background-job-header .job-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    #background-job-modal .background-job-header .job-icon i {
        font-size: 24px !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #background-job-modal .background-job-content {
        background: #1f2937 !important;
    }
    
    #background-job-modal .background-job-header {
        border-bottom-color: #374151 !important;
    }
    
    #background-job-modal .background-job-header h3,
    #background-job-modal #background-job-title {
        color: #f9fafb !important;
    }
    
    #background-job-modal #background-job-message {
        color: #d1d5db !important;
    }
    
    #background-job-modal .progress-bar-wrapper {
        background-color: #374151 !important;
    }
    
    #background-job-modal #background-job-status,
    #background-job-modal .background-job-status {
        color: #9ca3af !important;
    }
    
    #background-job-modal .background-job-footer {
        background: #111827 !important;
    }
    
    #background-job-modal .notification-info {
        color: #d1d5db !important;
    }
}

