/**
 * Homepage use-cases scroll section demo styles.
 *
 * Distinct from hero browser mockup — card-based preview stage.
 *
 * @package Notifal
 * @since   1.3.0
 */

/* Preview card shell */
.uc-demo-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.uc-demo-card__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(123, 44, 191, 0.08);
  border: 1px solid rgba(123, 44, 191, 0.14);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--clr-primary);
}

.uc-demo-card__trigger-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: uc-demo-live-pulse 2s ease infinite;
  flex-shrink: 0;
}

@keyframes uc-demo-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.uc-demo-card__trigger-detail {
  color: var(--clr-text-muted);
  font-weight: 500;
}

.uc-demo-card__stage {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(145deg, #f8f4fc 0%, #efe4f8 48%, #e8d9f5 100%);
  border: 1px solid rgba(123, 44, 191, 0.12);
  box-shadow: 0 20px 50px rgba(26, 5, 51, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
  min-height: 320px;
  aspect-ratio: 4 / 3;
}

.uc-demo-card__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(157, 78, 221, 0.22) 0%, transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(123, 44, 191, 0.16) 0%, transparent 45%);
  pointer-events: none;
}

/* Simplified page canvas behind widgets */
.uc-demo-canvas {
  position: absolute;
  inset: 18px 18px 18px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(26, 5, 51, 0.06);
  overflow: hidden;
}

.uc-demo-canvas__bar {
  height: 28px;
  background: linear-gradient(90deg, #f3edf8, #faf7fc);
  border-bottom: 1px solid #ece4f2;
}

.uc-demo-canvas__body {
  padding: 14px;
}

.uc-demo-skeleton {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: #ece4f2;
  margin-bottom: 8px;
}

.uc-demo-skeleton--short { width: 55%; }
.uc-demo-skeleton--medium { width: 78%; }
.uc-demo-skeleton--hero {
  height: 72px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #e8d9f5, #f3edf8);
}

/* Built-in widget layer */
.uc-demo-built {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.uc-demo-widget-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
}

.uc-demo-widget-layer--bottom {
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 16px 16px;
}

.uc-demo-widget-layer--top {
  align-items: flex-start;
  justify-content: center;
  padding: 12px 16px 0;
}

/* Marketplace template preview — same layout shell as archive cards */
.uc-demo-marketplace {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
}

.uc-demo-marketplace[hidden] {
  display: none !important;
}

.uc-demo-card.is-marketplace .uc-demo-built {
  visibility: hidden;
  pointer-events: none;
}

.uc-demo-card__stage .featured-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  margin: 0;
}

.uc-demo-card__stage .notifal-layout-holder,
.uc-demo-card__stage .notifal-layout-site {
  height: 100%;
  min-height: 100%;
}

.uc-demo-card__stage .notifal-layout-feature img {
  display: block;
}

/* Email capture popup */
.uc-demo-email {
  width: 100%;
  max-width: 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(26, 5, 51, 0.16);
  overflow: hidden;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.uc-panel.is-active .uc-demo-email {
  transform: scale(1);
  opacity: 1;
}

.uc-demo-email__head {
  padding: 14px 16px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
}

.uc-demo-email__body {
  padding: 16px;
}

.uc-demo-email__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 10px;
  font-family: inherit;
}

.uc-demo-email__btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: inherit;
}

.uc-demo-email__fine {
  margin-top: 8px;
  font-size: 0.65rem;
  color: var(--clr-text-muted);
  text-align: center;
}

