/* AI Chatbot Widget Styles */
.chatbot-widget {
  position: fixed;
  bottom: 60px;
  right: 40px;
  z-index: 1000;
  font-family: inherit;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #03bfcb 0%, #0288a3 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(3, 191, 203, 0.3);
  transition: all 0.3s ease;
  color: white;
  position: relative;
  animation: chatbotPulse 2s infinite;
  overflow: hidden;
  box-sizing: border-box;
}

@keyframes chatbotPulse {
  0% {
    box-shadow: 0 4px 20px rgba(3, 191, 203, 0.3);
  }
  25% {
    box-shadow: 0 4px 20px rgba(3, 191, 203, 0.3),
      0 0 0 8px rgba(3, 191, 203, 0.2), 0 0 0 16px rgba(3, 191, 203, 0.1);
  }
  50% {
    box-shadow: 0 4px 20px rgba(3, 191, 203, 0.3),
      0 0 0 12px rgba(3, 191, 203, 0.15), 0 0 0 24px rgba(3, 191, 203, 0.08),
      0 0 0 36px rgba(3, 191, 203, 0.04);
  }
  75% {
    box-shadow: 0 4px 20px rgba(3, 191, 203, 0.3),
      0 0 0 16px rgba(3, 191, 203, 0.1), 0 0 0 32px rgba(3, 191, 203, 0.05),
      0 0 0 48px rgba(3, 191, 203, 0.02);
  }
  100% {
    box-shadow: 0 4px 20px rgba(3, 191, 203, 0.3);
  }
}

.chatbot-icon,
.chatbot-close {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.chatbot-icon svg,
.chatbot-close svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0;
  padding: 0;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(3, 191, 203, 0.4);
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.chatbot-header {
  background: linear-gradient(135deg, #03bfcb 0%, #0288a3 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar img {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-info {
  flex: 1;
}

.chatbot-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-info p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s infinite;
}

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

.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

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

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

.user-message {
  flex-direction: row-reverse;
  align-items: flex-start;
}

.message-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bot-message .message-avatar img {
  background: #03bfcb;
  color: white;
}

.user-message .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #6c757d;
  color: white;
}

.message-content {
  max-width: 80%;
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.user-message .message-content {
  background: #03bfcb;
  color: white;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.user-message .message-time {
  text-align: left;
}

.chatbot-quick-actions {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-action-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #495057;
}

.quick-action-btn:hover {
  background: #03bfcb;
  color: white;
  border-color: #03bfcb;
}

.chatbot-input-container {
  background: white;
  border-top: 1px solid #e9ecef;
  padding: 16px 20px;
}

.chatbot-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e9ecef;
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chatbot-input:focus {
  border-color: #03bfcb;
  box-shadow: 0 0 0 3px rgba(3, 191, 203, 0.1);
}

.chatbot-send-btn {
  width: 40px;
  height: 40px;
  background: #03bfcb;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
  background: #0288a3;
  transform: scale(1.05);
}

.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #6c757d;
}

.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #03bfcb;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .chatbot-widget {
    bottom: 80px; /* Moved up to avoid overlap with back-to-top button */
    right: 15px;
  }

  .chatbot-window {
    width: calc(100vw - 30px);
    height: 450px;
    right: -15px;
    bottom: 100px; /* Adjusted to account for new button position */
  }

  .chatbot-toggle {
    width: 50px;
    height: 50px;
  }
}
