/**
 * Image Comparison Slider Styles
 */

/* Comparison Container */
.comparison-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  cursor: col-resize;
  user-select: none;
  margin-bottom: var(--spacing-md);
}

/* Comparison Images */
.comparison-before,
.comparison-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-before {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.comparison-after {
  z-index: 1;
}

/* Comparison Slider */
.comparison-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background-color: var(--white);
  z-index: 3;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Comparison Slider Handle */
.comparison-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  border: 3px solid var(--white);
  border-radius: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}

.comparison-slider-handle::before,
.comparison-slider-handle::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 2px;
  background-color: var(--white);
}

.comparison-slider-handle::before {
  transform: translateX(-5px) rotate(45deg);
}

.comparison-slider-handle::after {
  transform: translateX(5px) rotate(-45deg);
}

/* Active Handle State */
.comparison-slider-handle.active {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Comparison Labels */
.comparison-label {
  position: absolute;
  bottom: 20px;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 5;
}

.comparison-label-before {
  left: 20px;
}

.comparison-label-after {
  right: 20px;
}

/* Comparison Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .comparison-slider-handle {
    width: 30px;
    height: 30px;
  }
  
  .comparison-label {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
}

/* Aspect Ratio Container */
.comparison-aspect-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
}

.comparison-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}