/* ==========================================================
   Badr Clinic - Floating Quick Contact Speed Dial (FAB)
   Locked strictly to bottom-left corner, 60fps, Zero bloat
========================================================== */

/* 1. Main Corner Anchor Container */
.fab-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 58px;
  height: 58px;
  z-index: 1040;
  pointer-events: none;
}

/* 2. Main Trigger Button (Strictly anchored at the bottom-left corner) */
.fab-trigger {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #122A6B;
  color: #FFFFFF;
  box-shadow: 0 10px 28px rgba(9, 26, 56, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.3s ease;
  will-change: transform;
}

.fab-trigger:hover,
.fab-trigger:focus-visible {
  transform: scale(1.08);
  background: #1A3E96;
  box-shadow: 0 12px 32px rgba(18, 42, 107, 0.6);
}

.fab-trigger:active {
  transform: scale(0.94);
}

/* Icons inside Trigger */
.fab-icon-chat,
.fab-icon-close {
  position: absolute;
  width: 26px;
  height: 26px;
  stroke: #FFFFFF !important;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.fab-icon-chat {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.fab-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

/* Active State: Trigger morphs to close icon */
.fab-container.is-open .fab-trigger {
  background: #091A38;
  border-color: rgba(18, 42, 107, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.fab-container.is-open .fab-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.fab-container.is-open .fab-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 3. Sub-Items Menu List (Floats directly above the trigger button) */
.fab-menu {
  position: absolute;
  bottom: 70px;
  left: 0;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.fab-item {
  display: flex;
  direction: ltr; /* Keeps icon anchored at left, label expanding to right */
  align-items: center;
  gap: 12px;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.65);
  transform-origin: bottom left;
  transition:
    opacity 0.22s ease,
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.32s;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Expanded state: Cascade smoothly */
.fab-container.is-open .fab-item {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-container.is-open .fab-item:nth-child(1) { transition-delay: 0.03s; }
.fab-container.is-open .fab-item:nth-child(2) { transition-delay: 0.08s; }
.fab-container.is-open .fab-item:nth-child(3) { transition-delay: 0.13s; }

/* 4. Sub-Item Action Buttons (Anchored at left column) */
.fab-action-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
  flex-shrink: 0;
}

.fab-action-btn svg {
  width: 22px;
  height: 22px;
  color: #FFFFFF !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

.fab-item:hover .fab-action-btn,
.fab-item:focus-visible .fab-action-btn {
  transform: scale(1.12);
  filter: brightness(1.15);
}

/* Colors for each action (Pure Solid Colors - Zero Gradients) */
.fab-btn-whatsapp {
  background: #16A34A;
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.fab-btn-call {
  background: #122A6B;
  box-shadow: 0 6px 20px rgba(18, 42, 107, 0.4);
}

.fab-btn-location {
  background: #091A38;
  box-shadow: 0 6px 20px rgba(9, 26, 56, 0.4);
}

/* 5. Sub-Item Labels (Glassmorphism Pill expanding to the right) */
.fab-label {
  direction: rtl;
  background: rgba(9, 26, 56, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(18, 42, 107, 0.3);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: auto;
  user-select: none;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.fab-item:hover .fab-label,
.fab-item:focus-visible .fab-label {
  background: rgba(9, 26, 56, 0.98);
  border-color: #122A6B;
  transform: translateX(3px);
}

/* Pulse hint on the main trigger when closed */
@keyframes fabGlowPulse {
  0%, 100% {
    box-shadow: 0 10px 28px rgba(18, 42, 107, 0.45), 0 0 0 0 rgba(18, 42, 107, 0.5);
  }
  50% {
    box-shadow: 0 10px 28px rgba(18, 42, 107, 0.55), 0 0 0 10px rgba(18, 42, 107, 0);
  }
}

.fab-container:not(.is-open) .fab-trigger {
  animation: fabGlowPulse 3s infinite ease-in-out;
}

/* Mobile responsive sizing */
@media (max-width: 640px) {
  .fab-container {
    bottom: 18px;
    left: 18px;
    width: 52px;
    height: 52px;
  }
  .fab-trigger {
    width: 52px;
    height: 52px;
  }
  .fab-menu {
    bottom: 62px;
  }
  .fab-action-btn {
    width: 44px;
    height: 44px;
  }
  .fab-action-btn svg {
    width: 20px;
    height: 20px;
  }
  .fab-label {
    font-size: 0.78rem;
    padding: 5px 12px;
  }
}

/* ==========================================================
   Badr Clinic - Floating Right Action Buttons (Services & Tour)
   Ultra-fast, GPU-accelerated, Zero bloat, Luxury aesthetic
========================================================== */

.floating-actions-right {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: flex-end;
  pointer-events: none;
}

.floating-right-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 9999px;
  background: rgba(18, 42, 107, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(9, 26, 56, 0.45), 0 0 12px rgba(18, 42, 107, 0.25);
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease;
  will-change: transform;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.floating-right-btn:hover,
.floating-right-btn:focus-visible {
  transform: translateY(-3px) scale(1.03);
  background: rgba(26, 62, 150, 0.98);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 14px 30px rgba(9, 26, 56, 0.6), 0 0 20px rgba(18, 42, 107, 0.45);
  color: #FFFFFF;
}

.floating-right-btn:active {
  transform: translateY(-1px) scale(0.97);
}

.floating-right-btn:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
}

.floating-right-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #FFFFFF !important;
  transition: transform 0.3s ease, color 0.3s ease;
}

.floating-right-icon svg {
  width: 22px;
  height: 22px;
  stroke: #FFFFFF !important;
  fill: none;
}

.floating-right-btn:hover .floating-right-icon {
  transform: scale(1.1);
  color: #FFFFFF;
}

/* زر جولة الفيديو: أيقونة تشغيل دائرية بنفس لون وتنسيق زر الخدمات تماماً */
.floating-right-video {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(9, 26, 56, 0.45), 0 0 12px rgba(18, 42, 107, 0.25);
}

.floating-right-video .floating-right-icon {
  width: 100%;
  height: 100%;
  color: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-right-video .floating-right-icon svg {
  width: 19px;
  height: 19px;
  stroke: none;
  fill: #FFFFFF !important;
  margin-right: -2px; /* محاذاة بصرية دقيقة لمركز مثلث التشغيل */
}

.floating-right-video:hover,
.floating-right-video:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(26, 62, 150, 0.98);
  box-shadow: 0 14px 30px rgba(9, 26, 56, 0.6), 0 0 20px rgba(18, 42, 107, 0.45);
}

.floating-right-video:hover .floating-right-icon svg {
  fill: #FFFFFF !important;
}

/* تجاوب الشاشات الصغيرة */
@media (max-width: 640px) {
  .floating-actions-right {
    bottom: 18px;
    right: 18px;
    gap: 9px;
  }

  .floating-right-btn {
    height: 44px;
    padding: 0 14px 0 12px;
    font-size: 12.5px;
    gap: 7px;
  }

  .floating-right-video {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .floating-right-icon {
    width: 20px;
    height: 20px;
  }

  .floating-right-icon svg {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 400px) {
  .floating-right-btn {
    padding: 0 12px 0 10px;
    font-size: 12px;
  }
}
