.fba-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  cursor: ew-resize;
}

.fba-handle-bar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 2px;
  background-color: #ffffff;
  z-index: 3;
  pointer-events: none;
}

.fba-container[data-orientation="vertical"] {
  cursor: ns-resize;
}

.fba-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.fba-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.fba-before-image {
  z-index: 1;
}

.fba-after-image {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.fba-container[data-orientation="vertical"] .fba-after-image {
  clip-path: inset(0 0 50% 0);
}

.fba-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  background-color: #ffffff;
  border: 2px solid #000000;
  border-radius: 50%;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #000000;
  transition: all 0.3s ease;
  overflow: hidden;
  touch-action: none;
}

.fba-handle:active {
  cursor: grabbing;
}

.fba-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.fba-handle--ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 140%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
  animation: fba-ripple 1.8s infinite;
}

@keyframes fba-ripple {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0.6;
  }

  70% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0;
  }
}

.fba-container[data-orientation="vertical"] .fba-handle {
  top: 50%;
  left: 50%;
}

.fba-label {
  position: absolute;
  top: 10px;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  z-index: 4;
}

.fba-before-label {
  right: 10px;
}

.fba-after-label {
  left: 10px;
}

.fba-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.fba-error {
  padding: 20px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  text-align: center;
  color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fba-handle {
    width: 30px !important;
    height: 30px !important;
    font-size: 12px;
  }

  .fba-label {
    font-size: 12px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .fba-handle {
    width: 25px !important;
    height: 25px !important;
    font-size: 10px;
  }

  .fba-label {
    font-size: 10px;
    padding: 2px 6px;
  }
}