/* Chatbot Styles */
.chatbot-container {
  position: fixed;
  bottom: 158px;
  right: 20px;
  z-index: 999;
  font-family: 'Inter', sans-serif;
}

.chatbot-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.chatbot-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.chatbot-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.chatbot-toggle:hover::before {
  left: 100%;
}

.chatbot-toggle.active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
}

.chatbot-toggle svg {
  transition: transform 0.3s ease;
}

.chatbot-toggle.active svg {
  transform: rotate(180deg);
}

.chatbot-modal {
  position: fixed;
  bottom: 210px;
  right: 20px;
  width: 380px;
  height: 400px;
  max-height: calc(100vh - 300px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-title h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.chatbot-status {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chatbot-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
  line-height: 1;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.message {
  display: flex;
  max-width: 85%;
  animation: messageSlide 0.3s ease-out;
}

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

.user-message {
  align-self: flex-end;
  margin-left: auto;
}

.bot-message {
  align-self: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.user-message .message-content {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.bot-message .message-content {
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-content p {
  margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
}

.message-content li {
  margin: 0.25rem 0;
}

.message-content strong {
  font-weight: 600;
}

.message-content em {
  font-style: italic;
}

.typing-indicator .message-content {
  padding: 1rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chatbot-input-container {
  display: flex;
  padding: 1rem;
  background: white;
  border-top: 1px solid #e5e7eb;
  gap: 0.5rem;
  flex-shrink: 0;
}

.chatbot-input-container input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.chatbot-input-container input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chatbot-input-container input::placeholder {
  color: #9ca3af;
}

.chatbot-send {
  padding: 0.75rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

.chatbot-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.chatbot-send:active {
  transform: translateY(0);
}

.chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatbot-container {
    bottom: 145px;
    right: 15px;
  }
  
  .chatbot-toggle {
    width: 44px;
    height: 44px;
  }
  
  .chatbot-modal {
    width: calc(100vw - 30px);
    height: 60vh;
    max-height: calc(100vh - 200px);
    bottom: 155px;
    right: 15px;
    max-width: 400px;
  }
  
  .chatbot-header {
    padding: 0.875rem;
  }
  
  .chatbot-messages {
    padding: 0.75rem;
  }
  
  .message {
    max-width: 90%;
  }
  
  .message-content {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .chatbot-input-container {
    padding: 0.75rem;
  }
  
  .chatbot-input-container input {
    padding: 0.625rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    bottom: 138px;
    right: 10px;
  }
  
  .chatbot-modal {
    width: calc(100vw - 20px);
    height: 65vh;
    max-height: calc(100vh - 180px);
    bottom: 148px;
    right: 10px;
  }
  
  .chatbot-toggle {
    width: 40px;
    height: 40px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chatbot-toggle {
    border: 2px solid #000;
  }
  
  .bot-message .message-content {
    border: 2px solid #000;
  }
  
  .chatbot-input-container input {
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .chatbot-modal,
  .message,
  .chatbot-toggle,
  .chatbot-send {
    transition: none;
    animation: none;
  }
  
  .typing-dots span {
    animation: none;
  }
  
  .chatbot-status::before {
    animation: none;
  }
}