/* Canyon ABA Chatbot Widget — chatbot.css */

/* ═══ Chat Bubble (launcher) ═══ */
.cab-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #4A9B8E;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cab-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}
.cab-bubble svg { width: 28px; height: 28px; }
.cab-bubble.cab-hidden { display: none; }

/* ═══ Chat Window ═══ */
.cab-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 370px;
  max-height: 520px;
  background: #FEFEFE;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cab-window.cab-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ═══ Header ═══ */
.cab-header {
  background: #4A9B8E;
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cab-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.cab-header-info {
  flex: 1;
}
.cab-header-name {
  font-weight: 700;
  font-size: 15px;
}
.cab-header-status {
  font-size: 11px;
  opacity: 0.8;
}
.cab-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.cab-close:hover { opacity: 1; }
.cab-close svg { width: 20px; height: 20px; }

/* ═══ Messages Area ═══ */
.cab-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Bot message */
.cab-msg-bot {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 88%;
}
.cab-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4A9B8E;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.cab-msg-bubble {
  background: #EFF8F6;
  color: #2C2C2C;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  font-size: 14px;
  line-height: 1.5;
}
.cab-msg-bubble a {
  color: #4A9B8E;
  text-decoration: underline;
}

/* User message */
.cab-msg-user {
  align-self: flex-end;
  max-width: 78%;
}
.cab-msg-user .cab-msg-bubble {
  background: #E8E8E8;
  color: #2C2C2C;
  border-radius: 16px 16px 4px 16px;
}

/* ═══ Quick Reply Buttons ═══ */
.cab-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.cab-reply-btn {
  background: #4A9B8E;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.cab-reply-btn:hover {
  background: #3d857a;
  transform: scale(1.03);
}

/* CTA button (stands out more) */
.cab-cta-btn {
  background: #D67B47;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cab-cta-btn:hover {
  background: #c46b3a;
  transform: scale(1.03);
}

/* ═══ Text Input ═══ */
.cab-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.cab-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #2C2C2C;
  outline: none;
  transition: border-color 0.2s;
}
.cab-input:focus { border-color: #4A9B8E; }
.cab-input::placeholder { color: #aaa; }
.cab-send {
  background: #4A9B8E;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.cab-send:hover { background: #3d857a; }
.cab-send svg { width: 18px; height: 18px; }

/* ═══ Typing indicator ═══ */
.cab-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-items: center;
}
.cab-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4A9B8E;
  opacity: 0.4;
  animation: cab-bounce 1.2s infinite;
}
.cab-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.cab-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cab-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ═══ Mobile ═══ */
@media (max-width: 768px) {
  .cab-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
  }
  .cab-bubble {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
  .cab-replies {
    gap: 6px;
  }
  .cab-reply-btn {
    font-size: 12px;
    padding: 7px 13px;
  }
}
