/* ==========================================================================
   FLOATING WIDGETS (WHATSAPP & SCROLL TO TOP) - RS ISLAM WONOSOBO
   Extracted from app/Views/frontend/partials/whatsapp-bubble.php (Stage 3.4D.1)
   ========================================================================== */

/* Floating Container: Anchored directly to WA button dimensions */
  .wa-floating-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
    width: 52px;
    height: 52px;
  }

  /* Scroll to Top Button: Floats cleanly directly above the WhatsApp button */
  .wa-scroll-top {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 6px; /* Centered relative to 52px WA button: (52 - 40) / 2 = 6px */
    width: 40px;
    height: 40px;
    background-color: #174C3C;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(10, 37, 28, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.85);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
    outline: none;
  }

  .wa-scroll-top:hover {
    background-color: #103B2E;
    color: #D4AF37;
    box-shadow: 0 6px 16px rgba(10, 37, 28, 0.28);
    transform: translateY(0) scale(1.06);
  }

  .wa-scroll-top:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.5);
  }

  .wa-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  /* Main WhatsApp Button */
  .wa-button {
    width: 52px;
    height: 52px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 26px;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.2), 
                background-color 0.2s ease, 
                box-shadow 0.2s ease;
  }

  .wa-button:hover {
    transform: scale(1.06);
    color: #FFFFFF;
    background-color: #20BD5A;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  }

  /* Soft, Subtle Ring Pulse (Clinical & Elegant) */
  .wa-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 211, 102, 0.45);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: wa-pulse-subtle 2.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  }

  @keyframes wa-pulse-subtle {
    0% { transform: scale(1); opacity: 0.65; }
    60% { transform: scale(1.28); opacity: 0; }
    100% { transform: scale(1.28); opacity: 0; }
  }

  /* Responsive Mobile Breakpoint */
  @media (max-width: 768px) {
    .wa-floating-container { 
      bottom: calc(68px + env(safe-area-inset-bottom, 0px)); 
      right: 16px; 
      width: 46px; 
      height: 46px; 
    }
    .wa-button { 
      width: 46px; 
      height: 46px; 
      font-size: 23px; 
      box-shadow: 0 3px 12px rgba(37, 211, 102, 0.32);
    }
    .wa-scroll-top { 
      bottom: calc(100% + 8px);
      right: 5px; /* Centered relative to 46px WA button: (46 - 36) / 2 = 5px */
      width: 36px; 
      height: 36px; 
      font-size: 13px; 
      box-shadow: 0 3px 10px rgba(10, 37, 28, 0.18);
    }
  }
