/* ============================================================
   Floatify — Front-End Floating Buttons  (2026)
   ============================================================ */

#floatify-widget {
  position: fixed;
  z-index: var(--flz, 9999);
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* ── Positions ───────────────────────────────────────────── */
#floatify-widget.floatify-pos-bottom-right {
  bottom: var(--foy, 30px);
  right:  var(--fox, 30px);
  align-items: flex-end;
}
#floatify-widget.floatify-pos-bottom-left {
  bottom: var(--foy, 30px);
  left:   var(--fox, 30px);
  align-items: flex-start;
}
#floatify-widget.floatify-pos-top-right {
  top:   var(--foy, 30px);
  right: var(--fox, 30px);
  align-items: flex-end;
  flex-direction: column-reverse;
}
#floatify-widget.floatify-pos-top-left {
  top:  var(--foy, 30px);
  left: var(--fox, 30px);
  align-items: flex-start;
  flex-direction: column-reverse;
}

/* ── Entry Animations ────────────────────────────────────── */
#floatify-widget.floatify-entry-slide-up  { animation: fl-entry-slide-up  .5s cubic-bezier(.4,0,.2,1) both; }
#floatify-widget.floatify-entry-slide-down{ animation: fl-entry-slide-down .5s cubic-bezier(.4,0,.2,1) both; }
#floatify-widget.floatify-entry-fade      { animation: fl-entry-fade       .6s ease both; }
#floatify-widget.floatify-entry-zoom      { animation: fl-entry-zoom       .4s cubic-bezier(.4,0,.2,1) both; }

