/* /chatbot/chatbot-style.css */
/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* Toggle button */
.chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #3fbafe;
  transition: all 0.2s ease;
  z-index: 999999;
  border: none;
  outline: none;
}
body.show-chatbot .chatbot-toggler {
  transform: rotate(90deg);
}
.chatbot-toggler span {
  color: #fff;
  position: absolute;
}
.chatbot-toggler span:last-child,
body.show-chatbot .chatbot-toggler span:first-child {
  opacity: 0;
}
body.show-chatbot .chatbot-toggler span:last-child {
  opacity: 1;
}

/* Chat window */
.chatbot {
  position: fixed;
  right: 35px;
  bottom: 90px;
  width: 420px;                          /* restored */
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  box-shadow:
    0 0 128px rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease;
  z-index: 999999;
}
body.show-chatbot .chatbot {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Header */
.chatbot header {
  padding: 16px 0;
  position: relative;
  text-align: center;
  color: #fff;
  background: linear-gradient(90deg, #3fbafe 0%, #42baff 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.chatbot header .close-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  display: none;
  cursor: pointer;
  transform: translateY(-50%);
}
header h2 {
  font-size: 1.4rem;
}

/* Chat area */
.chatbot .chatbox {
  overflow-y: auto;
  height: 510px;                         /* restored */
  padding: 30px 20px 100px;
}
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar {
  width: 6px;
}
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-track {
  background: #fff;
  border-radius: 25px;
}
.chatbot :where(.chatbox, textarea)::-webkit-scrollbar-thumb {
  background: #c7eaff;
  border-radius: 25px;
}

/* Message bubbles */
.chatbox .chat {
  display: flex;
  list-style: none;
  margin: 20px 0;
  opacity: 0;
}
/* Incoming pop */
.chatbox .incoming {
  justify-content: flex-start;
  animation: incoming-pop 0.15s ease-out forwards;
}
.chatbox .incoming span {
  width: 32px;
  height: 32px;
  color: #fff;
  text-align: center;
  line-height: 32px;
  background: #3fbafe;
  border-radius: 4px;
  margin: 0 10px 7px 0;
}
.chatbox .incoming p {
  background: #e5f7ff;
  color: #000;
  padding: 12px 16px;
  border-radius: 10px 10px 10px 0;
  max-width: 75%;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

/* Outgoing pop */
.chatbox .outgoing {
  justify-content: flex-end;
  animation: outgoing-pop 0.15s ease-out forwards;
}
.chatbox .outgoing p {
  background: #3fbafe;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px 10px 0 10px;
  max-width: 75%;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

/* Keyframes */
@keyframes incoming-pop {
  from { opacity: 0; transform: translateX(-20px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0)     scale(1); }
}
@keyframes outgoing-pop {
  from { opacity: 0; transform: translateX(20px)  scale(0.9); }
  to   { opacity: 1; transform: translateX(0)     scale(1); }
}

/* Error bubble */
.chatbox .chat p.error {
  background: #e0f6ff;
  color: #155263;
}

/* Input area */
.chatbot .chat-input {
  display: flex;
  gap: 5px;
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 3px 20px;
  border-top: 1px solid #d0eaff;
}
.chat-input textarea {
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 15px 15px 15px 0;
  font-size: 0.95rem;
}
.chat-input span {
  align-self: flex-end;
  color: #3fbafe;
  cursor: pointer;
  height: 55px;
  display: flex;
  align-items: center;
  visibility: hidden;
  font-size: 1.35rem;
}
.chat-input textarea:valid ~ span {
  visibility: visible;
}

/* System-style notices, two-line clamp */
.chatbox li.system-message {
  list-style: none;
  font-size: 0.8rem;
  font-weight: normal;
  color: #444;
  background: rgba(220,220,220,0.3);
  padding: 4px 8px;
  border-radius: 8px;
  max-width: 260px;
  margin: 8px auto;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile full-screen */
@media (max-width: 600px) {
  .chatbot-toggler {
    bottom: 10px;
    right: 10px;
    height: 44px;
    width: 44px;
  }
  .chatbot {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .chatbot header .close-btn {
    display: block;
    color: #fff;
  }
  .chatbox {
    padding: 25px 15px 100px;
    height: 90%;
  }
  .chat-input {
    padding: 5px 15px;
  }
}
