/* =============================
   CHATBOT BASE POSITION
============================= */
#madhava-chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: 'Space Grotesk', sans-serif;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Show chatbot after preloader */
body.chatbot-ready #madhava-chatbot {
  opacity: 1;
  pointer-events: auto;
}

/* =============================
   TOGGLE BUTTON
============================= */
#chatbot-toggle {
  width: 60px;
  height: 60px;

  background: linear-gradient(135deg, #6c02dc);
  border-radius: 50%;
  border: none;

  cursor: pointer;

  /* 🔒 Fix overflow + alignment */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  font-size: 26px;
  color: #ffffff;

  box-shadow: 0 12px 30px rgba(62, 171, 191, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Hover */
#chatbot-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 18px 40px rgba(62, 171, 191, 0.6);
}

/* Click */
#chatbot-toggle:active {
  transform: scale(0.95);
  box-shadow: 0 10px 25px rgba(62, 171, 191, 0.4);
}


/* =============================
   CHAT WINDOW
============================= */
#chatbot-window {
  width: 340px;
  height: 480px;
  background: #ffffff;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.chatbot-header {
  background: #3EABBF;
  color: #ffffff;
  padding: 12px 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left side: logo + title */
.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo image */
.chatbot-header-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Title text */
.chatbot-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}



/* =============================
   MESSAGES AREA
============================= */
#chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f9fafb;
}

.bot-message,
.user-message {
  max-width: 80%;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;

  /* ✅ CRITICAL FIX */
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.bot-message {
  background: #E0F7FA;
  color: #1f2937;
}

.user-message {
  background: #3EABBF;
  color: white;
  margin-left: auto;
}

/* =============================
   INPUT
============================= */
.chatbot-input {
  display: flex;
  border-top: 1px solid #e5e7eb;
}

.chatbot-input input {
  flex: 1;
  padding: 12px;
  border: none;
  outline: none;
}

.chatbot-input button {
  padding: 12px 16px;
  background: #3EABBF;
  color: #ffffff;
  border: none;
  cursor: pointer;
}

/* =============================
   LINKS (VISIBLE & CLICKABLE)
============================= */
.bot-message a {
  color: #0f4c81;
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}

.bot-message a:hover {
  color: #0b355a;
  text-decoration-thickness: 2px;
}

/* =============================
   NO-BREAK (ONLY FOR NUMBERS)
============================= */
.bot-message .no-break {
  white-space: nowrap;
  display: inline-block;
}

/* =============================
   RESPONSIVE POSITIONING
============================= */
@media (min-width: 768px) {
  #madhava-chatbot {
    bottom: 93px;
    right: 7px;
  }
}

@media (max-width: 767px) {
  #madhava-chatbot {
    bottom: 90px;
    right: 7px;
  }
}

/* Sending animation */
.loading-message {
  font-style: italic;
  opacity: 0.8;
  background: #f1f5f9;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}


#chatbot-close {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  cursor: pointer;
  color: #ffffff;

  transition: background 0.2s ease, transform 0.2s ease;
}

#chatbot-close:hover {
  background: #dc2626; /* red hover */
  transform: scale(1.1);
}

#chatbot-close svg {
  width: 18px;
  height: 18px;
}
/* Utility: safely hide elements without breaking layout */
.hidden {
  display: none !important;
}


/* 🌞 Sun rotation animation */
@keyframes madhavaSunRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Apply rotation to chatbot header logo */
.chatbot-header-logo {
  animation: madhavaSunRotate 10s linear infinite;
}
