/* Chatbot Widget Styles - Non-critical CSS */
/* This file is loaded asynchronously to avoid blocking render */

/* Custom animations */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fade-in 0.5s ease-out;
}

.animate-slide-in-right {
  animation: slide-in-right 0.4s ease-out;
}

.animate-slide-in-left {
  animation: slide-in-left 0.4s ease-out;
}

/* Widget positioning */
#chatbot-widget {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 9999 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #chatbot-widget {
    bottom: 16px !important;
    right: 16px !important;
  }
  
  #chat-window {
    width: calc(100vw - 32px) !important;
    height: 70vh !important;
    max-height: 500px !important;
    bottom: 80px !important;
    right: -8px !important;
  }
}

/* Chat window styles */
#chat-window {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#chat-messages {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Eye avatar hover effects */
#widget-trigger:hover #eyeAvatar {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transform: scale(1.05);
}

#widget-trigger:active #eyeAvatar {
  transform: scale(0.95);
}

/* Chat input focus effects */
#chat-input:focus {
  border-color: #3b82f6 !important;
  background: white !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
  transform: scale(1.02) !important;
}

#chat-input:not(:focus) {
  border-color: #d1d5db !important;
  background: #f9fafb !important;
  box-shadow: none !important;
  transform: scale(1) !important;
}

/* Send button hover effects */
#send-button:hover {
  background: #2563eb !important;
  transform: scale(1.1) rotate(12deg) !important;
}

#send-button:not(:hover) {
  background: #3b82f6 !important;
  transform: scale(1) rotate(0deg) !important;
}

#send-button:active {
  transform: scale(0.95) !important;
}

/* Typing indicator animation */
#typing-indicator span:nth-child(1) {
  animation: bounce 1s infinite;
}

#typing-indicator span:nth-child(2) {
  animation: bounce 1s infinite;
  animation-delay: 0.2s;
}

#typing-indicator span:nth-child(3) {
  animation: bounce 1s infinite;
  animation-delay: 0.4s;
}

/* Online status pulse */
.online-indicator {
  animation: pulse 2s infinite;
}

/* Message hover effects */
.chat-message:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Smooth transitions for all interactive elements */
#chatbot-widget * {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #chat-window {
    border: 2px solid #000;
    backdrop-filter: none;
    background: #fff;
  }
  
  #chat-input {
    border: 2px solid #000 !important;
  }
  
  #send-button {
    background: #000 !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #chatbot-widget *,
  .animate-fade-in,
  .animate-slide-in-right,
  .animate-slide-in-left {
    animation: none !important;
    transition: none !important;
  }
  
  #widget-trigger:hover #eyeAvatar {
    transform: none;
  }
}