/* =========================================================
   FLOATING ACTION BUTTONS (Call & WhatsApp)
========================================================= */

.call-float,
.whatsapp-float {
  position: fixed;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 900; /* below chatbot */
}

.call-float {
  bottom: 90px;
  background-color: #0078d7;
  color: #fff;
  font-size: 20px;
}

.whatsapp-float {
  bottom: 30px;
  background-color: #25d366;
}

.whatsapp-float img {
  width: 30px;
  height: 30px;
}

.call-float:hover,
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* =========================================================
   CHATBOT TOGGLE BUTTON
========================================================= */

#chatbot-toggle {
  position: fixed;
  bottom: 160px; /* floats above whatsapp + call */
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0056b3, #007bff);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100; /* above everything */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(0, 123, 255, 0.55);
}

/* Notification dot */
#chatbot-toggle .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #ff4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}

/* =========================================================
   CHATBOT WINDOW
========================================================= */

#chatbot-window {
  position: fixed;
  bottom: 100px; /* sits above toggle button */
  right: 80px;
  width: 340px;
  height: 480px; /* FIXED height — never grows */
  max-height: 480px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  display: none; /* hidden by default */
  flex-direction: column;
  overflow: hidden;
  z-index: 1100;
  animation: chatSlideIn 0.3s ease;
}

#chatbot-window.open {
  display: flex;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* =========================================================
   CHATBOT HEADER
========================================================= */

#chatbot-header {
  background: linear-gradient(135deg, #0056b3, #007bff);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

#chatbot-header .bot-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#chatbot-header .bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

#chatbot-header .bot-name {
  font-weight: 600;
  font-size: 0.95rem;
}

#chatbot-header .bot-status {
  font-size: 0.75rem;
  opacity: 0.85;
}

#chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.2s;
}

#chatbot-close:hover {
  opacity: 1;
}

/* =========================================================
   MESSAGES AREA — SCROLLABLE, FIXED HEIGHT
========================================================= */

#chatbot-messages {
  flex: 1;           /* fills all remaining space */
  overflow-y: auto;  /* scroll inside */
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f4f7fb;
  min-height: 0;     /* critical for flex overflow fix */
}

/* Scrollbar */
#chatbot-messages::-webkit-scrollbar { width: 5px; }
#chatbot-messages::-webkit-scrollbar-track { background: transparent; }
#chatbot-messages::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 4px; }

/* =========================================================
   MESSAGE BUBBLES
========================================================= */

.chat-msg {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.bot {
  background: #ffffff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-msg.user {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chat-msg.typing {
  background: #fff;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 12px 16px;
}

.typing-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #007bff;
  border-radius: 50%;
  margin: 0 2px;
  animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* =========================================================
   QUICK REPLY BUTTONS
========================================================= */

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.quick-btn {
  background: #fff;
  border: 1.5px solid #007bff;
  color: #007bff;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-btn:hover {
  background: #007bff;
  color: #fff;
}

/* =========================================================
   INPUT AREA — FIXED AT BOTTOM
========================================================= */

#chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  flex-shrink: 0;
}

#chatbot-input {
  flex: 1;
  padding: 9px 13px;
  border: 1.5px solid #ddd;
  border-radius: 22px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: #007bff;
}

#chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0056b3, #007bff);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

#chatbot-send:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,123,255,0.4);
}

/* =========================================================
   MOBILE RESPONSIVE
========================================================= */

@media (max-width: 480px) {

  #chatbot-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 210px;
    height: 420px;
    max-height: 420px;
  }

  #chatbot-toggle {
    right: 12px;
    bottom: 155px;
  }

  .call-float  { right: 12px; }
  .whatsapp-float { right: 12px; }
}