/* ================= CHATBOT ================= */

.chatbot-widget {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 360px;
  height: 560px;
  background: #fff;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 101;
  transition: all 0.3s ease;
}

/* chatbot disembunyikan */
.chatbot-widget.closed {
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.95);
  pointer-events: none;
}

/* chatbot ditampilkan */
.chatbot-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
/* HEADER */

.chat-header {
  height: 60px;

  background: #1d4ed8;

  color: #fff;

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 0 18px;

  font-weight: 600;
}

.chat-header button {
  border: none;

  background: none;

  color: white;

  cursor: pointer;

  font-size: 18px;
}

/* BODY */

.chatMessages {
  flex: 1;

  overflow-y: auto;

  padding: 15px;

  background: #f8fafc;

  display: flex;

  flex-direction: column;

  gap: 15px;

  scroll-behavior: smooth;
}

/* BOT */

.bot-row {
  display: flex;

  gap: 10px;

  align-items: flex-start;
}

.bot-avatar {
  width: 36px;

  height: 36px;

  border-radius: 50%;

  background: #2563eb;

  color: white;

  display: flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;
}

.bot-message {
  background: white;

  border-radius: 16px 16px 16px 4px;

  padding: 14px;

  max-width: 82%;

  border: 1px solid #e5e7eb;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);

  animation: fade 0.3s;
}

.bot-message h4 {
  margin-bottom: 8px;

  color: #2563eb;

  font-size: 15px;
}

.bot-message p {
  font-size: 14px;

  color: #555;

  line-height: 1.7;
}

/* USER */

.user-row {
  display: flex;

  justify-content: flex-end;
}

.user-message {
  max-width: 75%;

  background: #d9fdd3;

  border-radius: 16px 16px 4px 16px;

  padding: 12px 15px;

  font-size: 14px;

  animation: fade 0.3s;
}

.chat-time {
  margin-top: 5px;

  text-align: right;

  font-size: 11px;

  color: #777;
}

/* BUTTON MENU */

.chat-buttons {
  margin-top: 15px;

  display: flex;

  flex-direction: column;

  gap: 8px;
}

.chat-buttons button {
  width: 100%;

  padding: 12px;

  text-align: left;

  background: white;

  border: 1px solid #e5e7eb;

  border-radius: 10px;

  cursor: pointer;

  color: #2563eb;

  font-weight: 500;

  transition: 0.2s;
}

.chat-buttons button:hover {
  background: #2563eb;

  color: white;
}

/* NAV */

.chat-nav {
  display: flex;

  gap: 10px;

  margin-top: 15px;
}

.chat-nav button {
  flex: 1;

  border: none;

  background: #f3f4f6;

  padding: 10px;

  border-radius: 8px;

  cursor: pointer;

  transition: 0.2s;
}

.chat-nav button:hover {
  background: #2563eb;

  color: white;
}

/* TOGGLE */

#chatbotToggle {
  position: fixed;

  right: 25px;

  bottom: 25px;

  width: 60px;

  height: 60px;

  border: none;

  border-radius: 50%;

  background: #2563eb;

  color: white;

  font-size: 28px;

  cursor: pointer;

  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.35);

  z-index: 1000;
}

/* ANIMATION */

@keyframes fade {
  from {
    opacity: 0;

    transform: translateY(10px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

#scrollBottomBtn {
  position: absolute;

  right: 15px;

  bottom: 15px;

  width: 42px;

  height: 42px;

  border: none;

  border-radius: 50%;

  background: #2563eb;

  color: white;

  cursor: pointer;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

  display: none;

  transition: 0.3s;

  z-index: 101;
}

#scrollBottomBtn:hover {
  transform: scale(1.1);
}

.fa-arrow-down {
  position: relative;
  height: 30px;
  left: 9px;
  bottom: -5px;
}
