/* =========================================================
   BRICS NDB AI Chatbot Custom CSS
   Orange UI design plus question/answer icons
   ========================================================= */

:root {
  --chat-text: #1f2937;
  --chat-bubble: #f4f6fa;
  --chat-border: #e5e5e5;
  --chat-muted: #b4b4b4;
}

.block-ai-chatbot > h2,
.block-ai-chatbot-block > h2 {
  display: none !important;
}

.ai-live-chat {
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  height: 500px !important;
  min-height: 0 !important;
  max-height: calc(100vh - 48px) !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 40px 0 40px !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16) !important;
  box-sizing: border-box !important;
  font-family: "Montserrat", Arial, sans-serif !important;
  display: none;
}

.ai-live-chat.brics-ndb-chatbot-popup {
  position: fixed !important;
  top: 50% !important;
  right: 64px !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  z-index: 999998 !important;
}
.ai-live-chat.is-chatbot-closed {
  display: none !important;
}
.ai-live-chat.is-chatbot-open {
  display: flex !important;
  flex-direction: column !important;
}

.brics-ndb-chatbot-toggle {
  position: fixed !important;
  top: 50% !important;
  right: 10px !important;
  transform: translateY(-50%) !important;
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: var(--primary-color) !important;
  color: #fff !important;
  box-shadow: 0 7px 18px rgba(109, 109, 109, 0.3) !important;
  cursor: pointer !important;
  z-index: 498 !important;
}
.brics-ndb-chatbot-toggle svg {
  width: 19px !important;
  height: 19px !important;
}

.ai-live-chat header {
  position: relative !important;
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  padding: 9px 40px 9px 15px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--primary-color) !important;
  color: #fff !important;
  border: 0 !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
}
.ai-live-chat header::before,
.ai-live-chat header::after {
  display: none !important;
  content: none !important;
}
.brics-header-icon {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  display: flex !important;
  color: #fff !important;
}
.brics-header-icon svg {
  width: 18px !important;
  height: 18px !important;
}
.brics-header-text {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  padding-left: 10px;
}
.ai-live-chat .chat-name {
  margin: 0 !important;
  padding: 0 !important;
  font-family: Montserrat, sans-serif;
  font-weight: 600 !important;
  font-size: 16px !important;
  letter-spacing: 0px;
  color: var(--contrast-text-color) !important;
  line-height: 15px;
}
.ai-live-chat .chat-name::after {
  content: "Ask me";
  display: block !important;
  margin-top: 2px !important;
  color: var(--contrast-text-color) !important;
  font-family: Montserrat, sans-serif;
  font-weight: 400 !important;
  font-size: 14px !important;
  letter-spacing: 0px;
}
.brics-header-actions {
  position: absolute !important;
  top: 50% !important;
  right: 13px !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  gap: 7px !important;
}
.brics-minimize,
.brics-close {
  width: 13px !important;
  height: 13px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 15px !important;
  line-height: 11px !important;
  cursor: pointer !important;
  overflow: hidden;
}

.ai-live-chat .chat {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  flex-direction: column !important;
  background: #fff !important;
}
.ai-live-chat .chat-history {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 14px 16px 8px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #fff !important;
  box-sizing: border-box !important;
}
.ai-live-chat .chat-user,
.ai-live-chat .chat-time,
.ai-live-chat hr,
.ai-live-chat .chat-message > img {
  display: none !important;
}

/* Design mapping: AI sparkle left, user icon right. */
.ai-live-chat .chat-message {
  width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 7px !important;
  box-sizing: border-box !important;
}
.ai-live-chat .brics-message-answer > .brics-message-icon {
  order: 0 !important;
}
.ai-live-chat .brics-message-answer > .chat-message-content {
  order: 1 !important;
}
.ai-live-chat .brics-message-question > .chat-message-content {
  order: 0 !important;
}
.ai-live-chat .brics-message-question > .brics-message-icon {
  order: 1 !important;
}

.brics-message-icon {
  width: 19px !important;
  height: 19px !important;
  min-width: 19px !important;
  flex: 0 0 19px !important;
  margin: 2px 0 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  border-radius: 50% !important;
  background: var(--primary-color) !important;
  box-shadow: 0 2px 4px rgba(255, 125, 85, 0.2) !important;
}
.brics-message-icon svg {
  width: 11px !important;
  height: 11px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  fill: #fff !important;
}

