/* ========== Background Particles ========== */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
  will-change: transform, opacity;
}

.particle:nth-child(1) {
  left: 10%;
  top: 20%;
  background: var(--glow-purple);
  animation-duration: 12s;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  left: 25%;
  top: 60%;
  background: var(--glow-pink);
  animation-duration: 15s;
  animation-delay: 2s;
  width: 2px;
  height: 2px;
}

.particle:nth-child(3) {
  left: 70%;
  top: 30%;
  background: var(--glow-purple);
  animation-duration: 11s;
  animation-delay: 4s;
}

.particle:nth-child(4) {
  left: 85%;
  top: 70%;
  background: var(--glow-pink);
  animation-duration: 14s;
  animation-delay: 1s;
  width: 4px;
  height: 4px;
}

.particle:nth-child(5) {
  left: 50%;
  top: 10%;
  background: var(--accent);
  animation-duration: 16s;
  animation-delay: 3s;
  width: 2px;
  height: 2px;
}

.particle:nth-child(6) {
  left: 35%;
  top: 80%;
  background: var(--glow-purple);
  animation-duration: 13s;
  animation-delay: 5s;
}

.particle:nth-child(7) {
  left: 60%;
  top: 50%;
  background: var(--glow-pink);
  animation-duration: 10s;
  animation-delay: 2.5s;
  width: 2px;
  height: 2px;
}

.particle:nth-child(8) {
  left: 90%;
  top: 15%;
  background: var(--accent);
  animation-duration: 17s;
  animation-delay: 6s;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  10% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
    transform: translateY(-80px) translateX(20px);
  }
  90% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateY(-160px) translateX(-10px);
  }
}

/* ========== Avatar Glow ========== */
.avatar-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    var(--glow-purple),
    var(--glow-pink),
    var(--glow-purple)
  );
  opacity: 0.5;
  animation: avatarGlow 3s ease-in-out infinite;
  filter: blur(6px);
  will-change: transform, opacity;
}

@keyframes avatarGlow {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.06);
  }
}

/* ========== Send Button Glow (mouse only) ========== */
@media (hover: hover) and (pointer: fine) {
  .send-btn:hover::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--user-bubble-start), var(--user-bubble-end));
    filter: blur(8px);
    opacity: 0.4;
    z-index: -1;
  }
}

.send-btn {
  position: relative;
}

/* ========== Gender Card Animations ========== */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes borderRotate {
  to {
    --border-angle: 360deg;
  }
}

@keyframes shimmerSweep {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes genderCardEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes titleFadeDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  .particle {
    animation: none;
  }

  .avatar-glow {
    animation: none;
  }

  .message {
    animation: none;
    opacity: 1;
  }

  .quick-topics {
    animation: none;
    opacity: 1;
  }

  .page {
    transition: none;
  }

  .gender-btn {
    animation: none;
    opacity: 1;
  }

  .gender-btn::before {
    animation: none;
  }

  .gender-btn::after {
    animation: none;
  }

  .select-header {
    animation: none;
  }
}
