/* =============================================================
   Whishess AI Assistant — luxury concierge widget
   ============================================================= */

.wf-ai-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 50%;
  background: rgba(21, 16, 28, 0.94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: #c9a96e;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(201, 169, 110, 0.25);
  transition:
    transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.25s ease,
    border-color 0.25s ease;
  animation: wfAiPulse 3.2s ease-in-out infinite;
}

.wf-ai-btn:hover {
  transform: translateY(-3px) scale(1.04);
  background: rgba(201, 169, 110, 0.14);
  border-color: rgba(201, 169, 110, 0.75);
  box-shadow: 0 0 22px rgba(201, 169, 110, 0.22), 0 14px 32px rgba(0, 0, 0, 0.45);
}

.wf-ai-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.35), 0 10px 26px rgba(0, 0, 0, 0.45);
}

.wf-ai-btn.is-open {
  animation: none;
  background: rgba(201, 169, 110, 0.18);
  border-color: #c9a96e;
}

.wf-ai-btn svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

@keyframes wfAiPulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(201, 169, 110, 0.2); }
  50%      { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(201, 169, 110, 0); }
}

/* Widget panel */
.wf-ai-widget {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + 58px + 0.85rem);
  z-index: 9998;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(620px, calc(100vh - 7.5rem));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(201, 169, 110, 0.28);
  background: linear-gradient(155deg, rgba(28, 20, 36, 0.97), rgba(14, 10, 20, 0.98));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 0.34s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.34s;
  pointer-events: none;
}

.wf-ai-widget.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wf-ai-widget-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.14);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.wf-ai-widget-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.22), rgba(150, 96, 196, 0.15));
  border: 1px solid rgba(201, 169, 110, 0.35);
  color: #c9a96e;
  flex-shrink: 0;
}

.wf-ai-widget-avatar svg {
  width: 22px;
  height: 22px;
}

.wf-ai-widget-meta {
  flex: 1;
  min-width: 0;
}

.wf-ai-widget-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 400;
  color: #fafafa;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.wf-ai-widget-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.5);
}

.wf-ai-widget-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.wf-ai-widget-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(250, 250, 250, 0.7);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.wf-ai-widget-close:hover {
  background: rgba(201, 169, 110, 0.12);
  color: #fafafa;
  border-color: rgba(201, 169, 110, 0.5);
}

.wf-ai-widget-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.28);
}

.wf-ai-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.wf-ai-widget-body::-webkit-scrollbar {
  width: 5px;
}

.wf-ai-widget-body::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.3);
  border-radius: 999px;
}

/* Messages */
.wf-ai-msg {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 92%;
  animation: wfAiMsgIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes wfAiMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wf-ai-msg--assistant {
  align-self: flex-start;
}

.wf-ai-msg--user {
  align-self: flex-end;
}

.wf-ai-msg-bubble {
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-line;
}

.wf-ai-msg--assistant .wf-ai-msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 169, 110, 0.18);
  color: rgba(250, 250, 250, 0.88);
  border-bottom-left-radius: 6px;
}

.wf-ai-msg--user .wf-ai-msg-bubble {
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.28), rgba(201, 169, 110, 0.14));
  border: 1px solid rgba(201, 169, 110, 0.35);
  color: #fafafa;
  border-bottom-right-radius: 6px;
}

/* Typing indicator */
.wf-ai-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 169, 110, 0.18);
  animation: wfAiMsgIn 0.3s ease both;
}

.wf-ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9a96e;
  animation: wfAiDot 1.2s ease-in-out infinite;
}

.wf-ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.wf-ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wfAiDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%            { transform: translateY(-4px); opacity: 1; }
}

/* FAQ chips */
.wf-ai-faq {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.wf-ai-faq-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.38);
  margin-bottom: 0.15rem;
}

.wf-ai-faq-btn {
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(250, 250, 250, 0.82);
  cursor: pointer;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    color 0.22s ease;
}

.wf-ai-faq-btn:hover {
  background: rgba(201, 169, 110, 0.1);
  border-color: rgba(201, 169, 110, 0.45);
  color: #fafafa;
  transform: translateX(2px);
}

.wf-ai-faq-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.25);
}

.wf-ai-faq-btn.is-used {
  opacity: 0.55;
}

/* Mobile */
@media (max-width: 640px) {
  .wf-ai-btn {
    right: 0.9rem;
    bottom: 0.9rem;
    width: 54px;
    height: 54px;
  }

  .wf-ai-btn svg {
    width: 24px;
    height: 24px;
  }

  .wf-ai-widget {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: calc(0.9rem + 54px + 0.75rem);
    max-height: min(72vh, calc(100vh - 6rem));
    border-radius: 18px;
  }

  .wf-back-to-top {
    right: 0.9rem;
    bottom: calc(0.9rem + 54px + 0.75rem);
  }

  .wf-back-to-top.is-above-widget {
    bottom: calc(0.9rem + 54px + 0.75rem + min(72vh, calc(100vh - 6rem)) + 0.65rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wf-ai-btn,
  .wf-ai-widget,
  .wf-ai-msg,
  .wf-ai-typing span {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
}
