/* ========== BEFORE & AFTER SECTION ========== */

.beforeafter-section {
  position: relative;
  width: 100%;
  padding: 100px 48px;
  overflow: hidden;
}

.beforeafter-section:not(.dark-mode) {
  background: linear-gradient(160deg, oklch(13% 0.025 55) 0%, oklch(16% 0.03 58) 100%);
}

.beforeafter-section.dark-mode {
  background: linear-gradient(160deg, oklch(16% 0.03 58) 0%, oklch(12% 0.025 55) 100%);
}

.beforeafter-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* HEADER */
.beforeafter-header {
  text-align: center;
  margin-bottom: 70px;
}

.beforeafter-badge {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'Lato';
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: white;
  box-shadow: 0 8px 20px oklch(72% 0.11 75 / 0.4);
  animation: fadeUp 0.5s ease 0.1s both;
}

.beforeafter-title {
  font-family: 'Playfair Display';
  font-weight: 700;
  font-size: clamp(42px, 4.5vw, 58px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: oklch(96% 0.015 80);
  animation: fadeUp 0.6s ease 0.2s both;
}

.beforeafter-subtitle {
  font-family: 'Lato';
  font-weight: 300;
  font-size: 20px;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
  color: oklch(82% 0.02 78);
  animation: fadeUp 0.6s ease 0.3s both;
}

/* GRID */
.beforeafter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 80px;
}

.beforeafter-card {
  background: oklch(18% 0.035 58 / 0.5);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 12px 40px oklch(0% 0 0 / 0.3);
}

.beforeafter-card:nth-child(1) {
  animation: fadeUp 0.6s ease 0.4s both;
}

.beforeafter-card:nth-child(2) {
  animation: fadeUp 0.6s ease 0.5s both;
}

.beforeafter-card:nth-child(3) {
  animation: fadeUp 0.6s ease 0.6s both;
}

.beforeafter-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 60px oklch(0% 0 0 / 0.5);
}

/* IMAGE WRAPPER */
.beforeafter-image-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.beforeafter-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.beforeafter-card:hover .beforeafter-image {
  transform: scale(1.08);
}

.beforeafter-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 50%,
    oklch(10% 0.02 48 / 0.6) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.beforeafter-badge-floating {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  padding: 10px 20px;
  border-radius: 50px;
  backdrop-filter: blur(20px);
  background: oklch(98% 0.015 80 / 0.95);
  font-family: 'Lato';
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  box-shadow: 0 4px 12px oklch(0% 0 0 / 0.3);
  animation: pulse-ring 2.5s ease-in-out infinite;
}

/* CONTENT */
.beforeafter-content {
  padding: 28px 24px;
  text-align: center;
}

.beforeafter-name {
  font-family: 'Playfair Display';
  font-weight: 600;
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.beforeafter-description {
  font-family: 'Lato';
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: oklch(82% 0.02 78);
}

/* VIDEO SECTION */
.beforeafter-video-wrapper {
  margin-top: 60px;
  animation: fadeUp 0.6s ease 0.7s both;
}

.beforeafter-video-title {
  font-family: 'Playfair Display';
  font-weight: 600;
  font-size: 32px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.beforeafter-video-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px oklch(0% 0 0 / 0.5);
  background: oklch(10% 0.02 48);
}

.beforeafter-video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .beforeafter-section {
    padding: 80px 32px;
  }

  .beforeafter-header {
    margin-bottom: 60px;
  }

  .beforeafter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 60px;
  }

  .beforeafter-card:nth-child(3) {
    grid-column: span 2;
    max-width: 50%;
    margin: 0 auto;
  }

  .beforeafter-image-wrapper {
    height: 350px;
  }

  .beforeafter-title {
    font-size: clamp(38px, 5vw, 48px);
  }

  .beforeafter-subtitle {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .beforeafter-section {
    padding: 70px 24px;
  }

  .beforeafter-header {
    margin-bottom: 50px;
  }

  .beforeafter-title {
    font-size: clamp(32px, 8vw, 42px);
    margin-bottom: 20px;
  }

  .beforeafter-subtitle {
    font-size: 17px;
  }

  .beforeafter-badge {
    font-size: 12px;
    padding: 10px 24px;
    margin-bottom: 24px;
  }

  .beforeafter-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 50px;
  }

  .beforeafter-card:nth-child(3) {
    grid-column: span 1;
    max-width: 100%;
  }

  .beforeafter-image-wrapper {
    height: 450px;
  }

  .beforeafter-content {
    padding: 24px 20px;
  }

  .beforeafter-name {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .beforeafter-description {
    font-size: 15px;
  }

  .beforeafter-badge-floating {
    font-size: 11px;
    padding: 8px 16px;
    top: 16px;
    left: 16px;
  }

  .beforeafter-video-wrapper {
    margin-top: 50px;
  }

  .beforeafter-video-title {
    font-size: 28px;
    margin-bottom: 24px;
  }

  .beforeafter-video-container {
    border-radius: 16px;
  }
}

/* ========== IMAGE LIGHTBOX MODAL ========== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: oklch(0% 0 0 / 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: lightboxFadeIn 0.3s ease both;
}

.lightbox-overlay.active {
  display: flex;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightboxZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lightboxZoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px oklch(0% 0 0 / 0.8);
  object-fit: contain;
  transition: opacity 0.15s ease;
}

.lightbox-caption {
  margin-top: 24px;
  font-family: 'Lato';
  font-size: 18px;
  font-weight: 400;
  color: oklch(92% 0.02 78);
  text-align: center;
  padding: 0 20px;
}

/* LIGHTBOX CONTROLS */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: oklch(98% 0.015 80 / 0.15);
  backdrop-filter: blur(20px);
  border: 2px solid oklch(72% 0.11 75 / 0.5);
  color: white;
  font-size: 24px;
  font-weight: 300;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.lightbox-close {
  top: 20px;
  right: 20px;
  font-size: 32px;
  line-height: 1;
}

.lightbox-prev {
  left: 20px;
  bottom: 40px;
  top: auto;
}

.lightbox-next {
  right: 20px;
  bottom: 40px;
  top: auto;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 8px 24px oklch(72% 0.11 75 / 0.5);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* CLICKABLE CURSOR */
.beforeafter-image-wrapper {
  cursor: pointer;
  position: relative;
}

.beforeafter-image-wrapper::after {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 4px 12px oklch(0% 0 0 / 0.5);
}

.beforeafter-image-wrapper:hover::after {
  opacity: 1;
}

/* RESPONSIVE LIGHTBOX */
@media (max-width: 768px) {
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    font-size: 32px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 28px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
  }

  .lightbox-caption {
    font-size: 16px;
    margin-top: 16px;
  }

  .beforeafter-image-wrapper::after {
    font-size: 36px;
  }
}
