/* ============================================
   FLOATING WIDGET (Profile + WhatsApp)
   ============================================ */

/* Container */
.floating-widget {
  position: fixed;
  bottom: 32px; /* Adjusted: 24-32px range */
  right: 28px;  /* Adjusted: 20-28px range */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px; /* Adjusted: 10-14px range */
  pointer-events: none; /* Let clicks pass through the gap areas */
  transition: opacity 0.4s ease; /* Smooth transition for auto-hide */
}

/* Dimmed state for scroll down */
.floating-widget.is-dimmed {
  opacity: 0.6;
}

.floating-widget:hover {
  opacity: 1 !important; /* Always visible on hover */
}

/* Enable pointer events on the children */
.floating-widget > * {
  pointer-events: auto;
}

/* ------------------------------------------------
   1. Profile Indicator
   ------------------------------------------------ */
.profile-indicator {
  position: relative;
  cursor: default;
  /* Entrance Animation */
  opacity: 0;
  animation: fw-fadeInUp 0.5s ease-out 0.8s forwards;
}

.profile-indicator__wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  padding: 3px; /* White border visual */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.profile-indicator:hover .profile-indicator__wrapper {
  transform: scale(1.05);
}

.profile-indicator__image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background-color: #f0f0f0; /* Fallback */
}

/* Green Status Dot */
.profile-indicator__status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #25D366; /* Online Green */
  border: 2px solid #fff;
  border-radius: 50%;
  box-sizing: content-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  animation: pulse-glow 3s infinite ease-in-out; /* Slow, soft pulse */
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2); /* 2px max glow */
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Tooltip "Currently online" */
.profile-indicator__tooltip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  margin-right: 14px;
  background-color: #1a1a1a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit; /* Inherit site font */
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  pointer-events: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Tooltip Arrow */
.profile-indicator__tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent transparent #1a1a1a;
}

.profile-indicator:hover .profile-indicator__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* ------------------------------------------------
   2. WhatsApp Button
   ------------------------------------------------ */
.whatsapp-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  background-color: #25D366; /* WhatsApp Brand Green */
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  text-decoration: none;
  /* Entrance Animation */
  opacity: 0;
  animation: fw-fadeInUp 0.5s ease-out 0.5s forwards;
}

.whatsapp-btn__icon {
  width: 36px;
  height: 36px;
  /* Invert color to make the icon white (assuming original is black/colored) */
  filter: brightness(0) invert(1);
  transition: transform 0.3s ease;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn:hover .whatsapp-btn__icon {
  transform: rotate(-10deg); /* Subtle shake/rotate */
}

.whatsapp-btn:active {
  transform: scale(0.95);
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 768px) {
  .floating-widget {
    bottom: 24px;
    right: 24px;
    gap: 12px;
  }
  
  .profile-indicator__wrapper {
    width: 50px;
    height: 50px;
  }
  
  .profile-indicator__status {
    width: 12px;
    height: 12px;
  }
  
  .whatsapp-btn {
    width: 56px;
    height: 56px;
  }
  
  .whatsapp-btn__icon {
    width: 30px;
    height: 30px;
  }
  
  /* Tooltip adjustments for mobile if needed, though hover is rare */
}

/* ------------------------------------------------
   Animations
   ------------------------------------------------ */
@keyframes fw-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