.ai-live-chat .chat-message-content {
  width: fit-content !important;
  min-width: 0 !important;
  max-width: calc(100% - 26px) !important;
  margin: 0 !important;
  padding: 8px 11px !important;
  background: var(--chat-bubble) !important;
  border-radius: 0 13px !important;
  color: var(--chat-text) !important;
  box-sizing: border-box !important;
  overflow-wrap: anywhere !important;
}
.ai-live-chat .chat-message-message,
.ai-live-chat .chat-message-message p {
  margin: 0 !important;
  color: var(--chat-text) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 16px !important;
}
.ai-live-chat .chat-message-message h1 {
  font-size: 17px !important;
}
.ai-live-chat .chat-message-message h2 {
  font-size: 15px !important;
}
.ai-live-chat .chat-message-message h3 {
  font-size: 13px !important;
}
.ai-live-chat .chat-message-message h4 {
  font-size: 12px !important;
}
.ai-live-chat .chat-message-message ul,
.ai-live-chat .chat-message-message ol {
  margin: 5px 0 0 !important;
  padding-left: 17px !important;
}
.ai-live-chat .chat-message-message li {
  margin-bottom: 3px !important;
  font-size: 11px !important;
  line-height: 16px !important;
}
.brics-ndb-suggestions {
  display: none !important;
}

.ai-live-chat .ai-foundation-chat {
  border-top: 1px solid var(--chat-border) !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem;
  padding: 1rem !important;
  align-items: flex-end;
}
.ai-live-chat .ai-foundation-chat .form-type-textarea {
  overflow: hidden !important;
  width: 100% !important;
}

.ai-live-chat .form-item-query {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ai-live-chat .form-textarea-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}
.ai-live-chat .chat-form-query {
  width: 100% !important;
  height: 36px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 9px 45px 9px 12px !important;
  resize: none !important;
  overflow: hidden !important;
  border: 1.5px solid var(--chat-border) !important;
  border-radius: 0 15px 0 15px !important;
  background: #fff !important;
  color: var(--chat-text) !important;
  font-size: 11px !important;
  line-height: 25px !important;
  box-shadow: none !important;
  outline: none !important;
  box-sizing: border-box !important;
}
.ai-live-chat .chat-form-query:focus-within {
  border: 1.5px solid var(--primary-color) !important;
}
.ai-live-chat .chat-form-query::placeholder {
  color: var(--chat-muted) !important;
  opacity: 1 !important;
  font-size: 11px !important;
}
.ai-live-chat input.chat-form-send,
.ai-live-chat button.chat-form-send,
.ai-live-chat .chat-form-send {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 5 !important;
  flex: 0 0 32px !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: var(--primary-color) !important;
  background-image: url("data:image/svg+xml,%3Csvg width='15' height='15' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 12H19M13 6L19 12L13 18' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 15px 15px !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  bottom: 53px;
  left: -1rem;
  text-indent: -9999px !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.ai-live-chat .ai-foundation-chat::after {
  content: var(--bnkp-chat-disclaimer, "");
  text-align: left !important;
  color: var(--warning-title-color);
  font-weight: 400;
  font-size: 9px;
  position: relative;
  margin-top: -50px;
  padding-bottom: 10px;
  height: 40px;
  overflow: hidden auto;
}

.ai-live-chat .ai-foundation-chat input.chat-form-send:disabled,
.ai-live-chat .ai-foundation-chat input.chat-form-send[disabled] {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

@media (max-width: 600px) {
  .ai-live-chat {
    width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    height: calc(100vh - 116px) !important;
    max-height: calc(100vh - 116px) !important;
  }
  .ai-live-chat.brics-ndb-chatbot-popup {
    top: auto !important;
    right: 12px !important;
    bottom: 76px !important;
    transform: none !important;
  }
  .brics-ndb-chatbot-toggle {
    top: auto !important;
    right: 14px !important;
    bottom: 84px !important;
    transform: none !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 9px !important;
  }
}

/* User questions */
.ai-live-chat .brics-message-question {
  display: flex !important;
  justify-content: flex-end !important;
  width: 100% !important;
}

/* Bot answers */
.ai-live-chat .brics-message-answer {
  display: flex !important;
  justify-content: flex-start !important;
  width: 100% !important;
}

.ai-live-chat.is-chatbot-minimized {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  right: 10px !important;
  bottom: 24px !important;
  top: auto !important;
  width: 320px !important;
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  transform: none !important;
  overflow: hidden !important;
}

.ai-live-chat.is-chatbot-minimized .chat,
.ai-live-chat.is-chatbot-minimized .ai-foundation-chat {
  display: none !important;
}

.ai-live-chat .brics-minimize span.minus {
  display: block;
}
.ai-live-chat.is-chatbot-minimized .brics-minimize span.minus {
  display: none;
}
.ai-live-chat .brics-minimize span.plus {
  display: none;
}
.ai-live-chat.is-chatbot-minimized .brics-minimize span.plus {
  display: block;
}
.ai-live-chat .chat-name::before {
  content: inherit !important;
}
@media (max-width: 600px) {
  .ai-live-chat.is-chatbot-minimized {
    bottom: 140px !important;
  }
  .uw-widget-custom-trigger {
    bottom: 10px !important;
  }
}
