/* ============================================================
   BALO — FLOATING ACTION BUTTONS (FABs)
   Zen Glass Green + Aura Edition — soft, transparent, calm.
   ============================================================ */

:root {
  --fab-green: #22c55e;
  --fab-green-glow: rgba(34,197,94,0.55);
  --fab-glass-bg: rgba(255,255,255,0.12);
  --fab-glass-bg-hover: rgba(255,255,255,0.22);
  --fab-border: rgba(255,255,255,0.28);
  --fab-text: #ffffff;
  --fab-shadow: rgba(0,0,0,0.18);
  --fab-radius: 14px;
  --fab-duration: 0.25s;
  --fab-blur: 14px;
}

/* ============================================================
   FAB WRAPPER
   ============================================================ */
#balo-fabs.balo-side-fabs {
  position: fixed;
  right: 16px;
  bottom: 96px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* container ignores clicks */
}

#balo-fabs .balo-fab,
#balo-fabs .balo-fabs-toggle {
  pointer-events: auto; /* children are clickable */
}

/* ============================================================
   ZEN GLASS BUTTONS + AURA MODE
   ============================================================ */
.balo-fab {
  position: relative;
  background: var(--fab-glass-bg);
  color: var(--fab-text);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;

  border: 1px solid var(--fab-border);
  border-radius: var(--fab-radius);

  display: flex;
  align-items: center;
  gap: 8px;

  backdrop-filter: blur(var(--fab-blur));
  -webkit-backdrop-filter: blur(var(--fab-blur));

  box-shadow: 0 6px 18px var(--fab-shadow),
              0 0 20px rgba(34,197,94,0);

  transition:
    background var(--fab-duration),
    box-shadow var(--fab-duration),
    transform var(--fab-duration),
    border var(--fab-duration),
    opacity 0.4s ease;
}

/* Aura halo behind each FAB */
.balo-fab::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--ax, 50%) var(--ay, 50%),
    rgba(34,197,94,0.45),
    rgba(34,197,94,0.10) 40%,
    transparent 70%
  );
  filter: blur(16px);
  opacity: 0.45;
  animation: fabAuraMove 6s ease-in-out infinite;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.balo-fab:hover::before {
  opacity: 0.75;
}

@keyframes fabAuraMove {
  0%   { --ax: 20%; --ay: 30%; }
  25%  { --ax: 80%; --ay: 40%; }
  50%  { --ax: 60%; --ay: 80%; }
  75%  { --ax: 30%; --ay: 60%; }
  100% { --ax: 20%; --ay: 30%; }
}

/* Hover glow */
.balo-fab:hover {
  background: var(--fab-glass-bg-hover);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 8px 24px var(--fab-shadow),
              0 0 26px var(--fab-green-glow);
  transform: translateY(-2px);
}

/* Dot icon */
.balo-fab .dot {
  width: 8px;
  height: 8px;
  background: var(--fab-text);
  opacity: 0.8;
  border-radius: 50%;
}

/* ============================================================
   UNREAD BADGE
   ============================================================ */
.fab-badge {
  background: rgba(255,255,255,0.85);
  color: var(--fab-green);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  margin-left: auto;
  box-shadow: 0 2px 6px rgba(34,197,94,0.4);
}

.balo-fab-account.has-unread {
  position: relative;
}

/* Ping dot */
.balo-fab-account.has-unread::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 12px;
  height: 12px;
  background: var(--fab-green);
  border-radius: 50%;
  opacity: 0.85;
  animation: fab-ping 1.6s infinite ease-out;
}

@keyframes fab-ping {
  0%   { transform: scale(1); opacity: 0.8; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#fab-top {
  background: var(--fab-glass-bg);
}

#fab-top:hover {
  background: var(--fab-glass-bg-hover);
}

/* ============================================================
   TOGGLE BUTTON
   ============================================================ */
.balo-fabs-toggle {
  position: relative; /* required for ripple */
  overflow: hidden;   /* required for ripple */

  background: var(--fab-glass-bg);
  color: var(--fab-text);
  padding: 14px;
  border-radius: var(--fab-radius);
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;

  border: 1px solid var(--fab-border);

  backdrop-filter: blur(var(--fab-blur));
  -webkit-backdrop-filter: blur(var(--fab-blur));

  box-shadow: 0 4px 12px var(--fab-shadow);

  transition:
      transform var(--fab-duration),
      background var(--fab-duration),
      border var(--fab-duration);
}

.balo-fabs-toggle:hover {
  background: var(--fab-glass-bg-hover);
  border-color: rgba(255,255,255,0.5);
  transform: scale(1.05);
}

/* ============================================================
   COLLAPSED STATE
   ============================================================ */
#balo-fabs.is-collapsed .balo-fab {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

#balo-fabs.is-collapsed {
  gap: 4px;
}

#balo-fabs.is-collapsed .balo-fabs-toggle {
  transform: rotate(180deg);
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 720px) {
  #balo-fabs.balo-side-fabs {
    right: 12px;
    bottom: 70px;
    gap: 8px;
  }

  .balo-fab {
    font-size: 13px;
    padding: 10px 14px;
  }

  .fab-badge {
    font-size: 10px;
    padding: 2px 5px;
  }

  .balo-fabs-toggle {
    font-size: 16px;
    padding: 12px;
  }
}

/* ============================================================
   ZEN FADE-IN
   ============================================================ */
@keyframes fabFadeIn {
  0%   { opacity: 0; transform: translateX(20px) scale(0.9); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

#balo-fabs:not(.is-collapsed) .balo-fab {
  animation: fabFadeIn 0.45s ease forwards;
}

/* ============================================================
   GLOW RIPPLE
   ============================================================ */
.balo-fabs-toggle.ripple::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle,
    rgba(34,197,94,0.45) 0%,
    rgba(34,197,94,0.0) 70%
  );
  animation: fabRipple 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes fabRipple {
  0%   { opacity: 0.8; transform: scale(0.4); }
  100% { opacity: 0;   transform: scale(1.8); }
}

/* ============================================================
   SUBTLE NEON PULSE (collapsed)
   ============================================================ */
#balo-fabs.is-collapsed .balo-fabs-toggle::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(
    circle,
    rgba(34,197,94,0.35) 0%,
    rgba(34,197,94,0.15) 30%,
    rgba(34,197,94,0.0) 70%
  );
  filter: blur(12px);
  opacity: 0.6;
  animation: baloTogglePulse 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes baloTogglePulse {
  0%   { transform: scale(1);   opacity: 0.45; }
  50%  { transform: scale(1.25); opacity: 0.75; }
  100% { transform: scale(1);    opacity: 0.45; }
}
