   
/* ===============================
   CHATBOT ISOLATED MESSAGE LAYOUT
   =============================== */

#chatbot #chatbot-messages {
  display: flex;
  flex-direction: column;
}

/* Message row */
#chatbot .message-row {
  display: flex;
  align-items: flex-end;
  width: 100%;
  margin-bottom: 12px;
}

/* BOT ROW */
#chatbot .message-row.bot {
  justify-content: flex-start;
}

/* USER ROW */
#chatbot .message-row.user {
  justify-content: flex-end;
}

/* Wrapper controls width */
#chatbot .bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

/* Bot wrapper */
#chatbot .message-row.bot .bubble-wrapper {
  align-items: flex-start;
  margin-right: auto;
}

/* User wrapper (mirror of bot) */
#chatbot .message-row.user .bubble-wrapper {
  align-items: flex-end;
  margin-left: auto;
}

/* Bubble – identical behavior for bot & user */
#chatbot .bubble {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.35;
  border-radius: 22px;

  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;

  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Bot bubble styling */
#chatbot .message-row.bot .bubble {
  background: #b0d1ff;
  color: #000;
  border: 1px ridge #90bcff;
  border-bottom-left-radius: 8px;
}

/* User bubble styling */
#chatbot .message-row.user .bubble {
  background: #1c6be2;
  color: #fff;
  border: 1px ridge #3972c7;
  border-bottom-right-radius: 8px;
}

/* Timestamp */
#chatbot .timestamp {
  font-size: 11px;
  color: #222;
  margin-top: 4px;
}

#chatbot .message-row.bot .timestamp {
  text-align: left;
}

#chatbot .message-row.user .timestamp {
  text-align: right;
}

    /* ===== CHATBOT ===== */
   #bot-toggle {
  position: fixed;
  bottom: 10px;
  right: 60px;

  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: transparent;

  /* box-shadow: 0 10px 30px rgba(17, 16, 29, 0.25); */

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;

  opacity: 0.95;
  transform: translateY(0) scale(1);
  animation: bot-float 3s ease-in-out infinite;

 
}
 


    @keyframes bot-float {
      0% { transform: translateY(0); }
      50% { transform: translateY(-6px); }
      100% { transform: translateY(0); }
    }

    /* #chatbot {
      position: fixed;
      bottom: 90px;
      right: 20px;
      width: 300px;
      height: 400px;
      background: white;
      border-radius: 22px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.25);
      display: none;
      flex-direction: column;
      overflow: hidden;
      z-index: 999;
      box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
    } */
#chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;

  width: 380px;
  height: 520px;

  min-width: 320px;
  min-height: 420px;

  max-width: 90vw;
  max-height: 90vh;

  display: none;
  flex-direction: column; /* ✅ REQUIRED */

  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  z-index: 9999;
}

/* #resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  cursor: se-resize;
  z-index: 10000;
  background: transparent;
}

#resize-handle::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border-right: 2px solid #888;
  border-bottom: 2px solid #888;
} */
#chatbot.fullscreen {
  width: 20vw !important;
  height: 80vh !important;
  bottom: 0;
  right: 0;
  border-radius: 23px;
}

   #chatbot-header {
  background: linear-gradient(115deg, #749cf1 0%, #2571e5 50%, #2a69c7 75%, #245eb3 100%);
  color: white;
  padding: 16px 18px;
  border-radius: 22px 22px 0 0;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
   #chatbot-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;

  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);

  border-top: 1px solid rgba(255, 255, 255, 0.25);
}


    .message-row {
      display: flex;
      margin-bottom: 10px;
    }

    .message-row.user {
      justify-content: flex-end;
      
    }

    .message-row.bot {
      justify-content: flex-start;
    }

    /* .bubble {
      max-width: 80%;
      padding: 10px 12px;
      border-radius: 14px;
      font-size: 14px;
      line-height: 1.4;
  word-break: break-word;
    } */
