/* ====== Chatbot Wrapper ====== */
.my-ai-chatbot-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;        /* limit width on desktop */
  height: 500px;           /* fixed height for demo */
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  overflow: hidden;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ====== Header ====== */
.my-ai-chatbot-header {
  background: var(--chatbot-header-color);
  /* background: #4a90e2; */
  color: #000000;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.my-ai-chatbot-title {
  font-weight: 600;
  font-size: 16px;
}

.my-ai-chatbot-toggle {
  background: var(--chatbot-toggle-color);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.my-ai-chatbot-toggle:hover {
  background: var(--chatbot-toggle-color);
  transform: scale(1.05); /* small grow effect */
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.my-ai-chatbot-toggle:focus {
  background: var(--chatbot-toggle-color);
  transform: scale(1.05); /* small grow effect */
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
/* --------Round button bottom-right--------- */
#my-ai-chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--chatbot-toggle-color);
  color: #fff;
  border: none;
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#my-ai-chatbot-toggle:hover {
  background: var(--chatbot-toggle-color);
  transform: scale(1.05);
}

#my-ai-chatbot-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--chatbot-toggle-color, #4a90e2);
  opacity: 0.5;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}
/* “Hi!” pill */
#my-ai-chatbot-toggle #my-ai-chatbot-hint {
  position: absolute;
  bottom: 75px;            /* sits above the button */
  right: 0;
  /* background: var(--chatbot-toggle-color);  */
  color: #000000;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  opacity: 1;             /* always visible */
  transform: translateY(0);
}


/* ====== Chat Window ====== */
.my-ai-chatbot-window {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--chatbot-window-color);
}

.my-ai-chatbot-message {
  max-width: 80%;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 14px;
  word-wrap: break-word;
}

/* Bot message */
.my-ai-chatbot-message.bot {
  background: #e8f0fe;
  color: #333;
  border-top-left-radius: 0;
  align-self: flex-start;
}

/* User message */
.my-ai-chatbot-message.user {
  background: var(--chatbot-header-color);
  color: #000000;
  border-top-right-radius: 0;
  align-self: flex-end;
  margin-left: auto;
}

/* ====== Input Area ====== */
.my-ai-chatbot-input-area {
  display: flex;
  padding: 8px;
  background: var(--chatbot-input-color);
  /* border-top: 1px solid var(--chatbot-button-color); */
}

.my-ai-chatbot-input-area input[type="text"] {
  background: #e8f0fe;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.my-ai-chatbot-input-area input[type="text"]:focus {
  border-color: #405061;
}

.my-ai-chatbot-send-btn {
  margin-left: 8px;
  padding: 10px 16px;
  background: var(--chatbot-button-color);
  border: none;
  color: #000000;
  border-radius: 8px;
  cursor: pointer;
   /* animate both transform & background */
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.my-ai-chatbot-send-btn:hover {
  background: var(--chatbot-button-color);
  transform: scale(1.05); /* small grow effect */
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.my-ai-chatbot-send-btn:focus {
  background: var(--chatbot-button-color);
  outline: none;
  box-shadow: none;
}


/* ====== Scrollbar styling ====== */
.my-ai-chatbot-window::-webkit-scrollbar {
  width: 6px;
}
.my-ai-chatbot-window::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* ====== Responsive Adjustments ====== */
@media (max-width: 480px) {
  .my-ai-chatbot-wrapper {
    width: 100%;
    height: 400px;
  }
}

/* color code */
#my-ai-chatbot .chatbot-header {
  background-color: var(--chatbot-color);
}
#my-ai-chatbot .chatbot-send {
  background-color: var(--chatbot-color);
}

/* Floating widget container */
#my-ai-chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: none; /* hidden until .open */
  flex-direction: column;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#my-ai-chatbot-widget.open {
  display: flex; /* or block */
  opacity: 1;
  transform: translateY(0);
}

#my-ai-chatbot-widget.open + #my-ai-chatbot-toggle {
  display: none; /* hide floating button when chat open */
}
