/* ===================================================
   ReactBits Effects - Vanilla CSS/JS Adaptations
   Original: https://reactbits.dev
   =================================================== */

/* --- ShinyText --- */
.shiny-text {
  display: inline-block !important;
  background-image: linear-gradient(120deg,
    rgba(255,255,255,0.3) 0%,
    rgba(255,255,255,0.3) 28%,
    rgba(255,255,255,1) 50%,
    rgba(255,255,255,0.3) 72%,
    rgba(255,255,255,0.3) 100%
  ) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: shiny-sweep 3s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

.shiny-text--slow {
  animation-duration: 5s !important;
}

.shiny-text--fast {
  animation-duration: 1.5s !important;
}

.shiny-text.paused {
  animation-play-state: paused !important;
}

@keyframes shiny-sweep {
  0% {
    background-position: 150% center;
  }
  100% {
    background-position: -50% center;
  }
}

/* --- GradientText --- */
.gradient-text {
  display: inline-block !important;
  background-image: linear-gradient(to right, #5227FF, #7cff67, #5227FF) !important;
  background-size: 300% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: gradient-flow 8s ease-in-out infinite alternate !important;
}

.gradient-text--fast {
  animation-duration: 4s !important;
}

.gradient-text--slow {
  animation-duration: 15s !important;
}

.gradient-text--vertical {
  background-size: 100% 300% !important;
  animation-name: gradient-flow-vertical !important;
}

.gradient-text.paused {
  animation-play-state: paused !important;
}

/* --- Combined: rainbow gradient + shiny sweep --- */
.shiny-gradient-text {
  display: inline-block !important;
  background-image:
    linear-gradient(120deg, transparent 0%, transparent 38%, rgba(255,255,255,0.7) 50%, transparent 62%, transparent 100%),
    linear-gradient(to right, #5227FF, #7cff67, #5227FF) !important;
  background-size: 200% auto, 300% 100% !important;
  background-position: 150% center, 0% 50% !important;
  -webkit-background-clip: text, text !important;
  background-clip: text, text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation:
    shiny-sweep 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite,
    gradient-flow 8s ease-in-out infinite alternate !important;
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes gradient-flow-vertical {
  0% {
    background-position: 50% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
  100% {
    background-position: 50% 0%;
  }
}

/* --- BlurText --- */
.blur-text-container {
  display: flex;
  flex-wrap: wrap;
}

.blur-text-word,
.blur-text-char {
  display: inline-block;
  will-change: transform, filter, opacity;
  transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blur-text-word.from-top,
.blur-text-char.from-top {
  filter: blur(10px);
  opacity: 0;
  transform: translateY(-50px);
}

.blur-text-word.from-bottom,
.blur-text-char.from-bottom {
  filter: blur(10px);
  opacity: 0;
  transform: translateY(50px);
}

.blur-text-word.revealed,
.blur-text-char.revealed {
  filter: blur(0px);
  opacity: 1;
  transform: translateY(0);
}

/* --- ClickSpark --- */
.clickspark-container {
  position: relative;
}
.clickspark-container > canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* --- Aurora Background --- */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* --- Aurora inside toolbar --- */
#toolbar {
  position: relative !important;
  overflow: visible !important;
}

#toolbar > canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 80px !important;
  z-index: 1;
  pointer-events: none;
}

/* --- Screen edge glow ring --- */
.screen-edge-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  border: 2px solid transparent;
  box-shadow:
    inset 0 0 80px 30px rgba(82, 39, 255, 0.08),
    inset 0 0 30px 10px rgba(124, 255, 103, 0.05),
    0 0 80px 30px rgba(82, 39, 255, 0.08),
    0 0 30px 10px rgba(124, 255, 103, 0.05);
  animation: edgePulse 4s ease-in-out infinite alternate;
}

@keyframes edgePulse {
  0% {
    box-shadow:
      inset 0 0 80px 30px rgba(82, 39, 255, 0.08),
      inset 0 0 30px 10px rgba(124, 255, 103, 0.05),
      0 0 80px 30px rgba(82, 39, 255, 0.08),
      0 0 30px 10px rgba(124, 255, 103, 0.05);
  }
  100% {
    box-shadow:
      inset 0 0 80px 30px rgba(124, 255, 103, 0.10),
      inset 0 0 30px 10px rgba(82, 39, 255, 0.07),
      0 0 80px 30px rgba(124, 255, 103, 0.10),
      0 0 30px 10px rgba(82, 39, 255, 0.07);
  }
}

/* --- Particles Background --- */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* --- Dark mode adjustments --- */
html.darkmode .shiny-text {
  background-image: linear-gradient(120deg, #6b6b6b 0%, #6b6b6b 35%, #e0e0e0 50%, #6b6b6b 65%, #6b6b6b 100%);
}

html.darkmode #toolbar > canvas {
  opacity: 0.85;
}

html.darkmode .screen-edge-glow {
  animation: edgePulseDark 4s ease-in-out infinite alternate;
}

@keyframes edgePulseDark {
  0% {
    box-shadow:
      inset 0 0 80px 30px rgba(82, 39, 255, 0.12),
      inset 0 0 30px 10px rgba(124, 255, 103, 0.08),
      0 0 80px 30px rgba(82, 39, 255, 0.12),
      0 0 30px 10px rgba(124, 255, 103, 0.08);
  }
  100% {
    box-shadow:
      inset 0 0 80px 30px rgba(124, 255, 103, 0.15),
      inset 0 0 30px 10px rgba(82, 39, 255, 0.10),
      0 0 80px 30px rgba(124, 255, 103, 0.15),
      0 0 30px 10px rgba(82, 39, 255, 0.10);
  }
}
