/* Image Comparison Widget Styles */
.eafe-image-comparison-wrapper {
  width: 100%;
  margin-bottom: 20px;
}

.eafe-image-comparison-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  margin-bottom: 15px;
}

.eafe-image-comparison-container:hover {
  transform: translateY(-5px);
}

.eafe-image-comparison-container img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
}

.eafe-image-comparison-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.eafe-image-comparison-before img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eafe-image-comparison-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: #fff;
  cursor: ew-resize;
  z-index: 10;
  transform: translateX(-50%);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.eafe-image-comparison-handle:hover {
  width: 6px;
  background: #f8f8f8;
}

.eafe-image-comparison-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.eafe-image-comparison-handle::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #3498db;
  font-size: 18px;
  font-weight: bold;
}

.eafe-image-comparison-handle:hover::before {
  width: 46px;
  height: 46px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Vertical orientation */
.eafe-image-comparison-wrapper[data-orientation='vertical']
  .eafe-image-comparison-container {
  height: 500px;
}

.eafe-image-comparison-wrapper[data-orientation='vertical']
  .eafe-image-comparison-container
  img {
  height: 100%;
  object-fit: cover;
}

.eafe-image-comparison-wrapper[data-orientation='vertical']
  .eafe-image-comparison-before {
  width: 100%;
  height: 50%;
}

.eafe-image-comparison-wrapper[data-orientation='vertical']
  .eafe-image-comparison-handle {
  width: 100%;
  height: 4px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  cursor: ns-resize;
}

.eafe-image-comparison-wrapper[data-orientation='vertical']
  .eafe-image-comparison-handle:hover {
  width: 100%;
  height: 6px;
}

.eafe-image-comparison-wrapper[data-orientation='vertical']
  .eafe-image-comparison-handle::after {
  content: '↕';
}

/* Badges */
.eafe-badge {
  position: absolute;
  top: 20px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 20px;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 5;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  opacity: 1;
  visibility: visible;
}

.eafe-badge-before {
  left: 20px;
  transform: none;
  background: rgba(44, 62, 80, 0.85);
}

.eafe-badge-after {
  right: 20px;
  background: rgba(231, 76, 60, 0.85);
}

.eafe-badge.hidden {
  opacity: 0;
  visibility: hidden;
}

.eafe-badge i {
  margin-right: 6px;
}

/* Control buttons */
.eafe-comparison-controls {
  margin: 15px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.eafe-comparison-controls button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background: #3498db;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.eafe-comparison-controls button:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.eafe-comparison-controls button:active {
  transform: translateY(0);
}

/* Caption */
.eafe-comparison-caption {
  margin-top: 10px;
  color: #7f8c8d;
  font-size: 15px;
}

/* Percentage indicator */
.eafe-percentage {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 15px;
  font-size: 13px;
  font-weight: bold;
  z-index: 5;
  backdrop-filter: blur(4px);
}

/* Responsive design */
@media (max-width: 768px) {
  .eafe-image-comparison-handle::before {
    width: 36px;
    height: 36px;
  }

  .eafe-image-comparison-handle:hover::before {
    width: 40px;
    height: 40px;
  }

  .eafe-badge {
    font-size: 12px;
    padding: 6px 12px;
  }

  .eafe-comparison-controls {
    flex-direction: column;
    align-items: center;
  }

  .eafe-comparison-controls button {
    width: 100%;
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .eafe-badge {
    top: 10px;
    padding: 5px 10px;
  }

  .eafe-badge-before {
    left: 10px;
  }

  .eafe-badge-after {
    right: 10px;
  }

  .eafe-percentage {
    bottom: 10px;
    font-size: 11px;
  }

  .eafe-comparison-caption {
    font-size: 13px;
  }
}
