/* Error Safety UI Styles - Dark Theme */

/* Loading State */
.ai-loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  justify-content: center;
  min-height: 80px;
}

.loading-spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid #334155;
  border-top: 2px solid #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* AI Error Badge */
.ai-error-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-radius: 6px;
  font-size: 12px;
  color: white;
}

.ai-error-badge span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Retry Button */
.retry-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.retry-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.retry-btn:active {
  transform: translateY(0);
}

/* Error Toast */
@keyframes slideInFromBottom {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideOutToBottom {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}

.error-toast {
  animation: slideInFromBottom 0.3s ease-out;
}

.error-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.error-message {
  line-height: 1.4;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  margin: 20px;
  min-height: 400px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.empty-state h3 {
  color: #e2e8f0;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.empty-state > p {
  color: #94a3b8;
  font-size: 16px;
  margin: 0 0 32px 0;
  max-width: 400px;
}

.detection-tips {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f1729 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 24px 32px;
  text-align: left;
  max-width: 450px;
}

.detection-tips h4 {
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.detection-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detection-tips li {
  color: #94a3b8;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detection-tips li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #6366f1;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Camera Error Notification - Simple Toast */
.camera-error-notification,
.microphone-error-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 400px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.error-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.error-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.error-details {
  flex: 1;
  min-width: 0;
}

.error-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.error-message {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 12px;
}

.error-actions {
  display: flex;
  gap: 8px;
}

.retry-btn,
.dismiss-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  white-space: nowrap;
}

.retry-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.retry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.dismiss-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Responsive */
@media (max-width: 768px) {
  .camera-error-notification,
  .microphone-error-notification {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    padding: 14px 16px;
  }

  .error-content {
    gap: 10px;
  }

  .error-icon {
    font-size: 20px;
  }

  .error-title {
    font-size: 13px;
  }

  .error-message {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .retry-btn,
  .dismiss-btn {
    padding: 5px 12px;
    font-size: 11px;
  }

  .empty-state {
    padding: 40px 24px;
    min-height: 300px;
  }

  .empty-icon {
    font-size: 48px;
  }

  .empty-state h3 {
    font-size: 20px;
  }

  .empty-state > p {
    font-size: 14px;
  }

  .detection-tips {
    padding: 20px 24px;
  }

  .error-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}
