/* ============================================================
   ParenthLabs — Floating Concierge Bubble
   Scoped under .pl-bubble-* — zero risk of colliding with main styles.
   Injected on every page via bubble.js.
   ============================================================ */

/* Nav badge (also used on pages that include bubble.css) */
.nav-hub-link { position: relative; }

.nav-hub-badge {
  display: inline-flex;
  align-items: center;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #16A34A;
  background: #DCFCE7;
  padding: 2px 6px;
  border-radius: 100px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1;
}

/* ── Widget root ────────────────────────────────────────────── */
#pl-bubble-root {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
}

/* ── Trigger button ─────────────────────────────────────────── */
.pl-bubble-trigger {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #0f17af;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(15,23,175,.38);
  transition: transform .2s ease, background .2s ease;
  position: relative;
  z-index: 2;
}

.pl-bubble-trigger:hover {
  transform: scale(1.06);
  background: #080e87;
}

.pl-bubble-trigger svg {
  width: 22px; height: 22px;
  color: #fff;
  transition: opacity .2s, transform .2s;
}

.pl-bubble-trigger .icon-chat    { position: absolute; }
.pl-bubble-trigger .icon-close   { position: absolute; opacity: 0; transform: rotate(-90deg); }

.pl-bubble-trigger.open .icon-chat  { opacity: 0; transform: rotate(90deg); }
.pl-bubble-trigger.open .icon-close { opacity: 1; transform: rotate(0deg); }

/* Notification dot */
.pl-notif-dot {
  position: absolute;
  top: 1px; right: 1px;
  width: 12px; height: 12px;
  background: #22C55E;
  border: 2px solid #fff;
  border-radius: 50%;
  animation: notifPop .4s ease;
}

@keyframes notifPop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Chat panel ─────────────────────────────────────────────── */
.pl-bubble-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 360px;
  height: 500px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.13);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.22,1,.36,1), opacity .2s ease;
}

.pl-bubble-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Panel header */
.pl-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0D1B2A;
  flex-shrink: 0;
}

.pl-panel-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pl-panel-mark {
  width: 30px; height: 30px;
  background: #0f17af;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  flex-shrink: 0;
}

.pl-panel-name {
  display: block;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

.pl-panel-role {
  display: block;
  font-size: .7rem;
  color: rgba(255,255,255,.5);
}

.pl-panel-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
}

.pl-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22C55E;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

/* Hub CTA strip */
.pl-hub-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: #eef0fd;
  border-bottom: 1px solid #c7d0fc;
  flex-shrink: 0;
}

.pl-hub-strip-text {
  font-size: .72rem;
  color: #080e87;
  font-weight: 500;
}

.pl-hub-strip-link {
  font-size: .72rem;
  font-weight: 700;
  color: #0f17af;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color .2s;
  white-space: nowrap;
}

.pl-hub-strip-link:hover { color: #080e87; }

/* Messages */
.pl-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.pl-msg {
  display: flex;
  gap: 8px;
  max-width: 86%;
  animation: plMsgIn .22s ease;
}

@keyframes plMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.pl-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.pl-msg-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem;
  font-weight: 800;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  margin-top: 2px;
}

.pl-msg.agent .pl-msg-av { background: #eef0fd; color: #0f17af; border: 1px solid #c7d0fc; }
.pl-msg.user  .pl-msg-av { background: #0f17af; color: #fff; }

.pl-bubble-text {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: .8375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.pl-msg.agent .pl-bubble-text {
  background: #eef1fb;
  border: 1px solid #E2E8F0;
  border-radius: 3px 12px 12px 12px;
  color: #111827;
}

.pl-msg.user .pl-bubble-text {
  background: #0f17af;
  color: #fff;
  border-radius: 12px 3px 12px 12px;
}

/* Typing dots */
.pl-typing {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.pl-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 13px;
  background: #eef1fb;
  border: 1px solid #E2E8F0;
  border-radius: 3px 12px 12px 12px;
}

.pl-typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #9CA3AF;
  animation: typBounce 1.2s infinite;
}

.pl-typing-dots span:nth-child(2) { animation-delay: .18s; }
.pl-typing-dots span:nth-child(3) { animation-delay: .36s; }

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

/* Input */
.pl-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
  background: #fff;
  align-items: flex-end;
}

.pl-input {
  flex: 1;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: .8375rem;
  color: #111827;
  outline: none;
  font-family: 'Inter', system-ui, sans-serif;
  resize: none;
  min-height: 36px;
  max-height: 90px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color .2s;
  background: #F9FAFB;
}

.pl-input:focus {
  border-color: #0f17af;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,23,175,.09);
}

.pl-input::placeholder { color: #9CA3AF; }

.pl-send {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: #0f17af;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background .2s;
}

.pl-send:hover    { background: #080e87; }
.pl-send:disabled { background: #E2E8F0; cursor: not-allowed; }
.pl-send svg      { width: 15px; height: 15px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  #pl-bubble-root { bottom: 18px; right: 16px; }
  .pl-bubble-panel { width: calc(100vw - 32px); right: 0; }
}

/* ── Hub page: raise bubble so it clears the chat input bar ── */
.page-hub #pl-bubble-root { bottom: 90px; }

/* ── Welcome toast animations ── */
@keyframes plToastIn {
  from { opacity:0; transform:translateY(10px) scale(.96); }
  to   { opacity:1; transform:none; }
}
@keyframes plToastOut {
  to { opacity:0; transform:translateY(6px) scale(.95); }
}
