/* ── Phase 1: Interaction Upgrades ── */

/* ═══════════════════════════════════════
   1. SCROLL-DRIVEN CARD REVEALS
   ═══════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children inside grids */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 320ms }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms }

/* Slide from left/right variants */
.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up variant */
.reveal-scale {
  opacity: 0;
  transform: scale(.92);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}


/* ═══════════════════════════════════════
   2. MAGNETIC BUTTONS
   ═══════════════════════════════════════ */
.btn-magnetic {
  position: relative;
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.btn-magnetic:active {
  transform: scale(.97) !important;
}


/* ═══════════════════════════════════════
   3. 3D CARD TILT
   ═══════════════════════════════════════ */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform .3s cubic-bezier(.22,1,.36,1),
              box-shadow .3s ease;
  will-change: transform;
}
.tilt-card:hover {
  box-shadow: var(--shadow-lg), 0 0 40px rgba(224,87,128,.08);
}
/* Inner content lifts on hover */
.tilt-card .tilt-inner {
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.tilt-card:hover .tilt-inner {
  transform: translateZ(20px);
}


/* ═══════════════════════════════════════
   4. PAGE TRANSITIONS (View Transitions API fallback)
   ═══════════════════════════════════════ */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animate main content on page load */
.page-content,
.main-content {
  animation: fadeSlideIn .45s cubic-bezier(.22,1,.36,1) both;
}

/* View Transitions API styles (progressive enhancement) */
::view-transition-old(root) {
  animation: fadeSlideOut .25s cubic-bezier(.22,1,.36,1) both;
}
::view-transition-new(root) {
  animation: fadeSlideIn .4s cubic-bezier(.22,1,.36,1) both;
}
@keyframes fadeSlideOut {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(.99);
  }
}


/* ═══════════════════════════════════════
   5. CELEBRATION OVERLAY
   ═══════════════════════════════════════ */
.celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}


/* ═══════════════════════════════════════
   6. CHIP & CHOICE CARD MICRO-INTERACTIONS
   ═══════════════════════════════════════ */
.chip {
  transition: all .2s cubic-bezier(.22,1,.36,1);
}
.chip:active {
  transform: scale(.94);
}

