/* Extracted from the students list: the single bulk FAB design reference. */
/* ============================================
   Students FAB (Floating Action Buttons) Styles
   ============================================ */

/* === Base FAB Container === */
.bulk-actions-fab {
  position: fixed;
  left: 18px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px) + var(--bulk-fab-navigation-offset, 0px));
  max-width: calc(100vw - 36px);
  pointer-events: none;
  transform: translateY(140%);
  background: transparent;
  border: none;
  padding: 0;
  z-index: 1051;
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.16, 0.8, 0.24, 1), opacity 0.35s ease;
  direction: rtl;
  will-change: transform;
}

.bulk-actions-fab:is(.show, .active) {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* === FAB Actions Container === */
.bulk-actions-fab .fab-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.4, 1);
}

/* === Collapsed State === */
.bulk-actions-fab.collapsed .fab-btn:not(.count-btn) {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateX(80px) scale(0) !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease, transform 0.35s ease, visibility 0.25s ease !important;
}

.bulk-actions-fab.collapsed .fab-actions {
  gap: 0 !important;
  transition: gap 0.25s ease;
}

/* === Individual FAB Button === */
.bulk-actions-fab .fab-btn {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
  border-radius: 50%;
  background: var(--fab-bg, #6366f1);
  border: none;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.2), 0 2px 6px -1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.7);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.4, 1), opacity 0.45s ease, box-shadow 0.35s ease, background 0.25s ease;
  will-change: transform, opacity;
}

/* Keep each page's icon; use the reference size and alignment for fonts and SVGs. */
.bulk-actions-fab .fab-btn > i,
.bulk-actions-fab .main-close-btn > i {
  color: inherit !important;
  font-size: inherit;
  margin: 0;
}

.bulk-actions-fab .fab-btn > svg {
  width: 1em;
  height: 1em;
  display: block;
  flex-shrink: 0;
}

.bulk-actions-fab .count-btn > i { font-size: 18px; }

