#chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #0078d7;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

#chatbot-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  height: 500px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(calc(100% + 90px));
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 2147483646;
}

#chatbot-widget.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#chatbot-header {
  background-color: #0078d7;
  color: white;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  position: relative;
}

#chatbot-header #chatbot-close,
#chatbot-header #chatbot-clear,
#chatbot-header #chatbot-debug {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#chatbot-header #chatbot-close:hover,
#chatbot-header #chatbot-clear:hover,
#chatbot-header #chatbot-debug:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

#chatbot-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background-color: #f9f9f9;
}

.chatbot-msg {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
}

.chatbot-msg.user {
  background-color: #0078d7;
  color: white;
  margin-left: auto;
  text-align: right;
  font-size: 12px;
}

.chatbot-msg.bot {
  background-color: #e1e1e1;
  color: #333;
  margin-right: auto;
  font-size: 12px;
  line-height: 1.4;
}

.chatbot-msg.bot h1, .chatbot-msg.bot h2, .chatbot-msg.bot h3 {
  font-size: 12px;
  font-weight: bold;
  margin: 0.3em 0;
  color: #333;
}

.chatbot-msg.bot p {
  font-size: 12px;
  margin: 0.3em 0;
  line-height: 1.4;
}

.chatbot-msg.bot ul, .chatbot-msg.bot ol {
  font-size: 12px;
  margin: 0.3em 0;
  padding-left: 1.2em;
}

.chatbot-msg.bot li {
  font-size: 12px;
  margin: 0.1em 0;
}

.chatbot-msg.bot code {
  background-color: #f4f4f4;
  padding: 1px 3px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.chatbot-msg.bot pre {
  background-color: #f4f4f4;
  padding: 6px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 0.3em 0;
  font-size: 12px;
}

.chatbot-msg.bot pre code {
  background: none;
  padding: 0;
  font-size: 12px;
}

.chatbot-msg.bot blockquote {
  border-left: 3px solid #0078d7;
  margin: 0.3em 0;
  padding-left: 0.8em;
  color: #666;
  font-size: 12px;
}

.chatbot-msg.bot strong {
  font-weight: bold;
  font-size: 12px;
}

.chatbot-msg.bot em {
  font-style: italic;
  font-size: 12px;
}

/* Typing cursor effect */
.chatbot-msg.bot::after {
  content: '';
  animation: none;
}

.chatbot-msg.bot.typing::after {
  content: '▊';
  animation: blink 1s infinite;
  color: #0078d7;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Chatbot Input Row */
#chatbot-input-row {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
}

#chatbot-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
}

#chatbot-send {
  background-color: #0078d7;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  margin-left: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#chatbot-send:hover {
  background-color: #005bb5;
}

.typing-cursor {
  animation: blink 1s infinite;
  color: #0078d7;
  font-weight: bold;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
