#shapeFloatingToolbar {
  position: fixed;
  padding: 8px 14px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 99999;

  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);

  transition: opacity .15s ease, transform .15s ease;
  opacity: 0;
  pointer-events: none;

  transform: translateY(-6px);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: visible;
}

.shape-toolbar-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.shape-toolbar-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.tb-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.tb-btn i {
  font-size: 20px;
  color: #444;
  transition: transform .15s ease, color .2s ease;
}

.tb-btn:hover i {
  color: #e2a93b; /* BioVisuals Gold */
  transform: scale(1.12);
}

.tb-btn.danger:hover i {
  color: #e74c3c;
}
.tb-btn:disabled i {
  color: #aaa;
  cursor: not-allowed;
}

/* Dropdown styles */
.tb-dropdown {
  position: relative;
  display: none;
}

.tb-dropdown .tb-btn {
  position: relative;
}

.tb-submenu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 4px 0;
  margin-bottom: 8px;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100000;
}

.tb-submenu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: white;
}

/* Downward opening submenu */
.tb-dropdown.open-down .tb-submenu {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 8px;
}

.tb-dropdown.open-down .tb-submenu::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: white;
}

.tb-dropdown.open .tb-submenu {
  opacity: 1;
  visibility: visible;
}

.tb-submenu button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: #444;
  transition: background-color 0.2s ease;
}

.tb-submenu button:hover {
  background-color: #f5f5f5;
  color: #e2a93b;
}

.tb-submenu button i {
  font-size: 11px;
  width: 12px;
}

/* Tooltip styles */
.tb-btn {
  position: relative;
}

.tb-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100000;
  margin-bottom: 6px;
}

.tb-btn::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100000;
  margin-bottom: 3px;
}

.tb-btn:hover::after,
.tb-btn:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Hide tooltip when submenu is open */
.tb-dropdown.open .tb-btn::after,
.tb-dropdown.open .tb-btn::before {
  opacity: 0;
  visibility: hidden;
}

#lockedUnlockBadge {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: pointer;

  transition: opacity .12s ease, transform .12s ease;
  opacity: 0;
  pointer-events: none;
}

#lockedUnlockBadge i {
  font-size: 18px;
  color: #10b981; /* green unlock symbol */
}

.locked-badge-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.locked-badge-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}
