/* Minimal custom CSS only for comparison mechanics (slider handle, clipping, drag-and-drop state) */

/* Upload Dropzone styling overlay */
.dropzone-card {
  border-style: dashed !important;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone-card:hover {
  border-color: var(--bs-primary) !important;
}

.dropzone-card.drag-over {
  border-color: var(--bs-info) !important;
  background-color: var(--bs-secondary-bg) !important;
}

.dropzone-card.has-file {
  border-style: solid !important;
  border-color: var(--bs-primary-border-subtle) !important;
}

/* Comparison viewer container */
#viewer-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

/* Slider comparison mechanics */
.compare-stage {
  position: relative;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.img-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 0;
  max-width: 100%;
  margin: 0 auto;
}

.img-wrapper img#img-b-slider {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  margin: 0 auto;
  pointer-events: none;
}

.clip-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.clip-wrapper img#img-a-slider {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

/* Large view class when expanded */
.viewer-expanded .compare-stage .img-wrapper img#img-b-slider,
.viewer-expanded #side-by-side-view img,
.viewer-expanded .fade-wrapper img {
  max-height: 88vh;
}

.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 40px;
  margin-left: -20px;
  cursor: ew-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}

.handle-line {
  position: absolute;
  width: 2px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.handle-button {
  position: relative;
  width: 36px;
  height: 36px;
  background-color: var(--bs-primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.15s ease;
}

.slider-handle:hover .handle-button,
.slider-handle.dragging .handle-button {
  transform: scale(1.15);
}

/* Side by side stage */
#side-by-side-view img {
  max-height: 70vh;
  object-fit: contain;
}

/* Fade stage */
.fade-wrapper {
  display: block;
  line-height: 0;
  max-width: 100%;
}

.fade-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: 0 auto;
}

#img-a-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.privacy-pill svg {
  color: #10b981;
}

/* Responsive */
@media (max-width: 768px) {
  .upload-section {
    grid-template-columns: 1fr;
  }

  .side-by-side-stage {
    grid-template-columns: 1fr;
  }

  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-selector {
    justify-content: center;
  }

  .actions-group {
    justify-content: center;
  }
}
