/* ============================================================
   CAROUSEL COMPONENT
   Reusable slide component with text + visual layout.
============================================================ */

.carousel {
  width: 100%;
}

/* ——— Panel ——— */

.carousel__panel {
  position: relative;
  width: 100%;
  height: var(--carousel-height, auto);
  border-radius: 20px;
  background: linear-gradient(rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px;
}

/* ——— Slides ——— */

.carousel__slide {
  display: none;
  align-items: stretch;
  padding: 0 0 0 64px;
  gap: 48px;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
}

.carousel__slide.is-active {
  display: flex;
}

/* ——— Text transition animations ——— */

/* Outgoing text — direction set via data-dir on the carousel */
.carousel__text.is-leaving {
  animation: text-leave-left 280ms var(--ease-out) forwards;
}

.carousel[data-dir="prev"] .carousel__text.is-leaving {
  animation-name: text-leave-right;
}

/* Incoming text */
.carousel__slide.is-entering .carousel__text {
  animation: text-enter-right 500ms var(--ease-out) forwards;
}

.carousel[data-dir="prev"] .carousel__slide.is-entering .carousel__text {
  animation-name: text-enter-left;
}

@keyframes text-leave-left {
  from { opacity: 1; transform: translateX(0);     }
  to   { opacity: 0; transform: translateX(-22px); }
}

@keyframes text-leave-right {
  from { opacity: 1; transform: translateX(0);    }
  to   { opacity: 0; transform: translateX(22px); }
}

@keyframes text-enter-right {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0);    }
}

@keyframes text-enter-left {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* ——— Slide text column ——— */

.carousel__text {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 72px 0;
}

.carousel__slide-title {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: #0c0c0c;
}

.carousel__slide-desc {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #1a1a1a;
  opacity: 0.85;
}

.carousel__slide-list {
  margin: 10px 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.carousel__slide-list li {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: #1a1a1a;
  opacity: 0.85;
  padding-left: 16px;
  position: relative;
}

.carousel__slide-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  opacity: 0.45;
}

/* ——— Slide visual column ——— */

.carousel__visual {
  flex: 1 1 auto;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.carousel__visual img:not(.um3-popover):not(.dar-popover-img):not(.qats-drawer) {
  /*width: 100%;
  height: 100%;*/
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Variant: no background/border, image still fills full area */
.carousel__visual--centered {
  background: none;
}

/* Demo slides: center the fixed-size canvas within the visual area */
.carousel__visual--demo {
  align-items: center;
  justify-content: center;
}

.carousel__visual-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

/* ——— Before/After reveal ——— */

.carousel__reveal-frame {
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07);
  width: 100%;
  line-height: 0;
}

.carousel__reveal-frame .carousel__visual-img {
  border-radius: 0;
  box-shadow: none;
}

.carousel__reveal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
  transform: translateX(101%);
  z-index: 1;
}

.carousel__slide.is-active .carousel__reveal-img {
  animation: reveal-slide-in 520ms 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes reveal-slide-in {
  from { transform: translateX(101%); }
  to   { transform: translateX(0); }
}

/* ——— Usermind Slide 3 — cursor & popover scene ——— */

.um3-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.um3-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  will-change: transform, opacity;
}

.um3-popover {
  position: absolute;
  top: 158px;
  left: 168px;
  width: 388px;
  height: auto;
  opacity: 0;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
  will-change: opacity, transform;
}

.carousel__slide.is-active .um3-cursor {
  animation: um3-cursor 3000ms 1200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.carousel__slide.is-active .um3-popover {
  animation: um3-popover 2200ms 2800ms ease-out both;
}

@keyframes um3-cursor {
  0%   { opacity: 0; transform: translate(418px, 180px); }
  8%   { opacity: 1; transform: translate(418px, 180px); }
  44%  { opacity: 1; transform: translate(362px, 115px); }
  52%  { opacity: 1; transform: translate(362px, 115px) scale(0.82); }
  60%  { opacity: 1; transform: translate(362px, 115px) scale(1); }
  88%  { opacity: 1; transform: translate(362px, 115px); }
  100% { opacity: 0; transform: translate(362px, 115px); }
}

@keyframes um3-popover {
  0%   { opacity: 0; transform: translateY(8px); }
  12%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Placeholder shown when no image is present */
.carousel__visual-placeholder {
  width: 100%;
  min-height: 360px;
  background: linear-gradient(135deg, #eef1f8 0%, #e4e8f3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.2);
}

/* ——— Controls (dots + arrows) ——— */

.carousel__controls {
  position: absolute;
  left: 206px;
  bottom: 36px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 2;
  pointer-events: none;
}

.carousel__controls > * {
  pointer-events: auto;
}

.carousel__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.carousel__dot.is-active {
  background: #1a1d3a;
  transform: scale(1.15);
}

.carousel__dot:hover:not(.is-active) {
  background: rgba(0, 0, 0, 0.35);
}

/* Arrow buttons */
.carousel__btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 180ms var(--ease-out),
              opacity 180ms var(--ease-out);
}

.carousel__btn:hover {
  transform: scale(1.07);
}

.carousel__btn--next {
  background: #3D52FA;
  color: #fff;
}

.carousel__btn--prev {
  background: rgba(255, 255, 255, 0.85);
  color: #1a1d3a;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* visually hidden but still occupies space (keeps layout stable) */
.carousel__btn[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}

/* ——— Dark theme variants ——— */

[data-theme^="dark"] .carousel__panel {
  background: linear-gradient(rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: rgba(0, 0, 0, 0.35) 0px 2px 14px;
}

[data-theme^="dark"] .carousel__slide-title {
  color: #ffffff;
}

[data-theme^="dark"] .carousel__slide-desc {
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

[data-theme^="dark"] .carousel__slide-list li {
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

[data-theme^="dark"] .carousel__visual {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme^="dark"] .carousel__visual--centered {
  background: none;
}

[data-theme^="dark"] .carousel__visual--demo {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme^="dark"] .carousel__reveal-frame {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

[data-theme^="dark"] .carousel__visual-placeholder {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  color: rgba(255, 255, 255, 0.35);
}

[data-theme^="dark"] .carousel__dot {
  background: rgba(255, 255, 255, 0.25);
}

[data-theme^="dark"] .carousel__dot.is-active {
  background: #ffffff;
}

[data-theme^="dark"] .carousel__dot:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.5);
}

[data-theme^="dark"] .carousel__btn--prev {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ——— Responsive ——— */

@media (max-width: 1024px) {
  .carousel__slide {
    padding: 0 0 0 36px;
    gap: 32px;
  }

  .carousel__text {
    flex: 0 0 220px;
    padding: 36px 0;
  }

  .carousel__controls {
    left: 144px;
  }
}

@media (max-width: 640px) {
  .carousel__slide {
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .carousel__text {
    flex: none;
    width: 100%;
    padding: 28px 24px 80px 24px;
  }

  .carousel__visual {
    width: 100%;
    flex: 0 0 240px;
    border-radius: 0 0 20px 20px;
  }

  .carousel__controls {
    left: 24px;
    bottom: 28px;
  }
}