@keyframes fl-entry-slide-up   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes fl-entry-slide-down { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }
@keyframes fl-entry-fade       { from { opacity: 0; } to { opacity: 1; } }
@keyframes fl-entry-zoom       { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

/* ── Base Button ─────────────────────────────────────────── */
.floatify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform .22s cubic-bezier(.4,0,.2,1),
              box-shadow  .22s cubic-bezier(.4,0,.2,1),
              opacity     .22s;
  pointer-events: all;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.floatify-btn svg { width: 55%; height: 55%; }
.floatify-btn:hover  { transform: scale(1.1); }
.floatify-btn:active { transform: scale(.95); }

.floatify-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Main Button ─────────────────────────────────────────── */
.floatify-main-btn {
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
  position: relative;
  z-index: 2;
}
.floatify-main-btn:hover { box-shadow: 0 10px 32px rgba(0,0,0,.4); }

/* Pulse */
@keyframes floatify-pulse-ring {
  0%   { box-shadow: 0 0 0 0   var(--fl-main-bg, rgba(108,99,255,.5)); }
  70%  { box-shadow: 0 0 0 14px rgba(108,99,255, 0); }
  100% { box-shadow: 0 0 0 0   rgba(108,99,255, 0); }
}
.floatify-pulse { animation: floatify-pulse-ring 2.5s ease-in-out infinite; }

/* Icon toggle */
.floatify-main-icon { position: absolute; transition: opacity .2s, transform .2s; }
.floatify-icon-open  { opacity: 1; transform: rotate(0deg); }
.floatify-icon-close { opacity: 0; transform: rotate(-45deg); }

#floatify-widget.is-open .floatify-icon-open  { opacity: 0; transform: rotate(45deg); }
#floatify-widget.is-open .floatify-icon-close { opacity: 1; transform: rotate(0deg); }

/* ── Children ────────────────────────────────────────────── */
.floatify-children {
  display: flex;
  flex-direction: column;
  align-items: inherit;
  gap: 10px;
  pointer-events: none;
  overflow: visible;
}

/* ── Item Row ─────────────────────────────────────────────── */
.floatify-item {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  /* Children hidden by default */
}
.floatify-item:not(.floatify-visible) .floatify-child-btn,
.floatify-item:not(.floatify-visible) .floatify-label {
  opacity: 0;
  pointer-events: none;
}

/* ── Label ───────────────────────────────────────────────── */
.floatify-label {
  background: rgba(15,15,26,.95);
  color: #E8E8F0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.08);
  transition: opacity .2s, transform .2s;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.floatify-item:not(.floatify-visible) .floatify-label {
  opacity: 0;
  transform: translateX(6px);
}
.floatify-item.floatify-visible .floatify-label {
  opacity: 1;
  transform: translateX(0);
}

/* Label right side (for left-aligned widget) */
.floatify-label-right { order: 1; }
.floatify-item .floatify-label-right + .floatify-child-btn { order: 0; }

/* ── Animation: Pop ──────────────────────────────────────── */
[data-animation="pop"] .floatify-item.floatify-visible .floatify-child-btn {
  animation: fl-pop-in .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes fl-pop-in {
  from { opacity: 0; transform: scale(.3); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Animation: Slide ────────────────────────────────────── */
[data-animation="slide"] .floatify-item.floatify-visible .floatify-child-btn {
  animation: fl-slide-in .25s ease both;
}
@keyframes fl-slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Animation: Fade ─────────────────────────────────────── */
[data-animation="fade"] .floatify-item.floatify-visible .floatify-child-btn {
  animation: fl-fade-in .2s ease both;
}
@keyframes fl-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Animation: Bounce ───────────────────────────────────── */
[data-animation="bounce"] .floatify-item.floatify-visible .floatify-child-btn {
  animation: fl-bounce-in .4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes fl-bounce-in {
  0%   { opacity: 0; transform: scale(.5); }
  60%  { transform: scale(1.1); }
  80%  { transform: scale(.95); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Animation: Flip ─────────────────────────────────────── */
[data-animation="flip"] .floatify-item.floatify-visible .floatify-child-btn {
  animation: fl-flip-in .35s ease both;
}
@keyframes fl-flip-in {
  from { opacity: 0; transform: rotateY(-90deg) scale(.7); }
  to   { opacity: 1; transform: rotateY(0deg) scale(1); }
}

/* ── Fan Direction ───────────────────────────────────────── */
[data-direction="fan"] .floatify-children { flex-direction: row; }

/* ── Child button shadow ─────────────────────────────────── */
.floatify-child-btn {
  box-shadow: 0 4px 15px rgba(0,0,0,.25);
  pointer-events: all;
}
.floatify-child-btn:hover { box-shadow: 0 6px 20px rgba(0,0,0,.35); }

/* ── Stagger delays ──────────────────────────────────────── */
.floatify-item:nth-child(1).floatify-visible .floatify-child-btn { animation-delay: 0s;    }
.floatify-item:nth-child(2).floatify-visible .floatify-child-btn { animation-delay: .05s;  }
.floatify-item:nth-child(3).floatify-visible .floatify-child-btn { animation-delay: .1s;   }
.floatify-item:nth-child(4).floatify-visible .floatify-child-btn { animation-delay: .15s;  }
.floatify-item:nth-child(5).floatify-visible .floatify-child-btn { animation-delay: .2s;   }
.floatify-item:nth-child(6).floatify-visible .floatify-child-btn { animation-delay: .25s;  }

/* ── Ripple ──────────────────────────────────────────────── */
.floatify-btn .fl-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: fl-ripple .5s ease-out;
  pointer-events: none;
}
@keyframes fl-ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ── Single Button Mode ───────────────────────────────────── */
#floatify-widget.floatify-single-mode {
  pointer-events: none;
}
#floatify-widget.floatify-single-mode .floatify-main-btn {
  pointer-events: all;
}
#floatify-widget.floatify-single-mode .floatify-label {
  opacity: 1;
  transform: none;
  pointer-events: none;
}

/* ── Accessibility ───────────────────────────────────────── */
.floatify-btn:focus-visible {
  outline: 2px solid #6C63FF;
  outline-offset: 3px;
}

/* ── Reduce motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .floatify-btn,
  .floatify-main-icon,
  .floatify-label,
  .floatify-pulse {
    animation: none !important;
    transition: none !important;
  }
}