/* ============================================================
   DashBot AI Assistant + WhatsApp Button
   ============================================================ */

/* Floating buttons container */
.floating-buttons {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* WhatsApp button */
.wa-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
}

.wa-btn svg { width: 28px; height: 28px; fill: #fff; }

/* DashBot trigger button */
.dashbot-trigger {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #D4A843;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  padding: 6px;
}

.dashbot-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(212, 168, 67, 0.35);
}

.dashbot-trigger img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-top: 2px;
}

.dashbot-trigger .pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #D4A843;
  border-radius: 50%;
  border: 2px solid #1B3A5C;
}

.dashbot-trigger .pulse::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 16px;
  height: 16px;
  background: #D4A843;
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Chat window */
.dashbot-chat {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-height: 560px;
  background: #FAFAF8;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(27, 58, 92, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 160;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashbot-chat.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Chat header */
.db-header {
  background: #1B3A5C;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.db-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #122842;
  border: 2px solid #D4A843;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
}

.db-header-avatar img { width: 32px; height: 32px; object-fit: contain; }

.db-header-info h3 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  font-family: 'DM Sans', sans-serif;
}

.db-header-info p {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  margin: 0;
  font-family: 'DM Sans', sans-serif;
}

.db-header-info .online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2D8B55;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.db-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.db-close:hover { color: #fff; }

/* Chat messages */
.db-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 340px;
}

.db-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: msg-in 0.3s ease-out;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.db-msg.bot .db-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1B3A5C;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.db-msg.bot .db-msg-avatar img { width: 22px; height: 22px; }

.db-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  font-family: 'DM Sans', sans-serif;
  max-width: 280px;
}

.db-msg.bot .db-msg-bubble {
  background: #fff;
  color: #1A1A1A;
  border: 1px solid #E5E2DA;
  border-top-left-radius: 4px;
}

.db-msg.user {
  flex-direction: row-reverse;
}

.db-msg.user .db-msg-bubble {
  background: #1B3A5C;
  color: #fff;
  border-top-right-radius: 4px;
}

/* Quick replies */
.db-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.db-quick-btn {
  background: #F7F5F0;
  border: 1px solid #E5E2DA;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: #1B3A5C;
  cursor: pointer;
  transition: all 0.2s;
}

.db-quick-btn:hover {
  background: #1B3A5C;
  color: #fff;
  border-color: #1B3A5C;
}

/* Typing indicator */
.db-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #E5E2DA;
  border-radius: 12px;
  border-top-left-radius: 4px;
  width: fit-content;
}

.db-typing span {
  width: 6px;
  height: 6px;
  background: #B4B2A9;
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite;
}

.db-typing span:nth-child(2) { animation-delay: 0.15s; }
.db-typing span:nth-child(3) { animation-delay: 0.3s; }

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

/* Chat input */
.db-input-area {
  padding: 12px 16px;
  border-top: 1px solid #E5E2DA;
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}

.db-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E5E2DA;
  border-radius: 100px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: #1A1A1A;
  outline: none;
  background: #FAFAF8;
  transition: border-color 0.2s;
}

.db-input:focus { border-color: #2E5FA3; }

.db-input::placeholder { color: #B4B2A9; }

.db-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #D4A843;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.db-send:hover { background: #E8C97A; }

.db-send svg { width: 18px; height: 18px; fill: #1B3A5C; }

/* Powered by */
.db-powered {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: #B4B2A9;
  font-family: 'DM Sans', sans-serif;
  background: #fff;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .dashbot-chat {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 16px 16px 0 0;
  }

  .floating-buttons { bottom: 16px; right: 16px; }
  .dashbot-trigger { width: 56px; height: 56px; }
  .wa-btn { width: 48px; height: 48px; }
}
