/* Vidhyuth Logistics - Interactive B2B Lead Capture Chatbot Styles */

.vl-chatbot-wrapper {
  position: relative;
  z-index: 2600;
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* Floating Notification Badge on Chat Button */
.chat-float {
  position: relative;
}

.vl-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: vl-pulse-badge 2s infinite ease-in-out;
}

@keyframes vl-pulse-badge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* CHAT WINDOW */
.vl-chat-window {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 580px;
  max-height: calc(100vh - 7rem);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(77, 9, 76, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2600;
}

.vl-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* HEADER */
.vl-chat-header {
  background: linear-gradient(135deg, #4D094C 0%, #2f042e 100%);
  color: #ffffff;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #FF9F1C;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vl-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vl-chat-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.vl-online-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border: 2px solid #4D094C;
  border-radius: 50%;
}

.vl-chat-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.vl-chat-subtitle {
  font-size: 0.74rem;
  color: #FF9F1C;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.vl-chat-header-actions {
  display: flex;
  gap: 0.4rem;
}

.vl-chat-btn-header {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.vl-chat-btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* MESSAGES CONTAINER */
.vl-chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background-color: #f8fafc;
  scroll-behavior: smooth;
}

.vl-chat-msg-row {
  display: flex;
  gap: 0.5rem;
  max-width: 88%;
  animation: vl-fade-in 0.2s ease;
}

@keyframes vl-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.vl-chat-msg-row.bot-row {
  align-self: flex-start;
}

.vl-chat-msg-row.user-row {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.vl-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4D094C;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.vl-msg-bubble {
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.bot-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 4px;
}

.user-bubble {
  background: #4D094C;
  color: #ffffff;
  border-top-right-radius: 4px;
}

.vl-msg-time {
  font-size: 0.68rem;
  margin-top: 0.35rem;
  text-align: right;
  opacity: 0.65;
}

.vl-code-tag {
  background: #f1f5f9;
  color: #4D094C;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.82rem;
}

.vl-chat-link {
  color: #0284c7;
  text-decoration: underline;
  font-weight: 600;
}

/* INLINE WHATSAPP CTA BUTTON INSIDE BOT MESSAGES */
.vl-chat-inline-cta {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #cbd5e1;
  display: flex;
}

.vl-chat-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #25D366;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.vl-chat-wa-btn:hover {
  background-color: #128C7E;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(18, 140, 126, 0.4);
}

/* TYPING INDICATOR */
.vl-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.85rem;
}

.vl-dot {
  width: 6px;
  height: 6px;
  background-color: #94a3b8;
  border-radius: 50%;
  animation: vl-blink 1.4s infinite both;
}

.vl-dot:nth-child(2) { animation-delay: 0.2s; }
.vl-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes vl-blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* QUICK REPLIES CHIPS */
.vl-chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  max-height: 120px;
  overflow-y: auto;
}

.vl-chip-btn {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.vl-chip-btn:hover {
  background: #4D094C;
  color: #ffffff;
  border-color: #4D094C;
  transform: translateY(-1px);
}

/* CTA ACTIONS BOX IN BOT MESSAGE */
.vl-chat-cta-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.vl-chat-inline-cta {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(77, 9, 76, 0.18);
}

.vl-chat-inline-cta .vl-chat-wa-btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 6px;
  width: 100%;
}

.vl-chat-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #25D366;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
}

.vl-chat-wa-btn:hover {
  background: #1eb956;
  transform: translateY(-1px);
  color: #fff;
}

.vl-chat-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.vl-chat-call-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* INPUT BAR */
.vl-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.vl-chat-input-bar input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  padding: 0.6rem 1rem;
  font-size: 0.86rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #f8fafc;
}

.vl-chat-input-bar input:focus {
  border-color: #4D094C;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(77, 9, 76, 0.12);
}

.vl-chat-input-bar button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4D094C;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.vl-chat-input-bar button:hover {
  background: #FF9F1C;
  transform: scale(1.05);
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
  .vl-chat-window {
    bottom: 0.75rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: calc(100vw - 1rem);
    height: 84vh;
    max-height: 84vh;
    border-radius: 14px;
    z-index: 2600;
  }
}
