/**
 * urgent-fab.css  v2
 * Floating "⚡ Urgence" pill — visible on mobile AND desktop.
 * Positioned bottom-left. Premium glow + slow pulse.
 * Tasks 2, 3, 4, 6 — conversion boost pass.
 */

/* ══════════════════════════════════════════════════════════
   BASE — hidden by default, shown at ≤768px and desktop
   ══════════════════════════════════════════════════════════ */

#fixeo-urgent-fab {
  /* Show on desktop too, but smaller */
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;

  position: fixed !important;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  left: calc(18px + env(safe-area-inset-left, 0px)) !important;
  z-index: 1350 !important;

  /* Desktop: compact pill */
  height: 42px !important;
  padding: 0 18px 0 14px !important;
  border-radius: 999px !important;
  border: none !important;

  /* Orange/pink gradient — clearly urgent */
  background: linear-gradient(
    135deg,
    rgba(255, 75, 30, 0.82) 0%,
    rgba(225, 48, 108, 0.70) 100%
  ) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 100, 50, 0.40) !important;

  /* Text */
  color: #fff !important;
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  font-family: inherit !important;
  text-decoration: none !important;

  /* Glow */
  box-shadow:
    0 0 0 1px rgba(255, 80, 40, 0.25),
    0 6px 22px rgba(225, 48, 108, 0.32),
    0 2px 8px rgba(0, 0, 0, 0.28) !important;

  /* Enter + pulse animations */
  animation:
    urgFabEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both,
    urgPulse 3.6s ease-in-out 2s infinite !important;

  /* Smooth state transitions */
  transition:
    transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s ease !important;

  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
  user-select: none !important;
  outline: none !important;
  overscroll-behavior: none !important;
}

/* ── Icon ── */
#fixeo-urgent-fab .ufab-icon {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0 !important;
  fill: none !important;
  stroke: #fff !important;
  stroke-width: 2.4 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 0 5px rgba(255,200,80,.8)) !important;
  display: block !important;
}

/* ── Label ── */
#fixeo-urgent-fab .ufab-label {
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  letter-spacing: 0.02em !important;
  display: inline !important;
}

/* ── Hover / focus ── */
#fixeo-urgent-fab:hover,
#fixeo-urgent-fab:focus-visible {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow:
    0 0 0 2px rgba(255, 90, 40, 0.35),
    0 12px 32px rgba(225, 48, 108, 0.48),
    0 4px 12px rgba(0, 0, 0, 0.28) !important;
  animation-play-state: paused !important;
}

/* ── Active / tap ── */
#fixeo-urgent-fab:active {
  transform: scale(0.94) !important;
  transition-duration: 0.06s !important;
  animation-play-state: paused !important;
}

/* ── Hide when modal/search is open ── */
body.fixeo-search-mode #fixeo-urgent-fab,
body.modal-open #fixeo-urgent-fab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) scale(0.88) !important;
  transition: opacity 0.20s ease, transform 0.20s ease !important;
}

/* ══════════════════════════════════════════════════════════
   MOBILE — slightly larger tap target
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #fixeo-urgent-fab {
    height: 48px !important;
    padding: 0 18px 0 14px !important;
    font-size: 0.84rem !important;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px)) !important;
    left: calc(14px + env(safe-area-inset-left, 0px)) !important;
    /* Slightly stronger gradient on mobile */
    background: linear-gradient(
      135deg,
      rgba(255, 70, 20, 0.92) 0%,
      rgba(225, 48, 108, 0.82) 100%
    ) !important;
    box-shadow:
      0 0 0 1px rgba(255, 80, 40, 0.30),
      0 8px 28px rgba(225, 48, 108, 0.40),
      0 2px 8px rgba(0, 0, 0, 0.30) !important;
  }
  #fixeo-urgent-fab .ufab-icon {
    width: 16px !important;
    height: 16px !important;
  }
  #fixeo-urgent-fab .ufab-label {
    font-size: 0.84rem !important;
  }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP — hide FAB when user is scrolled to final CTA
   (FAB not competing with the block-level CTA)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  #fixeo-urgent-fab {
    height: 40px !important;
    padding: 0 16px 0 12px !important;
    font-size: 0.78rem !important;
    opacity: 0.72 !important;
  }
  #fixeo-urgent-fab:hover {
    opacity: 1 !important;
  }
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */

@keyframes urgFabEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Slow premium breathing glow — 3.6s cycle, never aggressive */
@keyframes urgPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 80, 40, 0.22),
      0 6px 22px rgba(225, 48, 108, 0.30),
      0 2px 8px rgba(0, 0, 0, 0.26);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 80, 40, 0.34),
      0 10px 34px rgba(225, 48, 108, 0.50),
      0 2px 8px rgba(0, 0, 0, 0.26);
  }
}

/* ══════════════════════════════════════════════════════════
   TASK 6 — REDUCED MOTION
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  #fixeo-urgent-fab {
    animation: none !important;
    transition: box-shadow .2s ease !important;
  }
}
