/* Before/After Comparison Styles */

.before-after-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.before-after-label {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
}

.before-after-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 158, 255, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Slider Mode */
.before-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

.before-after-slider {
  position: absolute;
  top: 0;
  width: 4px;
  height: 100%;
  background: white;
  cursor: ew-resize;
  z-index: 10;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.before-after-slider::before,
.before-after-slider::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-style: solid;
}

.before-after-slider::before {
  top: 50%;
  margin-top: -30px;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
}

.before-after-slider::after {
  top: 50%;
  margin-top: 10px;
  border-width: 10px 10px 10px 0;
  border-color: transparent white transparent transparent;
}

/* Active button state */
.canvas-tool-btn.active {
  background: #4a9eff;
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .before-after-label {
    font-size: 12px;
    padding: 6px 12px;
  }

  .before-after-hint {
    font-size: 11px;
    padding: 8px 16px;
  }
}

/* Smooth transitions */
.before-image,
.before-after-slider {
  transition: opacity 0.3s ease;
}

/* Hover effects */
.before-after-slider:hover {
  background: #4a9eff;
}

.before-after-slider:hover::before {
  border-left-color: #4a9eff;
}

.before-after-slider:hover::after {
  border-right-color: #4a9eff;
}

/* Floating Button */
.before-after-floating-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.6);
  background: linear-gradient(135deg, #3a8eef 0%, #2a7edf 100%);
}

.floating-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(74, 158, 255, 0.4);
}

.floating-btn svg {
  width: 24px;
  height: 24px;
}

.floating-btn span {
  font-size: 15px;
  letter-spacing: 0.3px;
}

/* Floating Menu */
.floating-btn-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #2a2a2a;
  border: 1px solid #3c3c3c;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 180px;
}

.before-after-floating-btn:hover .floating-btn-menu {
  display: flex;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.floating-menu-item:hover {
  background: #3a3a3a;
  color: #4a9eff;
}

.floating-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Active state */
.floating-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.floating-btn.active:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Pulse animation when first shown */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(74, 158, 255, 0.8);
  }
}

.floating-btn.first-time {
  animation: pulse-glow 2s ease-in-out 3;
}

/* Responsive */
@media (max-width: 768px) {
  .before-after-floating-btn {
    bottom: 80px;
    right: 15px;
  }

  .floating-btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .floating-btn span {
    display: none;
  }

  .floating-btn svg {
    width: 20px;
    height: 20px;
  }

  .floating-btn-menu {
    min-width: 150px;
  }

  .floating-menu-item {
    padding: 8px 12px;
    font-size: 13px;
  }
}
