/* Chatbot Widget Styles */
#chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#chatbot-toggle-btn {
  background: white;
  color: #333;
  border: 1.5px solid #e2e8f0;
  border-radius: 50px;
  width: auto;
  height: auto;
  padding: 6px 16px 6px 6px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(79,70,229,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), box-shadow 0.22s ease;
}

#chatbot-toggle-btn:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18), 0 4px 16px rgba(79,70,229,0.25);
}

@keyframes chatbot-spin {
  to { transform: rotate(360deg); }
}

#chatbot-toggle-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

#chatbot-window {
  display: none;
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 32px);
  height: 500px;
  max-height: 75vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

@media (max-width: 480px) {
  #chatbot-widget {
    right: 12px;
    bottom: 80px;
  }
  #chatbot-window {
    width: calc(100vw - 24px);
    right: 0;
    bottom: 70px;
  }
}

#chatbot-window.open {
  display: flex;
}

#chatbot-header {
  background: #4f46e5;
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.1rem;
}

#chatbot-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

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

.chatbot-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chatbot-message.user {
  align-self: flex-end;
  background: #4f46e5;
  color: white;
  border-bottom-right-radius: 4px;
}

.chatbot-message.assistant {
  align-self: flex-start;
  background: white;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.chatbot-message p {
  margin: 0 0 8px 0;
}
.chatbot-message p:last-child {
  margin: 0;
}
.chatbot-message ul, .chatbot-message ol {
  margin: 0 0 8px 0;
  padding-left: 20px;
}
.chatbot-message a {
  color: #4f46e5;
}

#chatbot-input-area {
  display: flex;
  padding: 12px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

#chatbot-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: #4f46e5;
}

#chatbot-send-btn {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#chatbot-send-btn:hover {
  background: #4338ca;
}
#chatbot-send-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

#chatbot-send-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

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

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