/* Focus Bot — Studio 6% assistant. Scoped under .fb- to avoid theme collisions. */
:root {
  --fb-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --fb-accent: #667eea;
  --fb-accent-2: #764ba2;
  --fb-bot-bg: #f1f2f7;
  --fb-bot-fg: #23252b;
  --fb-user-fg: #ffffff;
  --fb-panel-bg: #ffffff;
  --fb-muted: #8a8f9c;
  --fb-border: #e7e8ee;
  --fb-radius: 18px;
  --fb-shadow: 0 18px 50px rgba(37, 40, 64, 0.28);
}

/* ---------- Launcher ---------- */
.fb-launcher {
  position: fixed;
  bottom: 96px;               /* sits above the existing "Book Now" pill */
  right: 30px;
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 50%;
  background: var(--fb-grad);
  color: #fff;
  cursor: pointer;
  z-index: 99990;
  box-shadow: 0 8px 22px rgba(102, 126, 234, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
}
.fb-launcher:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 28px rgba(102,126,234,.6); }
.fb-launcher:focus-visible { outline: 3px solid rgba(102,126,234,.5); outline-offset: 3px; }
.fb-launcher svg { width: 30px; height: 30px; display: block; }
.fb-launcher .fb-close-ico { display: none; }
.fb-open .fb-launcher { opacity: 0; pointer-events: none; transform: scale(.6); }

/* subtle pulse to draw the eye, once */
.fb-launcher.fb-pulse::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(102,126,234,.45);
  animation: fb-pulse 2.2s ease-out 3;
}
@keyframes fb-pulse { to { box-shadow: 0 0 0 22px rgba(102,126,234,0); } }

/* one-time nudge bubble */
.fb-nudge {
  position: fixed;
  bottom: 108px;
  right: 104px;
  max-width: 220px;
  background: #fff;
  color: #23252b;
  padding: 10px 14px;
  border-radius: 14px 14px 2px 14px;
  box-shadow: var(--fb-shadow);
  font-size: 13.5px;
  line-height: 1.35;
  z-index: 99989;
  cursor: pointer;
  animation: fb-fade-in .35s ease both;
}
.fb-nudge b { color: var(--fb-accent-2); }
.fb-nudge-close { position:absolute; top:2px; right:6px; border:none; background:none; color:var(--fb-muted); cursor:pointer; font-size:15px; line-height:1; }

/* ---------- Panel ---------- */
.fb-panel {
  position: fixed;
  bottom: 96px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--fb-panel-bg);
  border-radius: var(--fb-radius);
  box-shadow: var(--fb-shadow);
  z-index: 99991;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(.98);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.fb-open .fb-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* hide the site's Book Now pill while the chat is open (avoids overlap) */
body.fb-open .floating-book-btn { opacity: 0 !important; pointer-events: none !important; }

/* ---------- Header ---------- */
.fb-header {
  background: var(--fb-grad);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fb-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.fb-avatar svg { width: 24px; height: 24px; }
.fb-id { flex: 1 1 auto; min-width: 0; }
.fb-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.fb-status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.fb-status .fb-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 rgba(52,211,153,.7); animation: fb-live 2s infinite; }
@keyframes fb-live { 0%{box-shadow:0 0 0 0 rgba(52,211,153,.6)} 70%{box-shadow:0 0 0 6px rgba(52,211,153,0)} 100%{box-shadow:0 0 0 0 rgba(52,211,153,0)} }
.fb-header-btn {
  border: none; background: rgba(255,255,255,.16); color: #fff;
  border-radius: 9px; cursor: pointer; padding: 6px 10px; font-size: 12px; font-weight: 700;
  transition: background .2s ease;
}
.fb-header-btn:hover { background: rgba(255,255,255,.3); }
.fb-x { width: 32px; height: 32px; padding: 0; font-size: 20px; line-height: 1; border-radius: 50%; }

/* ---------- Messages ---------- */
.fb-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px 8px;
  background: #fafbfe;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.fb-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; animation: fb-fade-in .25s ease both; }
.fb-msg a { color: inherit; text-decoration: underline; }
.fb-bot  { align-self: flex-start; background: var(--fb-bot-bg); color: var(--fb-bot-fg); border-bottom-left-radius: 5px; }
.fb-user { align-self: flex-end; background: var(--fb-grad); color: var(--fb-user-fg); border-bottom-right-radius: 5px; }

@keyframes fb-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* typing indicator */
.fb-typing { align-self: flex-start; background: var(--fb-bot-bg); padding: 12px 16px; border-radius: 16px; border-bottom-left-radius: 5px; display: inline-flex; gap: 4px; }
.fb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b7bcca; animation: fb-bounce 1.2s infinite; }
.fb-typing span:nth-child(2){ animation-delay: .2s; }
.fb-typing span:nth-child(3){ animation-delay: .4s; }
@keyframes fb-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.6 } 30%{ transform: translateY(-5px); opacity:1 } }

/* ---------- Quick replies ---------- */
.fb-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 14px 4px; background: #fafbfe; }
.fb-chip {
  border: 1px solid var(--fb-accent);
  color: var(--fb-accent-2);
  background: #fff;
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.fb-chip:hover { background: var(--fb-grad); color: #fff; border-color: transparent; transform: translateY(-1px); }

/* ---------- Composer ---------- */
.fb-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--fb-border); background: #fff; }
.fb-input {
  flex: 1 1 auto;
  border: 1px solid var(--fb-border);
  border-radius: 22px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-family: inherit;
  resize: none;
  max-height: 96px;
  line-height: 1.4;
  outline: none;
  transition: border-color .2s ease;
}
.fb-input:focus { border-color: var(--fb-accent); }
.fb-send {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: var(--fb-grad); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, opacity .2s ease;
}
.fb-send:hover { transform: scale(1.06); }
.fb-send:disabled { opacity: .5; cursor: default; transform: none; }
.fb-send svg { width: 20px; height: 20px; }
.fb-foot { text-align: center; font-size: 10.5px; color: var(--fb-muted); padding: 0 0 6px; background:#fff; }

/* ---------- RTL / Arabic ---------- */
.fb-rtl { direction: rtl; }
.fb-rtl .fb-launcher,
.fb-rtl .fb-panel { /* keep on the right to avoid the RTL booking button (which moves left) */ right: 30px; left: auto; }
.fb-rtl .fb-nudge { right: auto; left: 104px; border-radius: 14px 14px 14px 2px; }
.fb-rtl .fb-bot  { align-self: flex-start; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.fb-rtl .fb-user { align-self: flex-end; border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .fb-launcher { bottom: 80px; right: 18px; width: 56px; height: 56px; }
  .fb-panel {
    right: 0; left: 0; bottom: 0;
    width: 100vw; max-width: 100vw;
    height: 88vh; max-height: 88vh;
    border-radius: 18px 18px 0 0;
  }
  .fb-nudge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-launcher, .fb-panel, .fb-msg, .fb-status .fb-dot, .fb-launcher.fb-pulse::after { animation: none !important; transition: none !important; }
}
