/* Base container positioning */
.fab-container {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Main Toggle Button */
.fab-toggle {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #ff8c00; /* Blue color from video */
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 100;
  transition: all 0.3s ease;
}

/* The continuous pulse/beep effect behind the main button */
.fab-toggle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(71, 85, 249, 0.5); /* Blue matching the button */
  border-radius: 50%;
  z-index: -1;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Pulse Animation Keyframes */
@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  70%, 100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Stop the pulse animation when the menu is open */
.fab-container.open .fab-toggle::before {
  animation: none;
  display: none;
}

/* Change main button to light grey when open (like the video) */
.fab-container.open .fab-toggle {
  background: #e2e8f0; /* Light grey */
  color: #475569;      /* Dark grey X icon */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Icon crossfade animations */
.fab-toggle i {
  position: absolute;
  transition: all 0.3s ease;
}

/* Closed state */
.fab-toggle .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.fab-toggle .icon-chat {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Opened state */
.fab-container.open .fab-toggle .icon-close {
  opacity: 1;
  transform: rotate(0) scale(1.1); /* Slightly larger X */
}

.fab-container.open .fab-toggle .icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* When the menu is OPEN */
.fab-container.open .fab-toggle .icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.fab-container.open .fab-toggle .icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* "Need Help?" Tooltip */
.need-help-tooltip {
  position: absolute;
  right: 95px;
  bottom: 12px;
  background: white;
  padding: 12px 20px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: #333;
  white-space: nowrap;
  transition: all 0.3s ease;
  z-index: 90;
}

/* Tooltip Arrow */
.need-help-tooltip::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px 0 7px 7px;
  border-style: solid;
  border-color: transparent transparent transparent white;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
}

/* Hide tooltip when open */
.fab-container.open .need-help-tooltip {
  opacity: 0;
  pointer-events: none;
  transform: translateX(15px);
}

/* Menu Options Container */
.fab-options {
  position: absolute;
  bottom: 90px;
  right: 7px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  visibility: hidden;
  pointer-events: none;
}

.fab-container.open .fab-options {
  visibility: visible;
  pointer-events: auto;
}

/* Individual Option Item */
.fab-option {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-container.open .fab-option {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for options appearing from bottom to top */
.fab-container.open .fab-option:nth-child(3) { transition-delay: 0.05s; }
.fab-container.open .fab-option:nth-child(2) { transition-delay: 0.1s; }
.fab-container.open .fab-option:nth-child(1) { transition-delay: 0.15s; }

/* Labels for sub-menus */
.option-label {
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

/* Sub-menu Buttons */
.option-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  text-decoration: none;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.option-btn:hover {
  transform: scale(1.1);
}

/* specific colors mimicking the video */
.whatsapp { background: #25D366; }
.call     { background: #3f05ec; } /* Soft Purple */
.email    { background: #ff1616; } /* Soft Red/Coral */

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
  .fab-container { bottom: 20px; right: 20px; }
  .need-help-tooltip { display: none; /* Often best to hide tooltips on mobile */ }
}