/* =============================================================================
   File        : public/assets/css/frontend/floating-buttons.css
   Project     : GyanPeeth Academy
   Framework   : CodeIgniter 4

   Description
   -----------------------------------------------------------------------------
   Floating Action Buttons

   Contents

   1. Floating Wrapper
   2. WhatsApp Button
   3. Back To Top
   4. Tooltip
   5. Hover Effects
   6. Animation
   7. Responsive

=============================================================================*/

/* =============================================================================
   FLOATING WRAPPER
============================================================================= */

.fe-floating-actions {
  position: fixed;

  right: 30px;

  bottom: 30px;

  z-index: 999;

  display: flex;

  flex-direction: column;

  align-items: flex-end;

  gap: 16px;
}

/* =============================================================================
   BASE FLOATING BUTTON
============================================================================= */

.fe-whatsapp,
.fe-backtotop {
  position: relative;

  width: 60px;

  height: 60px;

  display: flex;

  align-items: center;

  justify-content: center;

  border: none;

  border-radius: 50%;

  cursor: pointer;

  text-decoration: none;

  transition: all 0.35s ease;

  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.fe-whatsapp i,
.fe-backtotop i {
  font-size: 1.5rem;
}

/* =============================================================================
   WHATSAPP
============================================================================= */

.fe-whatsapp {
  color: #fff;

  background: #25d366;
}

.fe-whatsapp:hover {
  color: #fff;

  background: #128c7e;

  transform: translateY(-6px) scale(1.05);
}

/* =============================================================================
   BACK TO TOP
============================================================================= */

.fe-backtotop {
  color: #fff;

  opacity: 0;

  visibility: hidden;

  transform: translateY(20px);

  background: linear-gradient(135deg, var(--color-primary), #1d4ed8);
}

.fe-backtotop.is-visible {
  opacity: 1;

  visibility: visible;

  transform: none;
}

.fe-backtotop:hover {
  color: #fff;

  transform: translateY(-6px);
}

/* =============================================================================
   ICON
============================================================================= */

.fe-whatsapp__icon,
.fe-backtotop__icon {
  display: flex;

  align-items: center;

  justify-content: center;
}
/* =============================================================================
   TOOLTIP
============================================================================= */

.fe-whatsapp__tooltip,
.fe-backtotop__tooltip {
  position: absolute;

  top: 50%;

  right: 75px;

  transform: translateY(-50%);

  padding: 0.65rem 1rem;

  border-radius: 12px;

  white-space: nowrap;

  font-size: 0.82rem;

  font-weight: 600;

  color: #fff;

  background: var(--color-dark);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition: all 0.3s ease;

  box-shadow: var(--fe-shadow-md);
}

.fe-whatsapp__tooltip::after,
.fe-backtotop__tooltip::after {
  content: "";

  position: absolute;

  top: 50%;

  right: -6px;

  width: 12px;

  height: 12px;

  background: inherit;

  transform: translateY(-50%) rotate(45deg);
}

.fe-whatsapp:hover .fe-whatsapp__tooltip,
.fe-backtotop:hover .fe-backtotop__tooltip {
  opacity: 1;

  visibility: visible;

  right: 80px;
}

/* =============================================================================
   PULSE ANIMATION
============================================================================= */

.fe-whatsapp {
  animation: feWhatsappPulse 2s infinite;
}

@keyframes feWhatsappPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
  }

  70% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* =============================================================================
   RIPPLE HOVER
============================================================================= */

.fe-whatsapp::before,
.fe-backtotop::before {
  content: "";

  position: absolute;

  inset: 0;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.18);

  transform: scale(0);

  opacity: 0;

  transition: 0.35s ease;
}

.fe-whatsapp:hover::before,
.fe-backtotop:hover::before {
  transform: scale(1.4);

  opacity: 1;
}

/* =============================================================================
   ACTIVE STATE
============================================================================= */

.fe-whatsapp:active,
.fe-backtotop:active {
  transform: scale(0.94);
}

/* =============================================================================
   DARK MODE
============================================================================= */

[data-theme="dark"] .fe-whatsapp {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .fe-backtotop {
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .fe-whatsapp__tooltip,
[data-theme="dark"] .fe-backtotop__tooltip {
  background: #0f172a;
}

/* =============================================================================
   MOBILE
============================================================================= */

@media (max-width: 768px) {
  .fe-floating-actions {
    right: 20px;

    bottom: 20px;

    gap: 12px;
  }

  .fe-whatsapp,
  .fe-backtotop {
    width: 54px;

    height: 54px;
  }

  .fe-whatsapp i,
  .fe-backtotop i {
    font-size: 1.3rem;
  }

  .fe-whatsapp__tooltip,
  .fe-backtotop__tooltip {
    display: none;
  }
}

/* =============================================================================
   SMALL MOBILE
============================================================================= */

@media (max-width: 480px) {
  .fe-whatsapp,
  .fe-backtotop {
    width: 50px;

    height: 50px;
  }
}

/* =============================================================================
   REDUCED MOTION
============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .fe-whatsapp,
  .fe-backtotop {
    animation: none;

    transition: none;
  }

  .fe-whatsapp::before,
  .fe-backtotop::before {
    display: none;
  }
}

/* =============================================================================
   PRINT
============================================================================= */

@media print {
  .fe-floating-actions {
    display: none !important;
  }
}
