/* ═══════════════════════════════════════════════
   NEVA AI — Floating Chat Widget
   ═══════════════════════════════════════════════ */

/* ── Floating Action Button ── */
/* ── FAB with Avatar ── */
.neva-fab {
  position: fixed;
  bottom: 16px;
  right: clamp(24px, 4vw, 48px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: visible;
  box-shadow: 0 0 0 0 rgba(242, 113, 130, .4);
  animation: nevaGlow 2.5s ease-in-out infinite;
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
  z-index: 9998;
}
@keyframes nevaGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 113, 130, .35); }
  50% { box-shadow: 0 0 0 8px rgba(242, 113, 130, 0); }
}
.neva-fab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent, #f27182);
}
.neva-fab svg { display: none; }
.neva-fab:hover {
  transform: scale(1.06);
  animation: none;
  box-shadow: 0 0 0 6px rgba(242, 113, 130, .15);
}
.neva-fab--open {
  transform: scale(0) !important;
  pointer-events: none;
}

/* ── Proactive Bubble ── */
.neva-bubble {
  position: fixed;
  bottom: 82px;
  right: clamp(24px, 4vw, 48px);
  z-index: 9997;
  max-width: 280px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(40px) saturate(2);
  -webkit-backdrop-filter: blur(40px) saturate(2);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
  opacity: 0;
  transform: translateY(10px) scale(.95);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}
.neva-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.neva-bubble__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none !important;
  font-size: 1rem;
  color: var(--text-muted, #999);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.neva-bubble__text {
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: .82rem;
  color: var(--text-primary, #1a1816);
  line-height: 1.5;
  margin-bottom: 10px;
  padding-right: 16px;
}
.neva-bubble__name {
  font-weight: 600;
  color: var(--accent, #f27182);
}
.neva-bubble__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.neva-bubble__chip {
  font-family: var(--font-body, 'Outfit', sans-serif);
  font-size: .72rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  background: transparent;
  color: var(--text-secondary, #666);
  cursor: pointer;
  transition: all .2s;
}
.neva-bubble__chip:hover {
  border-color: var(--accent, #f27182);
  color: var(--accent, #f27182);
  background: rgba(242, 113, 130, .04);
}
/* Dark mode */
[data-theme="dark"] .neva-bubble {
  background: rgba(20, 18, 16, .92);
  border-color: rgba(255,255,255,.08);
  backdrop-filter: blur(40px) saturate(2);
  -webkit-backdrop-filter: blur(40px) saturate(2);
}
[data-theme="dark"] .neva-bubble__text { color: var(--text-primary); }
[data-theme="dark"] .neva-bubble__chip {
  border-color: rgba(255,255,255,.12);
  color: var(--text-secondary);
}
[data-theme="dark"] .neva-bubble__chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(242,113,130,.08);
}
/* Bubble arrow pointing down to FAB */
.neva-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid rgba(255,255,255,.6);
  border-bottom: 1px solid rgba(255,255,255,.6);
  transform: rotate(45deg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
[data-theme="dark"] .neva-bubble::after {
  background: rgba(20, 18, 16, .85);
  border-color: rgba(255,255,255,.08);
}

/* ── Chat Window ── */
.neva-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(400px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 48px));
  background: #0c0b0a;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
  opacity: 0;
  transform: translateY(20px) scale(.95);
  transition: opacity .3s cubic-bezier(.16, 1, .3, 1), transform .3s cubic-bezier(.16, 1, .3, 1);
}
.neva-chat--open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Header ── */
.neva-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.neva-chat__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.neva-chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f27182 30%, #c56bdb);
}
.neva-chat__title {
  font-size: .9rem;
  font-weight: 600;
  color: #f5f3f0;
}
.neva-chat__beta {
  font-size: .55rem;
  font-weight: 600;
  padding: 1px 5px;
  border: 1px solid rgba(242, 113, 130, .4);
  border-radius: 4px;
  color: #f27182;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: .05em;
}
.neva-chat__subtitle {
  font-size: .7rem;
  color: rgba(255, 255, 255, .4);
}
.neva-chat__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .3);
  font-size: 1.4rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.neva-chat__close:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

/* ── Messages ── */
.neva-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .1) transparent;
}
.neva-chat__msg {
  display: flex;
  max-width: 85%;
}
.neva-chat__msg--user {
  align-self: flex-end;
}
.neva-chat__msg--assistant {
  align-self: flex-start;
}
.neva-chat__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .85rem;
  line-height: 1.5;
  word-break: break-word;
}
.neva-chat__msg--assistant .neva-chat__bubble {
  background: rgba(255, 255, 255, .06);
  color: #e8e5e2;
  border-bottom-left-radius: 4px;
}
.neva-chat__msg--user .neva-chat__bubble {
  background: linear-gradient(135deg, #f27182, #d94f60);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.neva-chat__bubble--img {
  padding: 4px;
  background: rgba(255, 255, 255, .08);
}
.neva-chat__bubble--img img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 10px;
  display: block;
}

/* ── Chips ── */
.neva-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}
.neva-chat__chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(242, 113, 130, .35);
  background: rgba(242, 113, 130, .08);
  color: #f27182;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.neva-chat__chip:hover {
  background: rgba(242, 113, 130, .2);
  border-color: #f27182;
}

/* ── Typing indicator ── */
.neva-chat__dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.neva-chat__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  animation: nevaDot 1.2s infinite;
}
.neva-chat__dots span:nth-child(2) { animation-delay: .2s; }
.neva-chat__dots span:nth-child(3) { animation-delay: .4s; }
@keyframes nevaDot {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Input ── */
.neva-chat__input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .02);
}
.neva-chat__input {
  flex: 1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  padding: 10px 16px;
  color: #f5f3f0;
  font-size: .85rem;
  outline: none;
  transition: border-color .2s;
}
.neva-chat__input::placeholder {
  color: rgba(255, 255, 255, .25);
}
.neva-chat__input:focus {
  border-color: rgba(242, 113, 130, .5);
}
.neva-chat__photo-btn {
  cursor: pointer;
  color: rgba(255, 255, 255, .3);
  transition: color .2s;
  display: flex;
  padding: 4px;
}
.neva-chat__photo-btn:hover {
  color: #f27182;
}
.neva-chat__send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f27182, #d94f60);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
  flex-shrink: 0;
}
.neva-chat__send:hover {
  transform: scale(1.08);
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .neva-chat {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .neva-fab {
    bottom: 16px;
    right: 16px;
  }
}

/* ── Position above booking pill when present ── */
.booking-pill ~ .neva-fab {
  bottom: 92px;
}
.booking-pill ~ .neva-bubble {
  bottom: 158px;
}
@media (max-width: 767px) {
  .booking-pill ~ .neva-fab {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 48px;
    height: 48px;
  }
  .booking-pill ~ .neva-fab svg {
    width: 20px;
    height: 20px;
  }
}
