/* ask-widget.css
   Design: deep sage header, warm paper panel, berry send action.
   Calm and clinical-warm, not a generic SaaS chat bubble kit. */

:root {
  --ask-sage: #6b4670;
  --ask-sage-dark: #55374f;
  --ask-berry: #8c3b4a;
  --ask-berry-dark: #74303c;
  --ask-paper: #f6f4ef;
  --ask-white: #ffffff;
  --ask-ink: #2c2a28;
  --ask-ink-soft: #5c5852;
  --ask-line: #dfd9cd;
  --ask-radius: 16px;
  --ask-font: "Work Sans", "Noto Sans Bengali", "Noto Sans Devanagari", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ask-fab-bottom: 96px;
  --ask-panel-bottom: 166px;
}

.ask-fab {
  position: fixed;
  right: 30px;
  bottom: var(--ask-fab-bottom);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ask-sage);
  color: var(--ask-white);
  border: none;
  box-shadow: 0 6px 20px rgba(107, 70, 112, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
  transition: transform 0.15s ease, box-shadow 0.15s ease, bottom 0.3s ease;
  font-family: var(--ask-font);
}
.ask-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(107, 70, 112, 0.4);
}
.ask-fab:focus-visible {
  outline: 3px solid var(--ask-berry);
  outline-offset: 3px;
}
.ask-fab svg { width: 32px; height: 32px; }

.ask-panel {
  position: fixed;
  right: 30px;
  bottom: var(--ask-panel-bottom);
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - var(--ask-panel-bottom) - 24px);
  background: var(--ask-paper);
  border-radius: var(--ask-radius);
  box-shadow: 0 20px 50px rgba(44, 42, 40, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483000;
  font-family: var(--ask-font);
  color: var(--ask-ink);
  border: 1px solid var(--ask-line);
}
.ask-panel.ask-open { display: flex; }

@media (max-width: 480px) {
  .ask-panel {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: min(640px, calc(100vh - 96px));
    height: min(640px, calc(100dvh - 96px)); /* dvh = real visible height on iPhone/Android browsers */
    max-height: none;
  }
  /* Panel is full-width on phones: hide the round button while it is open
     (it would sit on top of the send button). Reappears when panel closes. */
  .ask-panel.ask-open ~ .ask-fab { display: none; }
  /* 16px stops iPhones zooming the whole page when the text box is tapped */
  .ask-panel .ask-input { font-size: 16px; }
  /* Bigger tap target for the close button */
  .ask-panel .ask-close { min-width: 44px; min-height: 44px; font-size: 26px; display: flex; align-items: center; justify-content: center; margin: -8px -8px -8px 0; }
  /* Stop the page behind the chat from scrolling */
  html.ask-lock, html.ask-lock body { overflow: hidden; }
}

.ask-header {
  background: var(--ask-sage);
  color: var(--ask-white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ask-header-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.ask-header-sub { font-size: 12px; color: rgba(255, 255, 255, 0.8); font-weight: 400; margin-top: 2px; }
.ask-close {
  background: none;
  border: none;
  color: var(--ask-white);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 8px;
}
.ask-close:hover { background: rgba(255, 255, 255, 0.15); }

.ask-thread {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ask-msg { max-width: 84%; font-size: 13.5px; line-height: 1.5; }
.ask-msg-user {
  align-self: flex-end;
  background: var(--ask-berry);
  color: var(--ask-white);
  padding: 9px 13px;
  border-radius: 14px 14px 3px 14px;
}
.ask-msg-bot {
  align-self: flex-start;
  background: var(--ask-white);
  border: 1px solid var(--ask-line);
  padding: 10px 13px;
  border-radius: 3px 14px 14px 14px;
}
.ask-msg-bot .ask-disclaimer {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-style: italic;
  color: var(--ask-ink-soft);
  border-top: 1px solid var(--ask-line);
  padding-top: 6px;
}
.ask-msg-sources { margin-top: 8px; font-size: 11.5px; }
.ask-msg-sources a { color: var(--ask-sage-dark); text-decoration: underline; }

.ask-thinking {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 13px;
}
.ask-thinking span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ask-ink-soft);
  opacity: 0.4;
  animation: ask-pulse 1.1s infinite ease-in-out;
}
.ask-thinking span:nth-child(2) { animation-delay: 0.15s; }
.ask-thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) {
  .ask-thinking span { animation: none; opacity: 0.6; }
}

.ask-chips {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ask-chip {
  background: var(--ask-white);
  border: 1px solid var(--ask-line);
  color: var(--ask-ink);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--ask-font);
}
.ask-chip:hover { border-color: var(--ask-sage); color: var(--ask-sage-dark); }

.ask-inputrow {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ask-line);
  background: var(--ask-white);
  flex-shrink: 0;
}
.ask-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--ask-line);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--ask-font);
  max-height: 80px;
  color: var(--ask-ink);
}
.ask-input:focus { outline: 2px solid var(--ask-sage); border-color: var(--ask-sage); }
.ask-send {
  background: var(--ask-berry);
  color: var(--ask-white);
  border: none;
  border-radius: 12px;
  width: 40px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ask-send:hover { background: var(--ask-berry-dark); }
.ask-send:disabled { opacity: 0.5; cursor: not-allowed; }

.ask-whatsapp {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--ask-sage-dark);
  background: var(--ask-paper);
  border-top: 1px solid var(--ask-line);
  text-decoration: none;
}
.ask-whatsapp:hover { text-decoration: underline; }
@media (max-width: 640px) {
  :root { --ask-fab-bottom: 72px; }
  .ask-fab { right: 20px; width: 50px; height: 50px; }
}
/* Pages without the Google-review button: sit the Ask button at the bottom corner */
body:not(.review-pill-on) { --ask-fab-bottom: 30px; --ask-panel-bottom: 100px; }
@media (max-width: 640px) {
  body:not(.review-pill-on) { --ask-fab-bottom: 20px; --ask-panel-bottom: 84px; }
}
