/* Floating container */
#chatbot-root {
  position: relative;
  z-index: 0; /* neutral wrapper */
}



#chatbot {
    position: fixed !important ; /* 👈 stays fixed on screen */
    bottom: 24px !important;    /* distance from bottom edge */
    right: 24px   !important ;  /* distance from right edge */
    z-index: 9999 !important ;   /* ensures it stays above other elements */
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
  }
  
  


/* Toggle button */
#chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 36px rgba(0,0,0,0.3);
}

/* Panel */
#chat-panel {
  width: 360px;
  height: 460px;
  margin-bottom: 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff url("data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f1f3f5' fill-opacity='0.6'%3E%3Ccircle cx='2' cy='2' r='2'/%3E%3Ccircle cx='14' cy='14' r='2'/%3E%3C/g%3E%3C/svg%3E") repeat;
  border: 1px solid #dee2e6;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#chat-panel.hidden { pointer-events: none; opacity: 0; transform: translateY(14px) scale(0.98); }
#chat-panel:not(.hidden) { pointer-events: auto; opacity: 1; transform: translateY(0) scale(1); }

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  color: #fff;
}
.chat-title {
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 16px;
}
.chat-title::after {
  content: " – Ruby";
  font-weight: 400;
  font-size: 14px;
  margin-left: 6px;
  opacity: 0.85;
}
#chat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* Body */
#chat-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}
#chat-body::-webkit-scrollbar { width: 6px; }
#chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

/* Messages */
.bot-msg, .user-msg { display: flex; margin: 10px 0; }
.bot-msg { justify-content: flex-start; }
.user-msg { justify-content: flex-end; }

.msg {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.4;
  font-size: 14px;
  animation: popIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.bot-msg .msg {
  background: #f8f9fa;
  color: #212529;
  border: 1px solid #e9ecef;
}
.user-msg .msg {
  background: linear-gradient(135deg, #d1e7dd, #bcd0c7);
  color: #0f5132;
  border: 1px solid #badbcc;
}

/* Footer */
.chat-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f8f9fa;
}
#chat-input {
  flex: 1;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #212529;
}
#chat-input::placeholder { color: #6c757d; }
#chat-send {
  width: 44px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  color: #fff;
  cursor: pointer;
  transition: transform 0.25s ease;
}
#chat-send:hover { transform: scale(1.1); }

/* Animations */
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  #chat-panel {
    width: 80vw;
    height: 60vh;
    right: 10vw;
    bottom: 80px; /* leaves space above toggle button */
  }
}
@media (max-width: 480px) {
  #chat-panel {
    width: 92vw;
    height: 65vh;
    right: 4vw;
    bottom: 80px;
  }
  #chat-toggle {
    width: 50px;
    height: 50px;
  }
  .msg {
    font-size: 13px;
    padding: 10px 12px;
  }
}