/* AUEM Chatbot Widget — Refined Warm Luxury System */

.auem-chat-launcher {
  position: fixed;
  inset-inline-end: 1.5rem;
  bottom: 1.5rem;
  z-index: 95;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 32% 28%, #fff 0%, oklch(0.97 0.02 95) 55%, oklch(0.90 0.06 90) 100%);
  color: oklch(0.16 0.045 168);
  border: 1.5px solid oklch(0.86 0.135 92);
  box-shadow: 0 12px 32px oklch(0.30 0.06 166 / 0.35), 0 0 24px oklch(0.82 0.15 90 / 0.35), inset 0 1px 0 #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* soft gold pulse ring behind the medallion */
.auem-chat-launcher::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid oklch(0.82 0.15 90 / 0.55);
  animation: auem-chat-pulse 2.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

@keyframes auem-chat-pulse {
  0%   { transform: scale(0.92); opacity: 0.9; }
  70%  { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auem-chat-launcher::before { animation: none; opacity: 0; }
}

.auem-chat-launcher:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 18px 40px oklch(0.30 0.06 166 / 0.45), 0 0 32px oklch(0.82 0.15 90 / 0.5), inset 0 1px 0 #fff;
}

.auem-chat-launcher .auem-chat-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px oklch(0.30 0.06 166 / 0.25));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auem-chat-launcher:hover .auem-chat-logo {
  transform: scale(1.06) rotate(3deg);
}

/* live-assistant status dot */
.auem-chat-launcher .auem-chat-ping {
  position: absolute;
  inset-inline-end: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: oklch(0.55 0.13 155);
  border: 2px solid #fff;
  box-shadow: 0 0 8px oklch(0.55 0.13 155 / 0.7);
}

.auem-chat-panel {
  position: fixed;
  inset-inline-end: 1.5rem;
  bottom: 6rem;
  z-index: 95;
  width: min(390px, calc(100vw - 2.5rem));
  height: min(580px, calc(100vh - 7.5rem));
  background: linear-gradient(155deg, oklch(0.22 0.055 166 / 0.95), oklch(0.17 0.045 168 / 0.98));
  backdrop-filter: blur(25px) saturate(1.5);
  -webkit-backdrop-filter: blur(25px) saturate(1.5);
  border-radius: 22px;
  border: 1px solid oklch(0.82 0.14 90 / 0.3);
  box-shadow: 0 25px 60px oklch(0.08 0.03 170 / 0.8), 0 0 35px oklch(0.82 0.14 90 / 0.2), inset 0 1px 0 oklch(1 0 0 / 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.auem-chat-panel.open { display: flex; }

.auem-chat-head {
  background: linear-gradient(135deg, oklch(0.26 0.065 165), oklch(0.20 0.052 168));
  border-bottom: 1px solid oklch(0.82 0.14 90 / 0.25);
  color: oklch(0.98 0.012 90);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auem-chat-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: oklch(0.86 0.135 92);
  box-shadow: 0 0 12px oklch(0.86 0.135 92);
}

.auem-chat-head strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auem-chat-head small {
  display: block;
  color: oklch(0.84 0.024 86);
  font-size: 0.76rem;
  margin-top: 0.1rem;
}

.auem-chat-close {
  margin-inline-start: auto;
  background: oklch(0.82 0.14 90 / 0.12);
  border: 1px solid oklch(0.82 0.14 90 / 0.3);
  border-radius: 8px;
  color: oklch(0.92 0.105 95);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  transition: all 0.2s;
}

.auem-chat-close:hover {
  background: oklch(0.82 0.14 90 / 0.25);
  color: #fff;
}

.auem-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: radial-gradient(circle at 50% 0%, oklch(0.82 0.14 90 / 0.06), transparent 70%);
}

/* hosted-chat embed mode (Chatbase / Botpress iframe fills the panel) */
.auem-chat-embed {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  display: none; /* revealed only once its tier wins */
}

.auem-chat-panel.embedded .auem-chat-body {
  padding: 0.6rem;
  overflow: hidden;
}

.auem-chat-panel.embedded .auem-chat-embed {
  display: block;
}

.auem-chat-panel.embedded .auem-chat-input {
  display: none;
}

.auem-msg {
  max-width: 84%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.6;
}

.auem-msg.bot {
  background: linear-gradient(135deg, oklch(0.25 0.062 165), oklch(0.20 0.05 168));
  border: 1px solid oklch(0.82 0.14 90 / 0.22);
  color: oklch(0.95 0.015 90);
  border-start-start-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 4px 15px oklch(0.10 0.03 170 / 0.4);
}

.auem-msg.user {
  background: linear-gradient(135deg, oklch(0.92 0.105 95), oklch(0.79 0.155 88));
  color: oklch(0.16 0.045 168);
  font-weight: 600;
  border: 1px solid oklch(0.92 0.105 95);
  align-self: flex-end;
  border-start-end-radius: 4px;
  box-shadow: 0 4px 18px oklch(0.82 0.14 90 / 0.35);
}

.auem-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 0 0.5rem;
}