.date-type-card {
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.date-type-card:hover {
  transform: translateY(-3px);
}
.date-type-card:active {
  transform: scale(.97);
}
.date-type-card.active {
  transform: translateY(-2px);
}

.choice-card {
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.choice-card:hover {
  transform: translateY(-2px);
}
.choice-card:active {
  transform: scale(.97);
}


/* ═══════════════════════════════════════
   7. BUTTON HOVER LIFT
   ═══════════════════════════════════════ */
.btn-primary {
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(224,87,128,.35);
}
.btn-primary:active {
  transform: translateY(0) scale(.98);
}

.btn-ghost {
  transition: all .2s cubic-bezier(.22,1,.36,1);
}
.btn-ghost:hover {
  transform: translateY(-1px);
}
.btn-ghost:active {
  transform: translateY(0) scale(.98);
}


/* ═══════════════════════════════════════
   8. NAV ITEM HOVER
   ═══════════════════════════════════════ */
.nav-item {
  transition: all .2s cubic-bezier(.22,1,.36,1);
}
.nav-item:hover:not(.active) {
  transform: translateX(3px);
}


/* ═══════════════════════════════════════
   9. STAT CARD HOVER
   ═══════════════════════════════════════ */
.stat-card {
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}


/* ═══════════════════════════════════════
   10. SUCCESS PAGE ANIMATION
   ═══════════════════════════════════════ */
@keyframes successPop {
  0% { transform: scale(0); opacity: 0 }
  50% { transform: scale(1.15) }
  100% { transform: scale(1); opacity: 1 }
}
@keyframes successFadeUp {
  from { opacity: 0; transform: translateY(20px) }
  to { opacity: 1; transform: translateY(0) }
}

.success-icon-animated {
  animation: successPop .5s cubic-bezier(.22,1,.36,1) both;
}
.success-text-animated {
  animation: successFadeUp .5s cubic-bezier(.22,1,.36,1) .2s both;
}
.success-actions-animated {
  animation: successFadeUp .5s cubic-bezier(.22,1,.36,1) .4s both;
}


/* ═══════════════════════════════════════
   11. TOAST ENTRANCE
   ═══════════════════════════════════════ */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
.toast {
  animation: toastSlideIn .35s cubic-bezier(.22,1,.36,1) both;
}


/* ═══════════════════════════════════════
   12. FORM INPUT FOCUS GLOW
   ═══════════════════════════════════════ */
.form-input:focus {
  box-shadow: 0 0 0 3px rgba(224,87,128,.15), 0 2px 8px rgba(0,0,0,.2);
}


/* ═══════════════════════════════════════
   13. SKELETON LOADING SHIMMER
   ═══════════════════════════════════════ */
@keyframes shimmer {
  0% { background-position: -400px 0 }
  100% { background-position: 400px 0 }
}
.skeleton {
  position: relative;
  overflow: hidden;
}
.skel-bone {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    rgba(255,255,255,.04) 40%,
    rgba(255,255,255,.04) 60%,
    var(--bg-elevated) 100%
  );
  background-size: 800px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}
.skel-thumb { height: 140px }
.skel-title { height: 18px; width: 70%; margin-bottom: 10px }
.skel-meta { height: 12px; width: 50% }
.skel-body { padding: 18px }
.skel-stat-icon { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 8px }
.skel-stat-value { height: 24px; width: 50%; margin-bottom: 4px }
.skel-stat-label { height: 10px; width: 70% }


/* ═══════════════════════════════════════
   14. FORM PAGE SLIDE TRANSITIONS
   ═══════════════════════════════════════ */
.form-page {
  display: none;
  opacity: 0;
}
.form-page.active {
  display: block;
  animation: formPageIn .35s cubic-bezier(.22,1,.36,1) both;
}
.form-page.slide-out-left {
  display: block;
  animation: formPageOutLeft .25s ease-in both;
}
.form-page.slide-out-right {
  display: block;
  animation: formPageOutRight .25s ease-in both;
}
@keyframes formPageIn {
  from { opacity: 0; transform: translateX(30px) }
  to { opacity: 1; transform: translateX(0) }
}
@keyframes formPageInReverse {
  from { opacity: 0; transform: translateX(-30px) }
  to { opacity: 1; transform: translateX(0) }
}
@keyframes formPageOutLeft {
  from { opacity: 1; transform: translateX(0) }
  to { opacity: 0; transform: translateX(-30px) }
}
@keyframes formPageOutRight {
  from { opacity: 1; transform: translateX(0) }
  to { opacity: 0; transform: translateX(30px) }
}
.form-page.active.from-left {
  animation-name: formPageInReverse;
}


/* ═══════════════════════════════════════
   17. HERO TYPING CURSOR
   ═══════════════════════════════════════ */
@keyframes blink {
  0%, 50% { opacity: 1 }
  51%, 100% { opacity: 0 }
}
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--rose);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}


/* ═══════════════════════════════════════
   18. PARALLAX HERO LAYERS
   ═══════════════════════════════════════ */
.parallax-layer {
  transition: transform .1s linear;
  will-change: transform;
}


/* ═══════════════════════════════════════
   PHASE 3: MICRO-INTERACTIONS
   ═══════════════════════════════════════ */

/* 19. RIPPLE EFFECT ON BUTTONS */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  transform: scale(0);
  animation: rippleExpand .5s ease-out;
  pointer-events: none;
}
@keyframes rippleExpand {
  to { transform: scale(4); opacity: 0 }
}

/* 20. ANIMATED PROGRESS BAR */
.form-progress-fill {
  position: relative;
  overflow: hidden;
}
.form-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.25) 50%,
    transparent 100%
  );
  animation: progressShine 2s ease-in-out infinite;
}
@keyframes progressShine {
  0% { transform: translateX(-100%) }
  100% { transform: translateX(100%) }
}

/* 21. ANIMATED CHECK ON SELECTION */
@keyframes checkPop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0 }
  50% { transform: scale(1.2) rotate(0); opacity: 1 }
  100% { transform: scale(1) rotate(0); opacity: 1 }
}
.date-type-card.active::after,
.chip.active::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: .65rem;
  color: var(--rose);
  font-weight: 700;
  animation: checkPop .3s cubic-bezier(.22,1,.36,1) both;
}

/* 22. INPUT FOCUS UNDERLINE ANIMATION */
.form-input-wrap {
  position: relative;
}
.form-input-wrap .focus-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--grad-warm);
  transition: width .3s cubic-bezier(.22,1,.36,1), left .3s cubic-bezier(.22,1,.36,1);
  border-radius: 2px;
}
.form-input-wrap .form-input:focus ~ .focus-line {
  width: 100%;
  left: 0;
}

