/* AI Processing Animation Styles */
.ai-processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

.ai-processing-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
  position: relative;
  overflow: hidden;
}

.ai-processing-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 2s infinite;
}

.ai-processing-content {
  position: relative;
  z-index: 1;
}

/* AI Brain Animation */
.ai-brain-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
}

.ai-brain {
  position: relative;
  width: 100%;
  height: 100%;
}

.ai-brain-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, #ff6b6b, #ee5a24);
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.ai-neural-network {
  position: absolute;
  width: 100%;
  height: 100%;
}

.ai-neuron {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #4ecdc4;
  border-radius: 50%;
  /* Animation will be enabled after positioning */
  animation: none;
}

.ai-neuron.positioned {
  animation: neuronPulse 1.5s infinite;
}

/* Position neurons in a perfect circle around the brain core */
/* Positions will be calculated dynamically by JavaScript */

.ai-neuron-1 { animation-delay: 0s; }
.ai-neuron-2 { animation-delay: 0.3s; }
.ai-neuron-3 { animation-delay: 0.6s; }
.ai-neuron-4 { animation-delay: 0.9s; }
.ai-neuron-5 { animation-delay: 1.2s; }
.ai-neuron-6 { animation-delay: 1.5s; }

.ai-connections {
  position: absolute;
  width: 100%;
  height: 100%;
}

.ai-connection {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4ecdc4, transparent);
  animation: connectionFlow 2s infinite;
  transform-origin: left center;
}

/* Processing Text */
.ai-processing-title {
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ai-processing-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin-bottom: 30px;
  min-height: 24px;
  animation: typewriter 2s infinite;
}

/* Data Flow Animation */
.ai-data-flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ai-data-stream {
  position: absolute;
  width: 3px;
  height: 20px;
  background: linear-gradient(to bottom, transparent, #4ecdc4, transparent);
  animation: dataFlow 3s infinite linear;
}

.ai-data-stream-1 { left: 20%; animation-delay: 0s; }
.ai-data-stream-2 { left: 50%; animation-delay: 1s; }
.ai-data-stream-3 { left: 80%; animation-delay: 2s; }

/* Processing Steps */
.ai-processing-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.ai-step {
  flex: 1;
  padding: 0 10px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.ai-step.active {
  opacity: 1;
}

.ai-step-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  transition: all 0.3s ease;
}

.ai-step.active .ai-step-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.ai-step-icon i {
  color: white;
  font-size: 18px;
}

.ai-step-text {
  color: white;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Progress Indicator */
.ai-progress-container {
  position: relative;
}

.ai-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ai-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #44a08d);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* New shimmer/glow child element, to be added in HTML/JS as <div class="ai-progress-shimmer"></div> inside .ai-progress-fill */
.ai-progress-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: progressShimmer 2s infinite;
  pointer-events: none;
}

.ai-progress-text {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Success state styling */
.ai-processing-container.success {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  animation: successPulse 0.6s ease-out;
}

.ai-processing-container.success .ai-brain-core {
  background: radial-gradient(circle, #4ecdc4, #44a08d);
  animation: successGlow 0.6s ease-out;
}

/* Fade out animation */
.ai-processing-overlay.fade-out {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s ease-out;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes neuronPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes connectionFlow {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes typewriter {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes dataFlow {
  0% { top: -20px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes successGlow {
  0% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.5); }
  100% { box-shadow: 0 0 30px rgba(78, 205, 196, 0.8); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-processing-container {
    padding: 30px 20px;
    margin: 20px;
  }
  
  .ai-brain-container {
    width: 100px;
    height: 100px;
  }
  
  .ai-brain-core {
    width: 32px;
    height: 32px;
  }
  
  .ai-processing-title {
    font-size: 20px;
  }
  
  .ai-processing-subtitle {
    font-size: 14px;
  }
}
