/* EKOR AI chatbot */
#ekor-chatbot {
  --ekor-chat-green: #198754;
  --ekor-chat-dark: #14532d;
  position: fixed;
  font-family: "Font Awesome 6 Pro";
  right: 24px;
  z-index: 99990;
}

#ekor-chatbot .ekor-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 35px;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--ekor-chat-green);
  color: #fff;
  box-shadow: 0 5px 22px #0003;
  cursor: pointer;
  font-size: 25px;
  z-index: 2147483000;
}

#ekor-chatbot .ekor-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(540px, 70vh, calc(100dvh - 125px));
  max-height: calc(100dvh - 125px);
  min-height: 260px;
  overflow: hidden;
  border: 3px solid #d9e2dc;
  border-radius: 18px;
  background: #fff;
  color: #222;
  box-shadow: 0 10px 40px #0002;
  z-index: 2147483000;
  font-family: var(--default-font);
}

#ekor-chatbot [hidden] {
  display: none !important;
}

#ekor-chatbot .ekor-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--ekor-chat-dark);
  color: #fff;
}

#ekor-chatbot .ekor-chat-title {
  font-weight: 700;
}

#ekor-chatbot .ekor-chat-subtitle {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}

#ekor-chatbot .ekor-chat-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 24px;
}

#ekor-chatbot .ekor-chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
}

#ekor-chatbot .ekor-chat-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#ekor-chatbot .ekor-chat-message.bot {
  align-self: flex-start;
  background: #f0f4f1;
}

#ekor-chatbot .ekor-chat-message.user {
  align-self: flex-end;
  background: #e1f3e7;
}

#ekor-chatbot .ekor-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
}

#ekor-chatbot .ekor-chat-input {
  min-width: 0;
  flex: 1;
  resize: none;
  border: 1px solid #cbd5cf;
  border-radius: 12px;
  padding: 11px;
  font: inherit;
}

#ekor-chatbot .ekor-chat-send {
  align-self: flex-end;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--ekor-chat-green);
  color: #fff;
  cursor: pointer;
}

#ekor-chatbot .ekor-chat-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

#ekor-chatbot .ekor-chat-status {
  padding: 0 12px 8px;
  color: #555;
  font-size: 12px;
}

@media (max-width: 480px) {
  #ekor-chatbot .ekor-chat-launcher {
    right: 24px;
    bottom: 35px;
  }

  #ekor-chatbot .ekor-chat-panel {
    right: 8px;
    bottom: 84px;
    width: calc(100vw - 16px);
    height: min(600px, calc(85dvh - 40px));
    max-height: min(600px, calc(85dvh - 40px));
    min-height: 220px;
    border-radius: 16px;
  }

  #ekor-chatbot .ekor-chat-header {
    padding: 12px;
  }

  #ekor-chatbot .ekor-chat-messages {
    min-height: 0;
    padding: 12px;
  }

  #ekor-chatbot .ekor-chat-form {
    padding: 8px;
  }

  #ekor-chatbot .ekor-chat-input {
    font-size: 16px;
  }
}

@media only screen and (min-width: 576px) and (max-width: 767px), (max-width: 575px) {
  #ekor-chatbot .ekor-chat-launcher {
    height: 50px;
    width: 50px;
  }
}