/* 23. PULSE ON ACTIVE NAV */
@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,87,128,.2) }
  50% { box-shadow: 0 0 0 4px rgba(224,87,128,0) }
}
.nav-item.active {
  animation: navPulse 2s ease-in-out;
}


/* ═══════════════════════════════════════
   PHASE 4: EMOTIONAL DESIGN
   ═══════════════════════════════════════ */

/* 24. CUSTOM SCROLLBAR (rose-tinted) */
::-webkit-scrollbar { width: 6px }
::-webkit-scrollbar-track { background: rgba(255,255,255,.02) }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(224,87,128,.2), rgba(224,87,128,.08));
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(224,87,128,.35), rgba(224,87,128,.15));
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(224,87,128,.15) transparent;
}

/* 25. HEART LOADING SPINNER */
@keyframes heartBeat {
  0%, 100% { transform: scale(1) }
  25% { transform: scale(1.15) }
  40% { transform: scale(1) }
  60% { transform: scale(1.1) }
}
.loading-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: heartBeat 1.2s ease-in-out infinite;
  color: var(--rose);
  font-size: 1.5rem;
}

/* 26. AMBIENT GRADIENT SHIFT ON BODY */
@keyframes ambientShift {
  0% {
    background-position: 0% 0%;
  }
  25% {
    background-position: 100% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse 800px 600px at var(--ambient-x, 50%) var(--ambient-y, 30%),
    rgba(224,87,128,.02) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  transition: background .5s ease;
}

/* 27. EMPTY STATE WITH FLOATING ANIMATION */
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-8px) }
}
.empty-state .empty-icon {
  animation: emptyFloat 3s ease-in-out infinite;
}

/* 28. TOOLTIP WITH PERSONALITY */
.tooltip-wrap {
  position: relative;
}
.tooltip-wrap::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: .75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
.tooltip-wrap:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ═══════════════════════════════════════
   PHASE 5: ADVANCED UX
   ═══════════════════════════════════════ */

/* 29. SCROLL-TO-TOP BUTTON */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s, background .2s;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top-btn:hover {
  background: rgba(224,87,128,.08);
  border-color: rgba(224,87,128,.2);
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 38px;
    height: 38px;
  }
}

/* 30. ANIMATED LANDING PAGE COUNTERS */
@keyframes countGlow {
  0%, 100% { text-shadow: 0 0 0 transparent }
  50% { text-shadow: 0 0 20px rgba(224,87,128,.3) }
}
.proof-stat .num.counted {
  animation: countGlow 1s ease-out;
}

/* 31. SMOOTH SCROLL INDICATOR */
.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  opacity: .4;
  transition: opacity .3s;
  z-index: 3;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0) }
  50% { transform: translateX(-50%) translateY(6px) }
}
.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}
.scroll-indicator svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-muted);
}


/* ═══════════════════════════════════════
   PHASE 6: FINAL POLISH
   ═══════════════════════════════════════ */

/* 32. LOADING QUOTES CONTAINER */
.loading-quote {
  text-align: center;
  padding: 48px 24px;
}
.loading-quote .quote-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 400px;
  margin: 0 auto 16px;
  line-height: 1.7;
  animation: fadeIn .5s ease both;
}
.loading-quote .loading-heart {
  margin-bottom: 12px;
}

/* 33. GLASSMORPHISM MODAL UPGRADE */
.modal {
  backdrop-filter: blur(20px);
  background: rgba(24,18,31,.85);
}

/* 34. INTERACTIVE BADGE PULSE */
.badge-progress::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-progress);
  animation: pulse-badge 2s ease-in-out infinite;
  margin-right: 2px;
}

/* 35. SELECTION HIGHLIGHT */
::selection {
  background: rgba(224,87,128,.3);
  color: #fff;
}

/* 36. FOCUS VISIBLE OUTLINES (accessibility) */
:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}
button:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════
   MOBILE: reduce motion for performance
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .tilt-card { transform: none !important }
  .page-content, .main-content { animation: none }
  .celebration-canvas { display: none }
  .form-page.active { animation: none; opacity: 1 }
  .skel-bone { animation: none }
  .empty-state .empty-icon { animation: none }
  .loading-heart { animation: none }
  .scroll-indicator { animation: none }
}

/* Disable heavy effects on mobile (touch devices) */
@media (hover: none) {
  .tooltip-wrap::after { display: none }
}