/* Flash sale */
.uc-demo-flash-wrap {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uc-demo-flash-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--grad-brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  transform: translateY(-12px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.uc-panel.is-active .uc-demo-flash-bar {
  transform: translateY(0);
  opacity: 1;
}

.uc-demo-flash-countdown {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.uc-demo-coupon {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(26, 5, 51, 0.12);
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.12s, opacity 0.5s ease 0.12s;
}

.uc-panel.is-active .uc-demo-coupon {
  transform: translateY(0);
  opacity: 1;
}

.uc-demo-coupon__label {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--clr-text-primary);
}

.uc-demo-coupon__code {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--clr-primary-dark);
  background: var(--clr-bg-subtle);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.uc-demo-coupon__btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  font-family: inherit;
}

/* Exit intent */
.uc-demo-exit {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uc-demo-exit__dim {
  position: absolute;
  inset: 0;
  background: rgba(26, 5, 51, 0.35);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.uc-panel.is-active .uc-demo-exit__dim {
  opacity: 1;
}

.uc-demo-exit__cursor {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 20px;
  height: 20px;
  z-index: 4;
  transition: top 1.2s cubic-bezier(0.4, 0, 0.2, 1), left 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.uc-panel.is-active .uc-demo-exit__cursor {
  top: 4px;
  left: 78%;
}

.uc-demo-exit__modal {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 240px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 20px 44px rgba(26, 5, 51, 0.2);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.25s, opacity 0.45s ease 0.25s;
}

.uc-panel.is-active .uc-demo-exit__modal {
  transform: scale(1);
  opacity: 1;
}

.uc-demo-exit__title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.uc-demo-exit__product {
  font-size: 0.72rem;
  color: var(--clr-text-secondary);
  margin-bottom: 8px;
}

.uc-demo-exit__price {
  font-weight: 700;
  color: var(--clr-primary);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.uc-demo-exit__actions {
  display: flex;
  gap: 8px;
}

.uc-demo-exit__btn-primary,
.uc-demo-exit__btn-ghost {
  flex: 1;
  padding: 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.uc-demo-exit__btn-primary {
  background: var(--grad-brand);
  color: #fff;
}

.uc-demo-exit__btn-ghost {
  border: 1px solid var(--clr-border-strong);
  color: var(--clr-text-secondary);
}

/* Social proof toasts */
.uc-demo-toasts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 300px;
}

.uc-demo-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(26, 5, 51, 0.1);
  font-size: 0.72rem;
  transform: translateX(-20px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.uc-panel.is-active .uc-demo-toast:nth-child(1) {
  transform: translateX(0);
  opacity: 1;
  transition-delay: 0.1s;
}

.uc-panel.is-active .uc-demo-toast:nth-child(2) {
  transform: translateX(16px);
  opacity: 1;
  transition-delay: 0.22s;
}

.uc-panel.is-active .uc-demo-toast:nth-child(3) {
  transform: translateX(32px);
  opacity: 1;
  transition-delay: 0.34s;
}

.uc-demo-toast__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.uc-demo-toast__text {
  font-weight: 500;
  color: var(--clr-text-primary);
  line-height: 1.4;
}

.uc-demo-toast__time {
  font-size: 0.62rem;
  color: var(--clr-text-muted);
  margin-top: 2px;
}

.uc-demo-toast__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: auto;
  flex-shrink: 0;
  animation: uc-demo-live-pulse 2s ease infinite;
}

/* Idle return */
.uc-demo-idle {
  width: 100%;
  max-width: 270px;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(26, 5, 51, 0.14);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.uc-panel.is-active .uc-demo-idle {
  transform: translateY(0);
  opacity: 1;
}

.uc-demo-idle__emoji {
  font-size: 1.8rem;
  margin-bottom: 6px;
  animation: uc-demo-idle-bob 2.4s ease-in-out infinite;
}

@keyframes uc-demo-idle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.uc-demo-idle__title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.uc-demo-idle__sub {
  font-size: 0.75rem;
  color: var(--clr-text-secondary);
  margin-bottom: 12px;
}

.uc-demo-idle__card {
  background: var(--clr-bg-subtle);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  margin-bottom: 12px;
}

.uc-demo-idle__tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-primary);
  margin-bottom: 4px;
}

.uc-demo-idle__article {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.uc-demo-idle__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
}

/* Grow AOV */
.uc-demo-aov {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uc-demo-shipping {
  background: var(--clr-primary);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.74rem;
  font-weight: 600;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.uc-panel.is-active .uc-demo-shipping {
  transform: translateY(0);
  opacity: 1;
}

.uc-demo-shipping__track {
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.uc-demo-shipping__fill {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.uc-panel.is-active .uc-demo-shipping__fill {
  width: 73%;
}

.uc-demo-crosssell {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 26px rgba(26, 5, 51, 0.1);
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.5s ease 0.15s, opacity 0.5s ease 0.15s;
}

.uc-panel.is-active .uc-demo-crosssell {
  transform: translateY(0);
  opacity: 1;
}

.uc-demo-crosssell__title {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.uc-demo-crosssell__grid {
  display: flex;
  gap: 8px;
}

.uc-demo-crosssell__item {
  flex: 1;
  background: var(--clr-bg-subtle);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.uc-demo-crosssell__thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-primary));
}

.uc-demo-crosssell__thumb--alt {
  background: linear-gradient(135deg, var(--clr-primary-mid), var(--clr-primary-light));
}

.uc-demo-crosssell__name {
  font-size: 0.62rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.uc-demo-crosssell__price {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: 5px;
}

.uc-demo-crosssell__add {
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad-brand);
  border-radius: 4px;
  padding: 3px 6px;
}

/* Shared tag chip in demos */
.uc-demo-tag {
  display: inline-block;
  background: rgba(123, 44, 191, 0.15);
  color: var(--clr-primary);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

@media (min-width: 1024px) {
  .uc-panel .uc-demo-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(440px, 100%);
    max-height: calc(var(--uc-sticky-height, calc(100vh - 68px)) - 150px);
    min-height: 0;
  }

  .uc-panel .uc-demo-card__trigger {
    flex-shrink: 0;
    margin-bottom: 10px;
  }

  .uc-panel .uc-demo-card__stage {
    flex: 1 1 auto;
    min-height: 240px;
    max-height: 100%;
    width: 100%;
    aspect-ratio: unset;
    height: auto;
  }

  .uc-panel .uc-demo-card.is-marketplace .uc-demo-card__stage {
    display: flex;
    flex-direction: column;
    min-height: 260px;
  }

  .uc-panel .uc-demo-marketplace {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 12px;
  }

  .uc-panel .uc-demo-card__stage .featured-image {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    aspect-ratio: unset;
  }

  .uc-panel .uc-demo-card__stage .notifal-layout-holder,
  .uc-panel .uc-demo-card__stage .notifal-layout-site {
    min-height: 0;
  }
}

@media (max-width: 1023px) {
  .uc-demo-card__stage {
    min-height: 280px;
    aspect-ratio: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uc-demo-card__trigger-dot,
  .uc-demo-toast__pulse,
  .uc-demo-idle__emoji {
    animation: none;
  }

  .uc-demo-email,
  .uc-demo-flash-bar,
  .uc-demo-coupon,
  .uc-demo-exit__dim,
  .uc-demo-exit__modal,
  .uc-demo-exit__cursor,
  .uc-demo-toast,
  .uc-demo-idle,
  .uc-demo-shipping,
  .uc-demo-crosssell,
  .uc-demo-shipping__fill {
    transform: none;
    opacity: 1;
    transition: none;
    width: 73%;
  }
}
