/*--------------------------------------------------------------
# Chatbot Styles
--------------------------------------------------------------*/

/* 
  CUSTOMIZATION NOTE:
  The chatbot's color is controlled by the `--accent-color` variable.
  To change the chatbot's color scheme to match your brand, you only need to 
  update the `--accent-color` value in your `assets/css/main.css` file (line 19).
  All chatbot components will automatically inherit the new color.
--------------------------------------------------------------*/
.chatbot-toggler {
  position: fixed;
  bottom: 90px;
  right: 35px;
  outline: none;
  border: none;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-color);
  transition: all 0.2s ease;
  z-index: 999;
}

.proactive-greeting {
  position: fixed;
  bottom: 150px;
  right: 35px;
  width: 300px;
  background: var(--surface-color);
  color: var(--default-color);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  z-index: 998;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.proactive-greeting.visible {
  opacity: 1;
  transform: translateY(0);
}

.proactive-greeting .greeting-header {
  display: flex;
  align-items: center;
  font-weight: bold;
  margin-bottom: 8px;
}

.proactive-greeting .greeting-header .bi-robot {
  color: var(--accent-color);
  margin-right: 8px;
}

.chatbot-toggler span {
  color: #fff;
  position: absolute;
}

.chatbot-toggler span:last-child,
.show-chatbot .chatbot-toggler span:first-child {
  opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child {
  opacity: 1;
}

.chatbot {
  position: fixed;
  right: 35px;
  bottom: 150px;
  width: 450px;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease;
  z-index: 1000;
}

.show-chatbot .chatbot {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.chatbot header {
  padding: 16px 0;
  position: relative;
  text-align: center;
  color: #fff;
  background: var(--accent-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chatbot header h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

.chatbot header .header-buttons {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
}

.chatbot header .close-btn,
.chatbot header .clear-btn {
  color: #fff;
  cursor: pointer;
  font-size: 1.3rem;
}

.chatbot .chatbox {
  overflow-y: auto;
  height: 500px;
  padding: 30px 20px 100px;
}

.chatbot .chat {
  display: flex;
  list-style: none;
}

.chatbot .chat p {
  white-space: pre-wrap;
  padding: 12px 16px;
  border-radius: 10px 10px 0 10px;
  max-width: 75%;
  font-size: 0.95rem;
  background: #f2f2f2;
}

.chatbot .chat .suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}

.chatbot .chat .suggestions button {
  background-color: #f2f2f2;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 5px 10px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s;
}
.chatbot .chat .suggestions button:hover {
  background-color: var(--accent-color);
  color: #fff;
}

.chatbot .outgoing .typing-indicator-bubble {
  background: #f2f2f2;
  padding: 10px 16px;
  color: #fff;
}

.chatbot .incoming p.typing-effect::after {
  content: "▋";
  animation: blink 1s infinite;
  display: inline-block;
  vertical-align: baseline;
  margin-left: 2px;
}

.chatbot .incoming p.typing-effect.typing-done::after {
  content: "";
  animation: none;
}

.chatbot .chat .typing-animation {
  display: flex;
  gap: 5px;
}

.typing-animation .dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: #aaa;
  animation: typing 1s infinite;
}

.typing-animation .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-animation .dot:nth-child(3) {
  animation-delay: 0.4s;
}

.chatbot .chat p.error {
  color: #721c24;
  background: #f8d7da;
}

.chatbot .incoming span {
  height: 32px;
  width: 32px;
  color: #fff;
  cursor: default;
  text-align: center;
  line-height: 32px;
  align-self: flex-end;
  background: var(--accent-color);
  border-radius: 4px;
  margin: 0 10px 7px 0;
}

.chatbot .outgoing {
  margin: 20px 0;
  justify-content: flex-end;
}

.chatbot .outgoing p {
  background: var(--accent-color);
  color: #fff;
  border-radius: 10px 10px 10px 0;
}

.chatbot .chat-input {
  display: flex;
  gap: 5px;
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 5px 20px;
  border-top: 1px solid #ddd;
}

.chat-input textarea {
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 16px 15px 16px 0;
  font-size: 0.95rem;
}

.chat-input span {
  align-self: flex-end;
  color: var(--accent-color);
  cursor: pointer;
  height: 55px;
  display: flex;
  align-items: center;
  visibility: hidden;
  font-size: 1.35rem;
}

.chat-input textarea:valid ~ span {
  visibility: visible;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
