/* ================================================
   Before/After Slider Styles
   Prefix: ba-slider- (to avoid conflicts)
   ================================================ */

/* Container */
.ba-slider-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  user-select: none;
  -webkit-user-select: none;
  margin: 20px auto;
  max-width: 100%;
  background: #f0f0f0;
}

/* Images */
.ba-slider-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ba-slider-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Before image is on bottom layer */
.ba-slider-before {
  z-index: 1;
}

/* After image is clipped by the slider position */
.ba-slider-after {
  z-index: 2;
  clip-path: inset(0 0 0 50%);
}

/* Handle */
.ba-slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  z-index: 3;
  cursor: ew-resize;
  transform: translateX(-50%);
}

.ba-slider-handle-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}

.ba-slider-handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ba-slider-handle:hover .ba-slider-handle-circle,
.ba-slider-handle:active .ba-slider-handle-circle {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.ba-slider-handle-circle svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Labels */
.ba-slider-label {
  position: absolute;
  top: 20px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  z-index: 4;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ba-slider-label-before {
  left: 20px;
}

.ba-slider-label-after {
  right: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ba-slider-container {
    border-radius: 8px;
  }
  
  .ba-slider-handle-circle {
    width: 40px;
    height: 40px;
  }
  
  .ba-slider-handle-circle svg {
    width: 20px;
    height: 20px;
  }
  
  .ba-slider-label {
    font-size: 12px;
    padding: 6px 12px;
    top: 12px;
  }
  
  .ba-slider-label-before {
    left: 12px;
  }
  
  .ba-slider-label-after {
    right: 12px;
  }
}

@media (max-width: 480px) {
  .ba-slider-handle-circle {
    width: 36px;
    height: 36px;
  }
  
  .ba-slider-handle-circle svg {
    width: 18px;
    height: 18px;
  }
  
  .ba-slider-label {
    font-size: 11px;
    padding: 5px 10px;
    top: 10px;
  }
}

/* Loading state */
.ba-slider-container.ba-slider-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: ba-slider-loading 1.5s ease-in-out infinite;
}

@keyframes ba-slider-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Accessibility - Focus states */
.ba-slider-handle:focus {
  outline: none;
}

.ba-slider-handle:focus .ba-slider-handle-circle {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5), 0 6px 30px rgba(0, 0, 0, 0.3);
}

/* Prevent text selection during drag */
.ba-slider-container.ba-slider-dragging {
  cursor: ew-resize;
}

.ba-slider-container.ba-slider-dragging * {
  cursor: ew-resize !important;
}