/* FlowButton port for vanilla site (no React/shadcn needed).
   Original: rounded pill + expanding circle + sliding arrows.
   Applied via JS enhancer (flow-btn.js adds .flow-btn to every .btn).
   Colors adapt to existing variants so Start/Stop/Save keep identity. */
.flow-btn {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 100px !important;
  transition:
    border-radius 600ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 150ms ease,
    background-color 0.2s,
    border-color 0.3s,
    color 0.3s,
    box-shadow 0.2s !important;
}
.flow-btn:hover { border-radius: 12px !important; }
.flow-btn:active { transform: scale(0.95); }
button.btn.flow-btn { padding-left: 32px !important; padding-right: 32px !important; }

.fb-txt {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  transform: translateX(-12px);
  transition: transform 800ms ease-out;
  white-space: nowrap;
}
.flow-btn:hover .fb-txt { transform: translateX(12px); }

.fb-circle {
  position: absolute; z-index: 0;
  top: 50%; left: 50%;
  translate: -50% -50%;
  width: 16px; height: 16px; border-radius: 50%;
  opacity: 0; pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
  transition: all 800ms cubic-bezier(0.19, 1, 0.22, 1);
}
.flow-btn:hover .fb-circle { width: 260px; height: 260px; opacity: 1; }

/* ghost / transparent buttons: fill with brand instead of dark overlay */
.flow-btn.btn-ghost .fb-circle { background: rgba(88, 101, 242, 0.9); }
body.light .flow-btn.btn-ghost .fb-circle { background: #111111; }
body.light .flow-btn.btn-ghost:hover { color: #fff; }

.fb-arr {
  position: absolute; z-index: 2;
  top: 50%; translate: 0 -50%;
  width: 16px; height: 16px; flex-shrink: 0;
  pointer-events: none;
  transition: all 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fb-arr-l { left: -25%; }
.flow-btn:hover .fb-arr-l { left: 14px; }
.fb-arr-r { right: 14px; }
.flow-btn:hover .fb-arr-r { right: -25%; }
/* login page sizes all .btn svg large — keep flow arrows small */
.btn svg.fb-arr { width: 16px !important; height: 16px !important; }

/* ---- sidebar tools: [X] collapse + sys card (gear + drag) ---- */
.side-actions { position: relative; }
.sa-toggle {
  position: absolute; top: -14px; right: -4px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: #1a2140; color: #cdd6ff;
  font-size: 11px; line-height: 1; cursor: pointer; z-index: 6;
  display: grid; place-items: center; padding: 0;
}
.sa-toggle:hover { background: #5865F2; color: #fff; border-color: #5865F2; }
body.light .sa-toggle { background: #e3e5e8; color: #333; border-color: rgba(0,0,0,.15); }
.side-actions.sa-hidden > .btns { display: none; }
.sys-head { display: flex; align-items: center; gap: 8px; cursor: move; user-select: none; -webkit-user-select: none; touch-action: none; }
.sys-gear {
  margin-left: auto; background: transparent; border: 0; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 2px; opacity: .75; border-radius: 6px;
  transition: transform .2s, opacity .2s;
}
.sys-gear:hover { opacity: 1; transform: rotate(30deg); }
.sys-stats.sys-collapsed .sys-body { display: none; }
.sys-stats.sys-float {
  position: fixed; z-index: 9000; width: 250px; margin: 0;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}

@media (prefers-reduced-motion: reduce) {
  .flow-btn, .fb-txt, .fb-circle, .fb-arr { transition: none !important; }
}
