/* =========================================================
   Smart CTA Buttons — Frontend CSS
   Brandix Soft | https://brandixsoft.com
   ========================================================= */

/* ── Base button ── */
.scb-float-btn {
  position: fixed;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
  transition: transform .2s ease, box-shadow .2s ease;
  outline: none;
}

.scb-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
}

/* ── Shapes ── */
.scb-shape-circle {
  border-radius: 50%;
}

.scb-shape-rounded {
  border-radius: 12px;
}

.scb-shape-square {
  border-radius: 6px;
}

/* When text is shown, override circle to pill */
.scb-shape-circle.scb-has-text {
  border-radius: 50px;
}

.scb-shape-rounded.scb-has-text {
  border-radius: 10px;
}

/* ── Sizes ── */
.scb-size-small {
  width: 44px;
  height: 44px;
}

.scb-size-medium {
  width: 56px;
  height: 56px;
}

.scb-size-large {
  width: 70px;
  height: 70px;
}

/* Text mode / both mode: auto width */
.scb-float-btn.scb-has-text.scb-size-small {
  width: auto;
  padding: 0 16px;
  height: 40px;
}

.scb-float-btn.scb-has-text.scb-size-medium {
  width: auto;
  padding: 0 20px;
  height: 52px;
}

.scb-float-btn.scb-has-text.scb-size-large {
  width: auto;
  padding: 0 24px;
  height: 64px;
}

/* ── Icon SVGs ── */
.scb-btn-icon svg {
  display: block;
  pointer-events: none;
}

.scb-size-small .scb-btn-icon svg {
  width: 18px;
  height: 18px;
}

.scb-size-medium .scb-btn-icon svg {
  width: 24px;
  height: 24px;
}

.scb-size-large .scb-btn-icon svg {
  width: 30px;
  height: 30px;
}

/* ── Label ── */
.scb-btn-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

.scb-size-small .scb-btn-label {
  font-size: 12px;
}

.scb-size-medium .scb-btn-label {
  font-size: 14px;
}

.scb-size-large .scb-btn-label {
  font-size: 16px;
}

/* ── Positions ── */
.scb-pos-bottom-right {
  bottom: 24px;
  right: 24px;
}

.scb-pos-bottom-left {
  bottom: 24px;
  left: 24px;
}

.scb-pos-bottom-center {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.scb-pos-top-right {
  top: 80px;
  right: 24px;
}

.scb-pos-top-left {
  top: 80px;
  left: 24px;
}

.scb-pos-middle-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  border-radius: 12px 0 0 12px;
}

.scb-pos-middle-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  border-radius: 0 12px 12px 0;
}

/* ── Mobile hide ── */
@media (max-width: 767px) {
  .scb-hide-mobile {
    display: none !important;
  }
}

/* ── Tooltip ── */
/* .scb-float-btn {
  position: relative;
} */

.scb-tooltip {
  position: absolute;
  white-space: nowrap;
  background: rgba(15, 23, 42, .88);
  color: #fff;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.scb-float-btn:hover .scb-tooltip {
  opacity: 1;
}

.scb-tooltip-left {
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}

.scb-tooltip-right {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}

.scb-tooltip-top {
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
}

.scb-tooltip-bottom {
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
}

/* Arrow on tooltip */
.scb-tooltip::after {
  content: '';
  position: absolute;
  border: 5px solid transparent;
}

.scb-tooltip-left::after {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: rgba(15, 23, 42, .88);
}

.scb-tooltip-right::after {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: rgba(15, 23, 42, .88);
}

.scb-tooltip-top::after {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: rgba(15, 23, 42, .88);
}

.scb-tooltip-bottom::after {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: rgba(15, 23, 42, .88);
}

/* ── Animations ── */
/* fade */
.scb-anim-fade {
  animation: scb-fade .5s ease forwards;
}

@keyframes scb-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* slide */
.scb-pos-bottom-right.scb-anim-slide,
.scb-pos-top-right.scb-anim-slide,
.scb-pos-middle-right.scb-anim-slide {
  animation: scb-slide-right .4s ease forwards;
}

.scb-pos-bottom-left.scb-anim-slide,
.scb-pos-top-left.scb-anim-slide,
.scb-pos-middle-left.scb-anim-slide {
  animation: scb-slide-left .4s ease forwards;
}

