/* ===========================================
   My Dream Companion - Visual Effects
   Floating glow blobs, Hearts, Spotlight, Tilt, Magnetic, Reveal
   =========================================== */

/* ============================================
   1. FLOATING GLOW BLOBS BACKGROUND
   ============================================ */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  will-change: transform;
}

.aurora-blob-1 {
  width: 540px;
  height: 540px;
  top: -8%;
  left: -8%;
  background: radial-gradient(circle, #FF3D5A 0%, rgba(255, 61, 90, 0) 70%);
  animation: aurora-float-1 22s ease-in-out infinite;
}

.aurora-blob-2 {
  width: 620px;
  height: 620px;
  top: 28%;
  right: -10%;
  background: radial-gradient(circle, #FF8A3D 0%, rgba(255, 138, 61, 0) 70%);
  animation: aurora-float-2 28s ease-in-out infinite;
  opacity: 0.32;
}

.aurora-blob-3 {
  width: 480px;
  height: 480px;
  bottom: -10%;
  left: 25%;
  background: radial-gradient(circle, #FF6B7E 0%, rgba(255, 107, 126, 0) 70%);
  animation: aurora-float-3 25s ease-in-out infinite;
  opacity: 0.3;
}

.aurora-blob-4 {
  width: 380px;
  height: 380px;
  top: 60%;
  left: -5%;
  background: radial-gradient(circle, #FFB36B 0%, rgba(255, 179, 107, 0) 70%);
  animation: aurora-float-4 30s ease-in-out infinite;
  opacity: 0.28;
}

@keyframes aurora-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 80px) scale(1.1); }
  66% { transform: translate(-40px, 40px) scale(0.95); }
}

@keyframes aurora-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, -60px) scale(1.15); }
}

@keyframes aurora-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(70px, -90px) scale(1.05); }
  80% { transform: translate(-50px, -30px) scale(0.9); }
}

@keyframes aurora-float-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(120px, -40px) scale(1.2); }
}

/* Decorative floating hearts */
.drops {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.drop {
  position: absolute;
  width: 28px;
  height: 28px;
  opacity: 0.5;
  will-change: transform;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 40%),
    var(--gradient-primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.5-10-9C.5 9 2 5 5.5 5 8 5 12 8 12 8s4-3 6.5-3C22 5 23.5 9 22 12c-2 3.5-10 9-10 9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.5-10-9C.5 9 2 5 5.5 5 8 5 12 8 12 8s4-3 6.5-3C22 5 23.5 9 22 12c-2 3.5-10 9-10 9z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 4px 12px rgba(255, 61, 90, 0.4));
}

.drop-1 { width: 32px; height: 32px; top: 12%; left: 8%; animation: drop-float 14s ease-in-out infinite; }
.drop-2 { width: 20px; height: 20px; top: 22%; right: 12%; animation: drop-float 16s ease-in-out infinite reverse; animation-delay: -3s; }
.drop-3 { width: 40px; height: 40px; top: 65%; left: 15%; animation: drop-float 18s ease-in-out infinite; animation-delay: -6s; }
.drop-4 { width: 24px; height: 24px; bottom: 20%; right: 8%; animation: drop-float 12s ease-in-out infinite reverse; animation-delay: -2s; }
.drop-5 { width: 16px; height: 16px; top: 45%; right: 25%; animation: drop-float 11s ease-in-out infinite; animation-delay: -4s; opacity: 0.4; }

@keyframes drop-float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(0, -24px) rotate(8deg); }
}

/* Grid overlay (subtle) */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 61, 90, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 61, 90, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
}

/* ============================================
   2. SPOTLIGHT CARDS
   ============================================ */
.spotlight {
  position: relative;
  isolation: isolate;
}

.spotlight::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 61, 90, 0.7),
    transparent 40%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 1;
}

.spotlight:hover::before { opacity: 1; }

.spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 61, 90, 0.1),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 0;
}

.spotlight:hover::after { opacity: 1; }

.spotlight > * { position: relative; z-index: 2; }

/* ============================================
   3. 3D TILT
   ============================================ */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease-out);
  will-change: transform;
}

.tilt-inner { transform: translateZ(20px); }

/* ============================================
   4. MAGNETIC BUTTONS
   ============================================ */
.magnetic {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
  will-change: transform;
}

/* ============================================
   5. REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    filter 0.9s var(--ease-out);
  will-change: opacity, transform, filter;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out),
    filter 0.7s var(--ease-out);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.55s; }

.reveal-mask {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease-out);
  will-change: clip-path;
}

.reveal-mask.is-visible { clip-path: inset(0 0 0 0); }

/* ============================================
   6. CURSOR HALO
   ============================================ */
.cursor-halo {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 61, 90, 0.16) 0%, rgba(255, 61, 90, 0) 60%);
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  mix-blend-mode: screen;
  filter: blur(10px);
}

.cursor-halo.active { opacity: 1; }

@media (hover: none) {
  .cursor-halo { display: none; }
}

/* ============================================
   7. PULSE GLOW
   ============================================ */
.pulse-glow {
  animation: pulse-glow-anim 3s ease-in-out infinite;
}

@keyframes pulse-glow-anim {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 61, 90, 0.4); }
  50% { box-shadow: 0 4px 36px rgba(255, 61, 90, 0.7); }
}

/* ============================================
   8. SHIMMER LINE
   ============================================ */
.shimmer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  position: relative;
  overflow: hidden;
}

.shimmer-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   9. RATING STARS
   ============================================ */
.rating-stars {
  display: inline-flex;
  gap: 4px;
  color: #FFB547;
  font-size: 1rem;
}

.rating-stars i { filter: drop-shadow(0 1px 2px rgba(255, 181, 71, 0.4)); }

/* ============================================
   10. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-stagger > *, .reveal-mask {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
  .aurora-blob, .drop { animation: none !important; }
  .cursor-halo { display: none; }
}
