/* ==========================================================================
   DENTALINS — BEFORE/AFTER SHOWCASE (before-after.css)
   DentSPA-style showcase: Left content + right large slider.
   BEM: .ba (BeforeAfter), .ba-showcase (Showcase wrapper)
   ========================================================================== */


/* ======================================================================
   1. SHOWCASE LAYOUT
   ====================================================================== */

.ba-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: center;
}

@media (min-width: 768px) {
  .ba-showcase {
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--space-12);
  }
}

@media (min-width: 1024px) {
  .ba-showcase {
    grid-template-columns: 0.8fr 1.2fr;
    gap: var(--space-16);
  }
}


/* ======================================================================
   2. CONTENT SIDE (Left)
   ====================================================================== */

.ba-showcase__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Decorative smile icon */
.ba-showcase__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-400);
  margin-bottom: var(--space-2);
}

.ba-showcase__icon svg {
  width: 48px;
  height: 48px;
}

.ba-showcase__tag {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-primary-500);
}

.ba-showcase__title {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  color: var(--color-secondary-500);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

.ba-showcase__text {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 38ch;
}

/* Gallery link */
.ba-showcase__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-secondary-500);
  text-decoration: none;
  transition: all var(--transition-hover);
  margin-top: var(--space-2);
}

.ba-showcase__link svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-hover);
}

.ba-showcase__link:hover {
  color: var(--color-primary-500);
}

.ba-showcase__link:hover svg {
  transform: translateX(4px);
}

/* Nav arrows */
.ba-showcase__nav {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.ba-showcase__arrow {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-neutral-300);
  background: var(--color-neutral-50);
  color: var(--color-secondary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ba-showcase__arrow svg {
  width: 22px;
  height: 22px;
}

.ba-showcase__arrow:hover {
  border-color: var(--color-primary-500);
  color: var(--color-neutral-0);
  background: var(--color-primary-500);
  box-shadow: 0 4px 16px rgba(var(--btn-primary-rgb), 0.35);
  transform: scale(1.05);
}

.ba-showcase__arrow:active {
  transform: scale(0.96);
  background: var(--color-primary-600);
}


/* ======================================================================
   3. STAGE SIDE (Right — slider area)
   ====================================================================== */

.ba-showcase__stage {
  position: relative;
}

/* Case wrapper — stacked, only active visible */
.ba-showcase__case {
  display: none;
}

.ba-showcase__case.is-active {
  display: block;
  animation: baFadeIn 400ms var(--ease-smooth) both;
}

@keyframes baFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


/* ======================================================================
   4. SLIDER CARD (reused .ba)
   ====================================================================== */

.ba {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 4px 20px rgba(0, 0, 0, 0.06);
  aspect-ratio: 4 / 3;
  background-color: var(--color-neutral-100);
}

@media (min-width: 768px) {
  .ba {
    aspect-ratio: 16 / 11;
  }
}


/* ======================================================================
   5. IMAGES
   ====================================================================== */

.ba__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* "Before" resim — üstte, clip ile kırpılır */
.ba__image--before {
  z-index: 2;
  clip-path: inset(0 50% 0 0); /* default %50 */
}

/* "After" resim — altta, tam görünür */
.ba__image--after {
  z-index: 1;
}


/* ======================================================================
   6. DIVIDER LINE
   ====================================================================== */

.ba__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: var(--color-neutral-0);
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}


/* ======================================================================
   7. HANDLE (drag knob)
   ====================================================================== */

.ba__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--color-neutral-0);
  border: 3px solid var(--color-primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal);
}

.ba:hover .ba__handle,
.ba:active .ba__handle {
  transform: translate(-50%, -50%) scale(1.12);
}

.ba__handle-icon {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--color-primary-500);
}

.ba__handle-icon svg {
  width: 14px;
  height: 14px;
}


/* ======================================================================
   8. LABELS
   ====================================================================== */

.ba__label {
  position: absolute;
  bottom: var(--space-3);
  z-index: 5;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.ba__label--before {
  left: var(--space-3);
  background-color: rgba(11, 29, 58, 0.75);
  color: var(--color-neutral-0);
}

.ba__label--after {
  right: var(--space-3);
  background-color: rgba(5, 160, 214, 0.75);
  color: var(--color-neutral-0);
}


/* ======================================================================
   9. RANGE INPUT (invisible slider overlay)
   ====================================================================== */

.ba__range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  opacity: 0;
  cursor: col-resize;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.ba__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1px;
  height: 100%;
}

.ba__range::-moz-range-thumb {
  width: 1px;
  height: 100%;
  border: none;
  background: transparent;
}

/* Focus ring for keyboard users */
.ba__range:focus-visible ~ .ba__handle {
  outline: 3px solid var(--color-primary-300);
  outline-offset: 3px;
}


/* ======================================================================
   10. TREATMENT INFO + DOTS (below image)
   ====================================================================== */

.ba-showcase__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.ba-showcase__treatment {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-secondary-500);
}

.ba-showcase__treatment span {
  font-weight: var(--weight-normal);
  color: var(--color-text-secondary);
}

.ba-showcase__dots {
  display: flex;
  gap: var(--space-2);
}

.ba-showcase__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-neutral-300);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-hover);
}

.ba-showcase__dot.is-active {
  background-color: var(--color-primary-500);
  border-color: var(--color-primary-500);
  transform: scale(1.2);
}

.ba-showcase__dot:hover:not(.is-active) {
  border-color: var(--color-primary-400);
}


/* ======================================================================
   11. CTA BUTTON (below showcase)
   ====================================================================== */

.ba-showcase__cta {
  display: flex;
  justify-content: center;
  padding-top: var(--space-6);
}

.ba-showcase__cta .btn {
  display: inline-flex;
  align-items: center;
}


/* ======================================================================
   12. SCROLL ANIMATION
   ====================================================================== */

.ba-showcase__content,
.ba-showcase__stage {
  opacity: 0;
  transition:
    opacity var(--transition-reveal),
    transform var(--transition-reveal);
}

.ba-showcase__content {
  transform: translateX(-30px);
}

.ba-showcase__stage {
  transform: translateX(30px);
}

.ba-showcase.is-visible .ba-showcase__content,
.ba-showcase.is-visible .ba-showcase__stage {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .ba-showcase__content,
  .ba-showcase__stage {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ba-showcase__case.is-active {
    animation: none;
  }
}
