/* My Salonn Chat v5 — chat.css */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

#msc {
  --c: #e8637a;
  --c2: #f5a7b5;
  --bg: #fff;
  --msg-bg: #f7f3f4;
  --usr-bg: var(--c);
  --text: #2d1b1f;
  --sub: #9b7f84;
  --radius: 18px;
  --shadow: 0 8px 40px rgba(232,99,122,.22), 0 2px 8px rgba(0,0,0,.08);
  font-family: 'Nunito', sans-serif;
  position: fixed;
  z-index: 999999;
  bottom: 24px;
}

/* ── FAB Button ─────────────────────────────── */
#msc-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c), #c94b63);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(232,99,122,.45);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
  z-index: 999999;
}
#msc-fab.left { right: auto; left: 24px; }
#msc-fab:hover { transform: scale(1.1) rotate(-5deg); box-shadow: 0 10px 36px rgba(232,99,122,.55); }
#msc-fab:active { transform: scale(.95); }

/* ── Pulse ring ─────────────────────────────── */
.msc-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2.5px solid var(--c2);
  animation: mscPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes mscPulse {
  0%,100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.22); opacity: 0; }
}

/* ── Badge ──────────────────────────────────── */
.msc-dot-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  background: #ff3d5a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  transition: transform .3s, opacity .3s;
}
.msc-dot-badge.hide { transform: scale(0); opacity: 0; }

/* ── Icons ──────────────────────────────────── */
.msc-i { width: 26px; height: 26px; transition: opacity .25s, transform .3s; }
.msc-i-chat { opacity: 1; transform: scale(1); }
.msc-i-x   { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.5); }
#msc-fab.on .msc-i-chat { opacity: 0; transform: rotate(90deg) scale(.5); }
#msc-fab.on .msc-i-x    { opacity: 1; transform: rotate(0) scale(1); }

/* ── Chat Window ─────────────────────────────── */
#msc-win {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 370px;
  max-height: 580px;
  background: var(--bg);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(18px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), opacity .25s;
  z-index: 999998;
  border: 1px solid rgba(232,99,122,.12);
}
#msc-win.left { right: auto; left: 24px; }
#msc-win.on {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ──────────────────────────────────── */
.msc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--c) 0%, #c94b63 100%);
  position: relative;
  overflow: hidden;
}
.msc-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.msc-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid rgba(255,255,255,.35);
  flex-shrink: 0;
  position: relative;
}
.msc-hinfo { flex: 1; }
.msc-hname { font-size: 15px; font-weight: 800; color: #fff; line-height: 1.2; letter-spacing: .01em; }
.msc-hsub  { font-size: 12px; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.msc-live {
  width: 7px; height: 7px;
  background: #5DF5A0;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(93,245,160,.3);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; }
  50%  { opacity: .4; }
}
.msc-xbtn {
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  padding: 0;
}
.msc-xbtn svg { width: 18px; height: 18px; }
.msc-xbtn:hover { background: rgba(255,255,255,.28); }

/* ── Messages ─────────────────────────────────── */
.msc-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  background: #fdf8f9;
}
.msc-msgs::-webkit-scrollbar { width: 4px; }
.msc-msgs::-webkit-scrollbar-track { background: transparent; }
.msc-msgs::-webkit-scrollbar-thumb { background: #f0c8d0; border-radius: 4px; }

.msc-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msgIn .28s cubic-bezier(.34,1.3,.64,1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msc-row.usr { flex-direction: row-reverse; }
.msc-row .av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde8ec, #fbd0d8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  border: 1.5px solid rgba(232,99,122,.15);
}

.msc-col { display: flex; flex-direction: column; max-width: 82%; }
.msc-col .bub {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text);
  word-break: break-word;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.04);
  border-bottom-left-radius: 5px;
}
.msc-row.usr .msc-col .bub {
  background: linear-gradient(135deg, var(--c), #d44d67);
  color: #fff;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(232,99,122,.3);
  border: none;
}
.msc-col .ts {
  font-size: 10.5px;
  color: var(--sub);
  margin-top: 4px;
  padding: 0 4px;
}
.msc-row.usr .msc-col { align-items: flex-end; }
.msc-row.usr .ts { text-align: right; }

/* ── Typing ──────────────────────────────────── */
.typing-bub {
  padding: 14px 18px;
  background: #fff;
  border-radius: var(--radius);
  border-bottom-left-radius: 5px;
  display: flex;
  gap: 5px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.typing-bub span {
  width: 7px;
  height: 7px;
  background: var(--c2);
  border-radius: 50%;
  animation: typBounce .9s infinite;
}
.typing-bub span:nth-child(2) { animation-delay: .15s; }
.typing-bub span:nth-child(3) { animation-delay: .3s; }
@keyframes typBounce {
  0%,80%,100% { transform: scale(.8) translateY(0); opacity: .5; }
  40% { transform: scale(1.1) translateY(-6px); opacity: 1; background: var(--c); }
}

/* ── Quick Chip Buttons ─────────────────────── */
.msc-chips {
  padding: 8px 12px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #fdf8f9;
  border-top: 1px solid rgba(232,99,122,.08);
}
.msc-chips button {
  background: #fff;
  border: 1.5px solid rgba(232,99,122,.25);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--c);
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.msc-chips button:hover {
  background: var(--c);
  color: #fff;
  border-color: var(--c);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(232,99,122,.3);
}

/* ── Input Bar ───────────────────────────────── */
.msc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid rgba(232,99,122,.1);
}
#msc-inp {
  flex: 1;
  border: 1.5px solid #f0d4d8;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background: #fdf8f9;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#msc-inp:focus {
  border-color: var(--c);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(232,99,122,.1);
}
#msc-inp::placeholder { color: #c4a0a8; }