.scb-pos-bottom-center.scb-anim-slide {
  animation: scb-slide-up .4s ease forwards;
}

@keyframes scb-slide-right {
  from {
    transform: translateX(80px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scb-slide-left {
  from {
    transform: translateX(-80px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scb-slide-up {
  from {
    transform: translateX(-50%) translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* bounce */
.scb-anim-bounce {
  animation: scb-bounce .6s cubic-bezier(.36, .07, .19, .97) forwards;
}

@keyframes scb-bounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  60% {
    transform: scale(1.15);
    opacity: 1;
  }

  80% {
    transform: scale(.9);
  }

  100% {
    transform: scale(1);
  }
}

/* pulse ring */
.scb-anim-pulse {
  animation: scb-fade .4s ease forwards;
}

.scb-anim-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 3px solid currentColor;
  opacity: .5;
  animation: scb-pulse-ring 2s ease infinite;
}

@keyframes scb-pulse-ring {
  0% {
    transform: scale(1);
    opacity: .6;
  }

  70% {
    transform: scale(1.4);
    opacity: 0;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* scroll reveal hidden */
.scb-scroll-reveal.scb-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) !important;
  transition: opacity .3s, transform .3s !important;
}


/* =========================================================
   SPEED DIAL GROUP
   ========================================================= */
.scb-speed-dial {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

/* Positions */
.scb-speed-dial.scb-pos-bottom-right {
  bottom: 24px;
  right: 24px;
  align-items: flex-end;
}

.scb-speed-dial.scb-pos-bottom-left {
  bottom: 24px;
  left: 24px;
  align-items: flex-start;
}

.scb-speed-dial.scb-pos-bottom-center {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.scb-speed-dial.scb-pos-top-right {
  top: 80px;
  right: 24px;
  flex-direction: column-reverse;
  align-items: flex-end;
}

.scb-speed-dial.scb-pos-top-left {
  top: 80px;
  left: 24px;
  flex-direction: column-reverse;
  align-items: flex-start;
}

.scb-speed-dial.scb-pos-middle-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  align-items: flex-end;
}

.scb-speed-dial.scb-pos-middle-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  align-items: flex-start;
}

/* Toggle main button */
.scb-dial-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s;
  flex-shrink: 0;
}

.scb-dial-toggle:hover {
  transform: scale(1.1);
}

.scb-dial-toggle svg {
  width: 26px;
  height: 26px;
  transition: transform .3s;
}

.scb-speed-dial[data-open="1"] .scb-dial-toggle {
  transform: rotate(45deg) scale(1.05);
}

/* Count badge */
.scb-dial-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  transition: opacity .2s;
}

.scb-speed-dial[data-open="1"] .scb-dial-count {
  opacity: 0;
}

/* Icon swap */
.scb-dial-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sub-button container */
.scb-dial-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  align-items: inherit;
  overflow: hidden;
}

/* Each sub item */
.scb-dial-item {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  transition: opacity .25s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
  transition-delay: calc(var(--i) * 0.05s);
  pointer-events: none;
}

.scb-speed-dial.scb-pos-bottom-left .scb-dial-item,
.scb-speed-dial.scb-pos-top-left .scb-dial-item,
.scb-speed-dial.scb-pos-middle-left .scb-dial-item {
  flex-direction: row-reverse;
}

/* Open state */
.scb-speed-dial[data-open="1"] .scb-dial-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Sub buttons inside dial — override position:fixed */
.scb-dial-btn {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  flex-shrink: 0;
}

.scb-dial-btn:hover {
  transform: scale(1.12) !important;
}

/* Label chip */
.scb-dial-label {
  background: rgba(15, 23, 42, .82);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  pointer-events: none;
}

/* Backdrop when open */
.scb-dial-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, .25);
  backdrop-filter: blur(2px);
  animation: scb-fade .2s ease;
}

/* ── Admin preview: existing ghost buttons ── */
.scb-preview-existing-wrap {
  position: absolute;
}

.scb-existing-ghost {
  opacity: .45;
  cursor: default !important;
  pointer-events: none;
  border: 2px dashed rgba(0, 0, 0, .15);
}

/* Speed dial badge on current preview btn */
.scb-speed-dial-indicator {
  border: 2px dashed #4f46e5 !important;
}

.scb-speed-dial-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #4f46e5;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}