/* ══════════════════════════════════════════════════════
   Smart Support Button v2 — Frontend
   فونت از قالب سایت به ارث می‌رسد (font: inherit)
   ══════════════════════════════════════════════════════ */

#ssb-root {
  position: fixed;
  bottom: 28px;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;   /* فونت از قالب */
  direction: rtl;
}

/* ── position ─────────────────────────────────────── */
#ssb-root.ssb-left  { left: 22px; flex-direction: row; }
#ssb-root.ssb-right { right: 22px; flex-direction: row-reverse; }

/* ══ MAIN ROUND BUTTON ════════════════════════════════ */
#ssb-main-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--ssb-color, #2563eb);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.24);
  transition: transform .2s, box-shadow .2s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

#ssb-main-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
}

#ssb-main-btn svg {
  width: 26px;
  height: 26px;
}

/* pulse ring */
#ssb-main-btn::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--ssb-color, #2563eb);
  opacity: .3;
  animation: ssb-pulse 2.2s ease-out infinite;
  z-index: -1;
}
#ssb-main-btn.ssb-open::after { display: none; }

@keyframes ssb-pulse {
  0%   { transform: scale(1);   opacity: .3; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1);   opacity: 0; }
}

/* ══ WELCOME LABEL (beside round button) ══════════════ */
#ssb-welcome {
  background: #fff;
  color: #1e293b;
  font-size: 14px;
  font-weight: bold;
  font-family: inherit;
  padding: 7px 14px;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0,0,0,.14);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  transform: translateX(0);
}

/* hide label when open */
#ssb-root.ssb-is-open #ssb-welcome {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

/* ══ CHANNELS LIST ════════════════════════════════════ */
#ssb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  bottom: 70px;    /* above the main button */
  left: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

#ssb-root.ssb-right #ssb-list { left: auto; right: 0; }

/* each item */
#ssb-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(16px) scale(.88);
  transition: opacity .22s ease, transform .22s ease;
}

#ssb-root.ssb-right #ssb-list li { flex-direction: row-reverse; }

/* visible state */
#ssb-list.ssb-open li {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* stagger */
#ssb-list.ssb-open li:nth-child(1) { transition-delay: .03s; }
#ssb-list.ssb-open li:nth-child(2) { transition-delay: .07s; }
#ssb-list.ssb-open li:nth-child(3) { transition-delay: .11s; }
#ssb-list.ssb-open li:nth-child(4) { transition-delay: .15s; }
#ssb-list.ssb-open li:nth-child(5) { transition-delay: .19s; }
#ssb-list.ssb-open li:nth-child(6) { transition-delay: .23s; }
#ssb-list.ssb-open li:nth-child(7) { transition-delay: .27s; }

/* ── channel link button ─────────────────────────── */
.ssb-ch-a {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  box-shadow: 0 3px 14px rgba(0,0,0,.2);
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}

.ssb-ch-a:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
}

.ssb-ch-a svg {
  width: 26px;
  height: 26px;
}

/* ── channel text label (also a link) ─────────────── */
.ssb-ch-label {
  display: inline-block;
  background: rgba(255,255,255,.96);
  color: #1e293b !important;
  font-size: 13px;
  font-weight: bold;
  font-family: inherit;
  padding: 6px 13px;
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  text-decoration: none !important;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: background .15s, color .15s;
}

.ssb-ch-label:hover {
  background: #fff;
  color: var(--ch-color, #1e293b) !important;
}

/* ── Brand colors ─────────────────────────────────── */
.ssb-telegram  { background: #229ED9; }
.ssb-whatsapp  { background: #25D366; }
.ssb-instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.ssb-phone     { background: #374151; }
.ssb-eitaa     { background: #CA8A04; }
.ssb-rubika    { background: #1f2937; }
.ssb-bale      { background: #1D4ED8; }

/* ══ Responsive ═══════════════════════════════════════ */
@media (max-width: 480px) {
  #ssb-root { bottom: 16px; }
  #ssb-root.ssb-left  { left: 14px; }
  #ssb-root.ssb-right { right: 14px; }
  #ssb-main-btn { width: 52px; height: 52px; }
  #ssb-main-btn svg { width: 23px; height: 23px; }
  .ssb-ch-a { width: 46px; height: 46px; border-radius: 12px; }
  .ssb-ch-a svg { width: 22px; height: 22px; }
  #ssb-welcome { font-size: 12px; padding: 6px 11px; }
}
