/* ========================================
   ImageTools — Compare Page Styles
   ======================================== */
/* --- Tool Header --- */
.tool-header { 
  text-align: center; 
  padding: 48px 0 32px; 
  position: relative; 
  z-index: 1; 
}
.tool-header .section-label { margin-left: auto; margin-right: auto; }
.tool-header .section-title { margin-left: auto; margin-right: auto; }
.tool-header .section-subtitle { margin-left: auto; margin-right: auto; margin-bottom: 24px; }
.workspace {
  background: var(--color-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.compare-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compare-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

/* ... other styles remain the same ... */

.compare-before, .compare-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.compare-before {
  z-index: 2;
  /* Use clip-path instead of width to prevent image squishing */
  clip-path: inset(0 50% 0 0); 
}

.compare-after {
  z-index: 1;
}

.compare-slider {
  position: absolute;
  top: 0;
  left: 50%; /* Controlled by JS */
  width: 2px;
  height: 100%;
  background: #fff;
  z-index: 3;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Invisible wrapper to make grabbing easier */
.compare-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: -20px;
  width: 40px;
  height: 100%;
}

.compare-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  color: var(--color-text);
}

.compare-arrow i {
  width: 20px;
  height: 20px;
}

.compare-label {
  position: absolute;
  top: 16px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 100px;
  z-index: 4;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.before-label { left: 16px; }
.after-label { right: 16px; }

/* Empty State */
.compare-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-text-muted);
  text-align: center;
  pointer-events: none;
  padding: 20px;
}

.compare-empty-state i {
  width: 32px;
  height: 32px;
}

/* Bottom Layout */
.compare-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.compare-summary {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.compare-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Share Section (If not already global) */
.share-section {
  margin-top: 48px;
  padding: 32px;
  background: var(--color-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.share-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.share-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.share-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}

.share-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Responsive */
@media (max-width: 768px) {
  .workspace {
    padding: 20px;
  }
  .compare-container {
    aspect-ratio: 4/3; /* Better for mobile */
  }
}