/* DentaBot floating chat widget — styled after the Voiceflow webchat
   ("Speak To Reception", Anzac Avenue Dental). */

.db-widget,
.db-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  /* Disables double-tap-to-zoom on the widget's controls (mobile) */
  touch-action: manipulation;
}

:root {
  --db-navy: #253a52;
  --db-navy-dark: #1d2f43;
  --db-bubble: #f1f1f3;
  --db-chip: #e9eef5;
  --db-chip-hover: #dbe4ef;
  --db-text: #1a1e23;
  --db-subtle: #72767d;
  --db-border: #dde3ec;
}

/* ---------- Launcher ---------- */

.db-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--db-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 27, 41, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}
.db-launcher:hover {
  background: var(--db-navy-dark);
  transform: translateY(-1px);
}
.db-launcher img {
  width: 24px;
  height: 24px;
  display: block;
}

/* Round chevron button shown while the panel is open */
.db-launcher.db-launcher--open {
  padding: 0;
  width: 52px;
  height: 52px;
  justify-content: center;
}
.db-launcher.db-launcher--open img {
  display: none;
}
.db-launcher .db-chevron {
  display: none;
  width: 20px;
  height: 20px;
}
.db-launcher.db-launcher--open .db-chevron {
  display: block;
}
.db-launcher.db-launcher--open .db-launcher-label {
  display: none;
}

/* ---------- Panel ---------- */

.db-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 2147483000;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: min(704px, calc(100dvh - 130px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(16, 27, 41, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.db-panel.db-panel--open {
  display: flex;
}

@media (max-width: 480px) {
  .db-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh; /* fallback for older browsers */
    height: 100dvh;
    border-radius: 0;
  }
  /* Panel is full-screen on mobile; the header X is the close control,
     so hide the floating chevron (it overlapped the input row). */
  .db-launcher.db-launcher--open {
    display: none;
  }
}

/* ---------- Header ---------- */

.db-header {
  background: var(--db-navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  flex-shrink: 0;
}
.db-header img {
  width: 26px;
  height: 26px;
}
.db-header-title {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}
.db-header button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  opacity: 0.85;
}
.db-header button:hover {
  opacity: 1;
}
.db-header button svg {
  width: 18px;
  height: 18px;
}

/* ---------- Body ---------- */

.db-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 8px;
}

.db-hero {
  text-align: center;
  padding: 12px 16px 24px;
}
.db-hero-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--db-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.db-hero-logo img {
  width: 56px;
  height: 56px;
}
.db-hero-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--db-text);
  margin-bottom: 6px;
}
.db-hero-sub {
  font-size: 14px;
  color: var(--db-subtle);
  line-height: 1.45;
}

/* ---------- Messages ---------- */

.db-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 10px 0;
}
.db-row--user {
  justify-content: flex-end;
}
.db-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--db-border);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-avatar img {
  width: 18px;
  height: 18px;
}
.db-bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.db-bubble--bot {
  background: var(--db-bubble);
  color: var(--db-text);
}
.db-bubble--user {
  background: var(--db-navy);
  color: #fff;
}

/* blinking caret shown while a bot message types out */
.db-bubble--typing::after {
  content: "▍";
  color: var(--db-subtle);
  animation: db-blink 0.9s infinite both;
}

/* typing indicator */
.db-typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px;
}
.db-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8bcc4;
  animation: db-blink 1.2s infinite both;
}
.db-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.db-typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes db-blink {
  0%,
  80%,
  100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}

/* ---------- Button chips ---------- */

.db-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 0 12px;
}
.db-chip {
  background: var(--db-chip);
  color: var(--db-navy);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}
.db-chip:hover {
  background: var(--db-chip-hover);
}

/* ---------- Input ---------- */

.db-input-row {
  display: flex;
  align-items: center;
  padding: 10px 12px 4px;
  flex-shrink: 0;
}
.db-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid var(--db-border);
  border-radius: 999px;
  padding: 4px 4px 4px 18px;
  background: #fff;
}
.db-input-wrap:focus-within {
  border-color: var(--db-navy);
}
.db-input {
  flex: 1;
  border: none;
  outline: none;
  /* 16px minimum: iOS Safari force-zooms the page when focusing any
     input with a smaller font, which is what broke the mobile layout. */
  font-size: 16px;
  color: var(--db-text);
  background: transparent;
  padding: 9px 0;
}
.db-input::placeholder {
  color: #9aa0a8;
}
.db-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--db-chip);
  color: var(--db-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.db-send--active {
  background: var(--db-navy);
  color: #fff;
}
.db-send svg {
  width: 17px;
  height: 17px;
}

/* ---------- Footer ---------- */

.db-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--db-subtle);
  padding: 6px 0 10px;
  flex-shrink: 0;
}
