/* AI Dread chat widget. Hello Elementor's reset.css loads late and restyles buttons, hence the !important guards on buttons. */
.aidread {
  --ad-blue: #288DD1;
  --ad-blue-dark: #1C6FA8;
  --ad-orange: #E75012;
  --ad-ink: #1F2933;
  --ad-muted: #616E7C;
  --ad-line: #E4E7EB;
  --ad-soft: #F3F7FB;
  position: fixed; bottom: 20px; z-index: 999999;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; color: var(--ad-ink);
}
.aidread--right { right: 20px; }
.aidread--left { left: 20px; }
.aidread *, .aidread *::before, .aidread *::after { box-sizing: border-box; }

.aidread .aidread-bubble {
  display: flex !important; align-items: center; gap: 10px; margin: 0 !important;
  padding: 6px 18px 6px 6px !important; border: 0 !important; border-radius: 999px !important;
  background: var(--ad-blue) !important; color: #fff !important; font: 600 15px/1 Poppins, system-ui, sans-serif !important;
  box-shadow: 0 6px 20px rgba(16, 42, 67, .28) !important; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important;
  transition: transform .15s ease, background .15s ease;
}
.aidread--left .aidread-bubble { margin-right: auto !important; }
.aidread--right .aidread-bubble { margin-left: auto !important; }
.aidread .aidread-bubble:hover { background: var(--ad-blue-dark) !important; transform: translateY(-2px); }
.aidread .aidread-bubble:focus-visible { outline: 3px solid var(--ad-orange) !important; outline-offset: 3px; }
.aidread-bubble img { width: 48px; height: 48px; border-radius: 50%; background: #fff; display: block; }

.aidread-panel {
  position: absolute; bottom: 72px; width: 380px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 110px); display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 48px rgba(16, 42, 67, .3);
}
.aidread--right .aidread-panel { right: 0; }
.aidread--left .aidread-panel { left: 0; }
.aidread-panel[hidden] { display: none; }

.aidread-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--ad-blue); color: #fff; }
.aidread-head img { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex: none; }
.aidread-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aidread-head-text strong { font-size: 17px; font-weight: 700; }
.aidread-head-text span { font-size: 13px; opacity: .9; }
.aidread .aidread-close {
  width: 36px; height: 36px; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: transparent !important; color: #fff !important; cursor: pointer; display: flex !important; align-items: center; justify-content: center;
}
.aidread .aidread-close:hover { background: rgba(255, 255, 255, .18) !important; }

.aidread-log { flex: 1; overflow-y: auto; padding: 16px; background: var(--ad-soft); display: flex; flex-direction: column; gap: 10px; }
.aidread-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.aidread-msg-avatar { width: 28px; height: 28px; border-radius: 50%; background: #fff; flex: none; }
.aidread-msg-body { padding: 10px 13px; border-radius: 16px; max-width: 85%; overflow-wrap: anywhere; }
.aidread-msg-body p { margin: 0 0 8px; }
.aidread-msg-body p:last-child, .aidread-msg-body ul:last-child { margin-bottom: 0; }
.aidread-msg-body ul { margin: 0 0 8px; padding-left: 18px; }
.aidread-msg-body li { margin: 2px 0; }
.aidread-msg-body a { color: var(--ad-blue-dark); text-decoration: underline; }
.aidread-msg--bot .aidread-msg-body { background: #fff; border: 1px solid var(--ad-line); border-bottom-left-radius: 4px; }
.aidread-msg--me { justify-content: flex-end; }
.aidread-msg--me .aidread-msg-body { background: var(--ad-blue); color: #fff; border-bottom-right-radius: 4px; }
.aidread-msg--me .aidread-msg-body a { color: #fff; }

.aidread-typing .aidread-msg-body { display: flex; gap: 4px; padding: 14px; margin-left: 36px; }
.aidread-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ad-muted); animation: aidread-dot 1.2s infinite ease-in-out; }
.aidread-typing span:nth-child(2) { animation-delay: .15s; }
.aidread-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aidread-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.aidread-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; background: #fff; }
.aidread-chips[hidden] { display: none; }
.aidread .aidread-chip {
  margin: 0 !important; padding: 7px 12px !important; border: 1px solid var(--ad-blue) !important; border-radius: 999px !important;
  background: #fff !important; color: var(--ad-blue-dark) !important; font: 500 13px/1.2 Poppins, system-ui, sans-serif !important;
  cursor: pointer; text-transform: none !important; letter-spacing: 0 !important;
}
.aidread .aidread-chip:hover { background: var(--ad-soft) !important; }

.aidread-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: #fff; border-top: 1px solid var(--ad-line); }
.aidread .aidread-input {
  flex: 1; min-height: 42px; max-height: 120px; resize: none; overflow-y: hidden; margin: 0; padding: 10px 12px !important;
  border: 1px solid #CBD2D9 !important; border-radius: 12px !important; background: #fff !important; color: var(--ad-ink) !important;
  font: 15px/1.4 Poppins, system-ui, sans-serif !important; box-shadow: none !important;
}
.aidread .aidread-input:focus { outline: none; border-color: var(--ad-blue) !important; box-shadow: 0 0 0 3px rgba(40, 141, 209, .18) !important; }
.aidread .aidread-send {
  width: 42px; height: 42px; flex: none; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 12px !important;
  background: var(--ad-orange) !important; color: #fff !important; cursor: pointer; display: flex !important; align-items: center; justify-content: center;
}
.aidread .aidread-send:hover { background: #C94409 !important; }
.aidread .aidread-send:disabled { opacity: .5; cursor: default; }

.aidread-foot { padding: 0 14px 10px; background: #fff; font-size: 11.5px; color: var(--ad-muted); line-height: 1.4; }
.aidread-foot a { color: var(--ad-muted); }

/* The WhatsApp button sits under the open panel; hide it while chatting. */
body.aidread-open .wa__btn_popup, body.aidread-open .wa__popup_chat_box { display: none !important; }

@media (max-width: 600px) {
  .aidread { bottom: 14px; }
  .aidread--right { right: 14px; }
  .aidread--left { left: 14px; }
  .aidread .aidread-bubble { padding: 4px !important; }
  .aidread-bubble-label { display: none; }
  .aidread-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
  body.aidread-open { overflow: hidden; }
  body.aidread-open .aidread-bubble { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .aidread .aidread-bubble, .aidread-typing span { transition: none; animation: none; }
}