.bubble {
  max-width: 75%;
  width: fit-content;
  min-width: 56px;

  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.35;

  border-radius: 20px;
  display: inline-block;

  /* ✅ SMART WRAPPING */
  white-space: normal;            /* allow wrap */
  word-break: keep-all;           /* never split words */
  overflow-wrap: break-word;      /* break only if needed */

  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.bubble p {
  margin: 0 0 8px 0;
}

.bubble ul,
.bubble ol {
  margin: 8px 0;
  padding-left: 18px;
}

.bubble li {
  margin-bottom: 6px;
  list-style-type: disc;
}

.bubble p:last-child,
.bubble ul:last-child,
.bubble ol:last-child {
  margin-bottom: 0;
}


/* 
.bubble p {
  margin: 0;
}
.bubble {
  line-height: 1.35;
} */

.bubble br {
  line-height: 1.35;
}

    .user .bubble {
      background: #0b5ed7;
      color: white;
      border-bottom-right-radius: 4px;
    }

    .bot .bubble {
      background: #e9ecef;
      color: #222;
      border-bottom-left-radius: 4px;
    }

    #chatbot-input {
      display: flex;
      border-top: 1px solid #2e2e2e;
    }

    #chatbot-input input {
      flex: 1;
      border: none;
      padding: 12px;
      font-size: 12px;
      outline: none;
      background: rgb(201, 225, 253);
      backdrop-filter: blur(14px) saturate(160%);
      -webkit-backdrop-filter: blur(14px) saturate(160%);

      border-top: 1px solid rgb(158, 203, 255);    }

    /* #chatbot-input button {
      border: none;
      background: linear-gradient(
        135deg,
        #3f78d2 0%,
        #578fe4 55%,
        #5c93ec 100%
      );
      color: white;
      padding: 0 18px;
      cursor: pointer;
      font-size: 16px;
    } */
     #chatbot-input button {
  border: none;
  background: linear-gradient(
    135deg,
    #3f78d2 0%,
    #578fe4 55%,
    #5c93ec 100%
  );
  color: white;
  padding: 0 18px;
  font-size: 16px;
  cursor: pointer;

  /* 🔒 default (inactive) */
  opacity: 0.45;
  transform: scale(1);
  pointer-events: none;

  /* 🎯 smooth animation */
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    filter 0.15s ease;
}

/* ✅ Active while typing */
#chatbot-input button.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1.08);
  filter: brightness(1.08);
}

/* ✨ Optional hover polish */
#chatbot-input button.active:hover {
  transform: scale(1.12);
  filter: brightness(1.12);
}

    #chat-input::placeholder {
  color: #020202;      /* soft neutral gray-blue */
  opacity: 1;          /* ensure consistency across browsers */
}

    .message-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 12px;
  gap: 2px;
}

.message-row.bot {
  justify-content: flex-start;
  
}

.message-row.user {
  justify-content: flex-end;
}
.message-row.user .bubble-wrapper,
.message-row.user .bubble {
  margin-left: auto;
}

/* Chat head icons */
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}


/* Bot bubble */
.message-row.bot .bubble {
  background: #b0d1ff;
  color: #000000;
  border-color: #90bcff;
  border-bottom-left-radius: 4px;
text-align: left;
  margin-right: auto;
  border-style:ridge;
   border-bottom-left-radius: 8px;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-bottom-right-radius: 22px;
  border-width: 1px;

}



/* User bubble */
.message-row.user .bubble {
  background: #1c6be2;
  border-color: #3972c7;
  border-style:ridge;
  max-width: 75%;
  width: fit-content;
  color: white;
  border-bottom-right-radius: 4px;
    border-bottom-right-radius: 8px;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-bottom-left-radius: 22px;
    border-width: 1px;
      width: fit-content;       /* 🔥 KEY FIX */


}
/* Timestamp */
.timestamp {
  font-size: 11px;
  color: #222222;
  margin-top: 4px;
  text-align: right;
}

.message-row.bot .timestamp {
  text-align: left;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #78aaec;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #1c64c4;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
.bubble,
.bubble * {
  pointer-events: auto !important;
}

.bubble a {
  color: #1a73e8;
  text-decoration: underline;
  cursor: pointer;
}
.input-disabled {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

.button-disabled {
  background-color: #b0b0b0;
  cursor: not-allowed;
}
#new-chat-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  justify-content: center;
 background: rgb(190 226 247 / 0%); /* 🔥 reduce transparency */
  backdrop-filter: blur(25px) saturate(100%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);


  border-top: 1px solid #d6e3f5;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);

  padding: 14px 16px;
  border-radius: 0 0 14px 14px;

  opacity: 1; /* ensure fully visible */
}

#new-chat-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #0b5ed7;
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

#new-chat-btn:hover {
  background: #094db1;
}

.new-chat-label {
  font-size: 14px;
  color: #555;
}
.chat-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

#clear-chat-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #ffffff;
  opacity: 0.85;
}

#clear-chat-btn:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* #chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0b5ed7;
  color: #ffffff;
} */

.chatbot-title {
  font-weight: 600;
  font-size: 14px;
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Shared icon button styling */
.chat-controls button {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hover behavior */
.chat-controls button:hover {
  opacity: 1;
}

/* Clear chat subtle motion */
#clear-chat-btn:hover {
  transform: rotate(90deg);
}

/* Close button emphasis */
#close-chat-btn {
  font-size: 18px;
}


.wave {
  display: inline-block;
  font-size: 32px;
  font-weight: 700;
  animation: wave-animation 1.5s infinite;
  transform-origin: 70% 70%;
}

@keyframes wave-animation {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(14deg); }
  50% { transform: rotate(-4deg); }
  60% { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}