/* Semantic aliases only style existing actions; their original event keys stay intact. */
.bulk-actions-fab [data-bulk-fab-kind="delete"] { --fab-bg: var(--fab-color-delete) !important; }
.bulk-actions-fab [data-bulk-fab-kind="edit"] { --fab-bg: var(--fab-color-edit) !important; }
.bulk-actions-fab [data-bulk-fab-kind="excel"] { --fab-bg: var(--fab-color-excel) !important; }
.bulk-actions-fab [data-bulk-fab-kind="grade"] { --fab-bg: var(--fab-color-grade) !important; }
.bulk-actions-fab [data-bulk-fab-kind="copyToBranch"] { --fab-bg: var(--fab-color-copyToBranch) !important; }
.bulk-actions-fab [data-bulk-fab-kind="absence"] { --fab-bg: var(--fab-color-absence) !important; }
.bulk-actions-fab [data-bulk-fab-kind="award"] { --fab-bg: var(--fab-color-award) !important; }
.bulk-actions-fab [data-bulk-fab-kind="transfer"] { --fab-bg: var(--fab-color-transfer) !important; }
.bulk-actions-fab [data-bulk-fab-kind="copyPass"] { --fab-bg: var(--fab-color-copyPass) !important; }
.bulk-actions-fab [data-bulk-fab-kind="pledge"] { --fab-bg: var(--fab-color-pledge) !important; }
.bulk-actions-fab [data-bulk-fab-kind="printDetails"] { --fab-bg: var(--fab-color-printDetails) !important; }
.bulk-actions-fab [data-bulk-fab-kind="printTelawa"] { --fab-bg: var(--fab-color-printTelawa) !important; }
.bulk-actions-fab [data-bulk-fab-kind="printHifz"] { --fab-bg: var(--fab-color-printHifz) !important; }
.bulk-actions-fab [data-bulk-fab-kind="approve"] { --fab-bg: var(--fab-color-approve) !important; }
.bulk-actions-fab [data-bulk-fab-kind="send"] { --fab-bg: var(--fab-color-send) !important; }
.bulk-actions-fab [data-bulk-fab-kind="hide"] { --fab-bg: #64748b; }
.bulk-actions-fab [data-bulk-fab-kind="pin"] { --fab-bg: #f59e0b; }
.bulk-actions-fab [data-bulk-fab-kind="announcement"] { --fab-bg: #0284c7; }
.bulk-actions-fab [data-bulk-fab-kind="comments"] { --fab-bg: #6366f1; }
.bulk-actions-fab [data-bulk-fab-kind="pay"] { --fab-bg: #16a34a; }
.bulk-actions-fab [data-bulk-fab-kind="pay"]:hover { --fab-bg: #15803d; }
.bulk-actions-fab [data-bulk-fab-kind="whatsapp"] {
  --fab-bg: #25d366 !important;
  background: #25d366;
  border-color: #25d366;
}
.bulk-actions-fab [data-bulk-fab-kind="whatsapp"]:hover {
  --fab-bg: #1da851 !important;
  background: #1da851;
  border-color: #1da851;
}

.bulk-actions-fab:is(.show, .active) .fab-btn {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* === Staggered Animation Delays === */
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(1) { transition-delay: 0.05s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(2) { transition-delay: 0.1s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(3) { transition-delay: 0.15s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(4) { transition-delay: 0.2s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(5) { transition-delay: 0.25s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(6) { transition-delay: 0.3s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(7) { transition-delay: 0.35s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(8) { transition-delay: 0.4s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(9) { transition-delay: 0.45s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(10) { transition-delay: 0.5s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(11) { transition-delay: 0.55s; }
.bulk-actions-fab:is(.show, .active) .fab-btn:nth-child(12) { transition-delay: 0.6s; }

/* === Hover Effects === */
.bulk-actions-fab .fab-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.35), 0 6px 16px -4px rgba(0, 0, 0, 0.2);
  animation: fabHoverPulse 0.6s ease-in-out infinite alternate;
}

.bulk-actions-fab .fab-btn:active {
  transform: translateY(-2px) scale(0.95);
  transition: transform 0.1s ease;
}

@keyframes fabHoverPulse {
  0% { transform: translateY(-5px) scale(1.1); }
  100% { transform: translateY(-7px) scale(1.12); }
}

/* === Disabled State === */
.bulk-actions-fab .fab-btn.disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.6) !important;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.15) !important;
}

.bulk-actions-fab .fab-btn.disabled:hover {
  transform: none !important;
  animation: none !important;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.15) !important;
}

/* === Tooltips === */
.bulk-actions-fab .fab-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #1f2937;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.bulk-actions-fab .fab-btn[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.bulk-actions-fab .fab-btn[data-tip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1000;
}

.bulk-actions-fab .fab-btn[data-tip]:hover::before {
  opacity: 1;
}

/* === Count Button (Main Toggle) === */
.bulk-actions-fab .fab-btn.count-btn {
  --fab-bg: #4f46e5 !important;
  background: linear-gradient(145deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 6px 20px -4px rgba(79, 70, 229, 0.4), 0 3px 10px -2px rgba(79, 70, 229, 0.3) !important;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.bulk-actions-fab .main-close-btn {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  position: relative;
}

/* === Count Badge === */
.bulk-actions-fab .count-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #dc2626, #ef4444);
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 3px 8px -2px rgba(220, 38, 38, 0.4);
  transition: all 0.25s ease;
}

.bulk-actions-fab .count-badge.pulse {
  animation: fabCountPulse 0.6s ease;
}

.bulk-actions-fab .count-badge:hover {
  background: linear-gradient(145deg, #b91c1c, #dc2626);
  transform: scale(1.1);
  box-shadow: 0 4px 12px -2px rgba(220, 38, 38, 0.6);
}

/* === Ripple Effect === */
.bulk-actions-fab .fab-btn.count-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.bulk-actions-fab .fab-btn.count-btn:active::before {
  width: 60px;
  height: 60px;
}

@keyframes fabCountPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* === Focus State === */
.bulk-actions-fab .fab-btn:focus {
  outline: 3px solid rgba(79, 70, 229, 0.5);
  outline-offset: 2px;
}

/* Retain notification action names in the DOM and accessible labels. */
.bulk-actions-fab .bulk-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bulk-actions-fab .bulk-select-all input { margin: 0 !important; }

/* === Touch Devices === */
@media (hover: none) and (pointer: coarse) {
  .bulk-actions-fab .fab-btn:active {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease !important;
  }
  .bulk-actions-fab .fab-btn.count-btn:active {
    transform: scale(0.9) !important;
  }
}

/* === Tablet Responsive === */
@media (max-width: 768px) {
  .bulk-actions-fab {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--bulk-fab-navigation-offset, 0px));
    max-width: calc(100vw - 24px);
  }
  .bulk-actions-fab .fab-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 14px !important;
  }
  .bulk-actions-fab .fab-btn.count-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
  }
  .bulk-actions-fab .count-badge {
    width: 18px !important;
    height: 18px !important;
    font-size: 9px !important;
    top: -6px !important;
    right: -6px !important;
  }
  .bulk-actions-fab .fab-actions {
    gap: 4px !important;
  }
  .bulk-actions-fab.collapsed .fab-btn:not(.count-btn) {
    transform: translateX(50px) scale(0) !important;
  }
}