.auem-chip {
  border: 1px solid oklch(0.82 0.14 90 / 0.45);
  color: oklch(0.92 0.105 95);
  background: oklch(0.82 0.14 90 / 0.12);
  border-radius: 9999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auem-chip:hover {
  background: linear-gradient(135deg, oklch(0.86 0.135 92), oklch(0.70 0.145 84));
  color: oklch(0.16 0.045 168);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px oklch(0.82 0.14 90 / 0.4);
}

.auem-chat-input {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem;
  border-top: 1px solid oklch(0.82 0.14 90 / 0.2);
  background: oklch(0.18 0.05 168 / 0.95);
}

.auem-chat-input input {
  flex: 1;
  font: inherit;
  font-size: 0.92rem;
  color: oklch(0.98 0.012 90);
  border: 1px solid oklch(0.82 0.14 90 / 0.25);
  border-radius: 9999px;
  padding: 0.65rem 1.1rem;
  outline: none;
  background: oklch(0.22 0.058 166 / 0.85);
  transition: all 0.25s;
}

.auem-chat-input input::placeholder {
  color: oklch(0.72 0.028 85);
}

.auem-chat-input input:focus {
  border-color: oklch(0.86 0.135 92);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 90 / 0.25), 0 0 16px oklch(0.82 0.14 90 / 0.3);
}

.auem-chat-input button {
  border: 1px solid oklch(0.92 0.105 95);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  background: linear-gradient(135deg, oklch(0.92 0.105 95), oklch(0.79 0.155 88));
  color: oklch(0.16 0.045 168);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px oklch(0.82 0.14 90 / 0.35);
  transition: transform 0.25s;
}

.auem-chat-input button:hover {
  transform: scale(1.08);
}

.auem-chat-input button svg {
  width: 19px;
  height: 19px;
}

/* --- Mobile Responsiveness for Chatbot --- */
@media (max-width: 640px) {
  .auem-chat-launcher {
    width: 52px;
    height: 52px;
    inset-inline-end: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .auem-chat-launcher svg {
    width: 24px;
    height: 24px;
  }
  .auem-chat-panel {
    inset-inline: 0.75rem;
    bottom: max(4.6rem, calc(env(safe-area-inset-bottom) + 4.2rem));
    width: auto;
    max-width: none;
    height: min(520px, calc(100vh - 6.5rem));
    border-radius: 18px;
  }
  .auem-chat-input input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 0.6rem 0.95rem;
  }
}

@media (max-width: 480px) {
  .auem-chat-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    z-index: 100;
  }
  .auem-chat-head {
    padding-top: max(1.1rem, env(safe-area-inset-top));
  }
  .auem-chat-input {
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }
}

/* Botpress Webchat Mobile Container Alignment */
#bp-webchat-container,
#webchat-root,
.bpWebchat {
  z-index: 99999 !important;
}
