/* ==========================================================================
   BEFORE / AFTER COMPARISON SLIDER STYLES
   ========================================================================== */

.comparison-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #05070a;
  background-image: 
    linear-gradient(45deg, #0b0e14 25%, transparent 25%), 
    linear-gradient(-45deg, #0b0e14 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0b0e14 75%), 
    linear-gradient(-45deg, transparent 75%, #0b0e14 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.comparison-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-out;
}

/* Image Layers */
.img-layer {
  display: block;
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  pointer-events: none;
}

.img-after-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.img-after {
  display: block;
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.img-before-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%; /* Slider position */
  overflow: hidden;
  border-right: 2px solid var(--accent-cyan);
  box-shadow: 2px 0 15px rgba(0, 229, 255, 0.4);
}

.img-before {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

/* Handle Slider */
.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  cursor: ew-resize;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}

.handle-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  border: 2px solid var(--accent-cyan);
  cursor: ew-resize;
  transition: transform 0.15s ease;
}

.handle-button svg {
  width: 18px;
  height: 18px;
}

.comparison-handle:hover .handle-button,
.comparison-handle.active .handle-button {
  transform: scale(1.15);
  box-shadow: 0 0 25px rgba(0, 229, 255, 1);
}

/* Floating Badges on the Image */
.comparison-badge {
  position: absolute;
  top: 1rem;
  z-index: 25;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.badge-left {
  left: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-right {
  right: 1rem;
  background: rgba(0, 229, 255, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* Side by Side View Mode */
.comparison-container.mode-side-by-side .comparison-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.comparison-container.mode-side-by-side .img-before-wrapper {
  position: relative;
  width: 100%;
  border-right: none;
  box-shadow: none;
}

.comparison-container.mode-side-by-side .img-before {
  position: relative;
  width: 100%;
  height: auto;
}

.comparison-container.mode-side-by-side .comparison-handle {
  display: none;
}
