/* ADA Chatbot floating widget */

#ada-chatbot-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Floating bubble button */
#ada-chatbot-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.2s;
  float: right;
}

#ada-chatbot-bubble:hover {
  background: #1b5e20;
  transform: scale(1.08);
}

#ada-chatbot-bubble svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

/* Notification dot */
#ada-chatbot-bubble .notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #e53935;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}

/* Chat window */
#ada-chatbot-window {
  display: none;
  flex-direction: column;
  width: 360px;
  height: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  margin-bottom: 12px;
}

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

/* Header */
#ada-chatbot-header {
  background: #2e7d32;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#ada-chatbot-header .chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#ada-chatbot-header .chatbot-avatar svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

#ada-chatbot-header .chatbot-info {
  flex: 1;
}

#ada-chatbot-header .chatbot-info .chatbot-name {
  font-weight: 600;
  font-size: 15px;
}

#ada-chatbot-header .chatbot-info .chatbot-status {
  font-size: 11px;
  opacity: 0.85;
}

#ada-chatbot-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.8;
  font-size: 20px;
}

#ada-chatbot-close:hover {
  opacity: 1;
}

/* Messages area */
#ada-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#ada-chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

#ada-chatbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.chatbot-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.chatbot-msg.bot {
  background: #fff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chatbot-msg.user {
  background: #2e7d32;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: chatbot-bounce 1.2s infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Input area */
#ada-chatbot-input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  gap: 8px;
}

#ada-chatbot-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 24px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  max-height: 96px;
  overflow-y: auto;
}

#ada-chatbot-input:focus {
  border-color: #2e7d32;
}

#ada-chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

#ada-chatbot-send:hover {
  background: #1b5e20;
}

#ada-chatbot-send:disabled {
  background: #aaa;
  cursor: not-allowed;
}

#ada-chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* RTL support */
body[dir="rtl"] #ada-chatbot-wrapper {
  right: auto;
  left: 24px;
}

body[dir="rtl"] #ada-chatbot-bubble {
  float: left;
}

body[dir="rtl"] .chatbot-msg.user {
  align-self: flex-start;
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 4px;
}

body[dir="rtl"] .chatbot-msg.bot {
  align-self: flex-end;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}

/* Mobile */
@media (max-width: 480px) {
  #ada-chatbot-window {
    width: calc(100vw - 24px);
    height: 70vh;
    right: 0;
  }
  body[dir="rtl"] #ada-chatbot-window {
    left: 0;
  }
}
