/* Popup Chatbot Styles */
#chat-container {
  position: flex;
  bottom: 80px; /* so chat pops up above toggle */
  right: 20px;
  width: 360px;
  max-width: 90vw;
  height: 420px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  font-family: Arial, sans-serif;
  display: none;
}

/* Messages scrollable area */
#chat-window {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  word-wrap: break-word;
}

/* Input area fixed at bottom */
#chat-input-area {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #f9f9f9;
  border-top: 1px solid #ddd;
}

/* Input box styling */
#user-input {
  flex: 1;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 5px;
  font-size: 14px;
  outline: none;
}

/* Send button */
#send-btn {
  margin-left: 8px;
  padding: 10px 16px;
  border: none;
  background-color: #ebdfa3; /* soft gold */
  color: #333;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#send-btn:hover {
  background-color: #d4c78f;
}

/* FIX: Force toggle outside chat container */
#chat-toggle {
  position: fixed !important; /* override any Wix nesting */
  bottom: 20px !important; /* 20px from bottom of screen */
  right: 20px !important; /* 20px from right side */
  width: 50px;
  height: 50px;
  background-color: #ebdfa3; /* soft gold */
  color: #333;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000 !important; /* always above chat container */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
  transition: background-color 0.3s ease;
}

#chat-toggle:hover {
  background-color: #d4c78f;
}

/* Message bubbles */
.message {
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 75%;
  word-wrap: break-word;
  white-space: normal;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.5;
  display: inline-block;
  position: relative;
}

/* Bot messages - warm grey background */
.message.bot {
  background: #867f7c;
  color: white;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

/* Bot message tail */
.message.bot::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-right: 8px solid #867f7c;
  border-bottom: 8px solid transparent;
}

/* User messages - soft gold background */
.message.user {
  background: #ebdfa3;
  color: #333;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* User message tail */
.message.user::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-left: 8px solid #ebdfa3;
  border-bottom: 8px solid transparent;
}

/* Bot buttons inside messages */
.message.bot button {
  background-color: #ebdfa3;
  color: #333;
  border: none;
  padding: 6px 12px;
  margin: 5px 5px 0 0;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.message.bot button:hover {
  background-color: #d4c78f;
}
