/* ============================================================
   ASTITVA AI CHATBOT — LEFT-SIDE WIDGET
   ============================================================ */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;           /* ← LEFT SIDE */
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ---- Toggle Button ---- */
.chatbot-toggle-wrap { position: relative; }

.chatbot-toggle {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e31e24 0%, #a01018 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(227,30,36,0.5);
  transition: all 0.35s cubic-bezier(.34,1.56,.64,1);
  position: relative;
  outline: none;
}
.chatbot-toggle:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 6px 28px rgba(227,30,36,0.65);
}
.chatbot-toggle.active {
  background: linear-gradient(135deg, #1a1a2e, #2d2d5e);
}

.chat-notify-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #4caf50;
  border: 2px solid #fff;
  border-radius: 50%;
  animation: chatPulse 2s infinite;
}
@keyframes chatPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.chat-tooltip {
  position: absolute;
  bottom: 70px; left: 0;
  background: #1a1a2e;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s ease;
}
.chat-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 20px;
  border: 6px solid transparent;
  border-top-color: #1a1a2e;
  border-bottom: none;
}
.chatbot-widget:hover .chat-tooltip { opacity: 1; transform: translateY(0); }

/* ---- Chat Window ---- */
.chatbot-window {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 14px;
  animation: chatSlideUp 0.35s cubic-bezier(.34,1.2,.64,1);
  max-height: 560px;
}
@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.chatbot-window.open { display: flex; }

/* ---- Header ---- */
.chatbot-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #e31e24 150%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chatbot-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}
.chatbot-header-info { flex: 1; min-width: 0; }
.chatbot-header-info h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chatbot-header-info .chat-status {
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-call-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(76,175,80,0.85);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}
.chat-call-btn:hover { background: #43a047; transform: scale(1.1); }
.chatbot-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.chatbot-close:hover { color: #fff; }

/* ---- Messages ---- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8f9fb;
  max-height: 320px;
  scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-msg-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e31e24, #a01018);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
  flex-shrink: 0;
}
.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.65;
}
.chat-msg.bot .chat-msg-bubble {
  background: #fff;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, #1a1a2e, #2d2d5e);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-bubble strong { font-weight: 700; }
.chat-msg-bubble a { color: #e31e24; font-weight: 600; }
.chat-msg.user .chat-msg-bubble a { color: rgba(255,255,255,0.85); }
.chat-msg-time { font-size: 10px; color: #bbb; margin-top: 3px; padding: 0 2px; }
.chat-msg.user .chat-msg-time { text-align: right; }

/* ---- Typing indicator ---- */
.typing-indicator {
  display: flex; gap: 4px; align-items: center;
  background: #fff;
  padding: 12px 16px;
  border-radius: 16px; border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.typing-indicator span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #bbb;
  animation: typeDot 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typeDot { 0%,60%,100%{transform:translateY(0);} 30%{transform:translateY(-6px);} }

/* ---- Quick Replies ---- */
.chatbot-quick-replies {
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f8f9fb;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.quick-reply-btn {
  background: #fff;
  border: 1.5px solid #e31e24;
  color: #e31e24;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.quick-reply-btn:hover { background: #e31e24; color: #fff; }

/* ---- Input ---- */
.chatbot-input-area {
  padding: 12px 14px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1;
  border: 1.5px solid #e0e0e0;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #f8f9fb;
}
.chatbot-input:focus { border-color: #e31e24; background: #fff; }
.chatbot-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #e31e24;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.chatbot-send:hover { background: #c01920; transform: scale(1.05); }

/* ---- Footer Bar ---- */
.chatbot-footer-bar {
  padding: 7px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  font-size: 11px;
  color: #aaa;
  flex-shrink: 0;
}
.chatbot-footer-bar a {
  color: #e31e24;
  font-weight: 600;
  font-size: 11px;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 480px) {
  .chatbot-widget {
    bottom: 14px;
    left: 14px;
  }
  .chatbot-window {
    width: calc(100vw - 28px);
    max-height: 75vh;
  }
  .chatbot-toggle { width: 52px; height: 52px; font-size: 20px; }
  .chatbot-messages { max-height: 260px; }
  .chat-tooltip { font-size: 12px; }
}
@media (max-width: 360px) {
  .chatbot-window { width: calc(100vw - 20px); }
  .chatbot-widget { left: 10px; }
}