.msc-wa, #msc-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  flex-shrink: 0;
}
.msc-wa {
  background: #25D366;
  box-shadow: 0 3px 12px rgba(37,211,102,.3);
  text-decoration: none;
}
.msc-wa svg { width: 20px; height: 20px; }
.msc-wa:hover { transform: scale(1.12); box-shadow: 0 5px 18px rgba(37,211,102,.45); }

#msc-send {
  background: linear-gradient(135deg, var(--c), #c94b63);
  box-shadow: 0 3px 12px rgba(232,99,122,.35);
}
#msc-send svg { width: 18px; height: 18px; }
#msc-send:hover { transform: scale(1.12); box-shadow: 0 5px 18px rgba(232,99,122,.5); }
#msc-send:disabled { opacity: .5; transform: none; cursor: not-allowed; }

/* ── Footer ──────────────────────────────────── */
.msc-foot {
  text-align: center;
  padding: 7px;
  font-size: 10.5px;
  color: #c4a0a8;
  background: #fff;
  letter-spacing: .03em;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 440px) {
  #msc-win {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 88px;
    border-radius: 20px;
  }
  #msc-win.left { left: 12px; right: 12px; }
  #msc-fab { right: 16px; bottom: 20px; }
  #msc-fab.left { left: 16px; right: auto; }
}

/* ── Message formatting helpers ─────────────── */
.bub .msc-bullet {
  display: block;
  padding: 3px 0 3px 4px;
  position: relative;
}
.msc-row.bot .bub .msc-bullet::before {
  content: '•';
  color: var(--c);
  font-weight: 800;
  margin-right: 7px;
}
.bub .msc-section {
  display: block;
  font-weight: 800;
  color: var(--c);
  margin: 8px 0 4px;
  font-size: 13px;
  letter-spacing: .02em;
}
.bub .msc-section:first-child { margin-top: 2px; }
.bub .msc-num {
  display: inline-block;
  font-weight: 800;
  color: var(--c);
  min-width: 20px;
}
.bub br { line-height: 1.8; }
