/* 音乐卡片相关 */

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

/* 背景呼吸灯效果 */
@keyframes pulse-opacity {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.4;
  }
}

.animated-gradient-border-effect {
  position: relative;
  padding: 2px;
  border-radius: 16px;
  z-index: 0;
}

.animated-gradient-border-effect::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;

  border-radius: inherit;
  background-image: linear-gradient(
    150deg,
    rgba(117, 254, 128, 1) 0%,
    rgba(74, 220, 223, 1) 6.67%,
    rgba(238, 254, 117, 1) 13.33%,
    rgba(29, 186, 97, 1) 20%,
    rgba(10, 183, 251, 1) 26.67%,

    /* 第二段 */ rgba(117, 254, 128, 1) 33.33%,
    rgba(74, 220, 223, 1) 40%,
    rgba(238, 254, 117, 1) 46.67%,
    rgba(29, 186, 97, 1) 53.33%,
    rgba(10, 183, 251, 1) 60%,

    /* 第三段 */ rgba(117, 254, 128, 1) 66.67%,
    rgba(74, 220, 223, 1) 73.33%,
    rgba(238, 254, 117, 1) 80%,
    rgba(29, 186, 97, 1) 86.67%,
    rgba(10, 183, 251, 1) 93.33%
  );
  background-size: 440% auto;
  filter: blur(40px);

  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.animated-gradient-border-effect::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;

  border-radius: inherit;
  background-image: linear-gradient(
    150deg,
    rgba(117, 254, 128, 1) 0%,
    rgba(74, 220, 223, 1) 6.67%,
    rgba(238, 254, 117, 1) 13.33%,
    rgba(29, 186, 97, 1) 20%,
    rgba(10, 183, 251, 1) 26.67%,

    /* 第二段 */ rgba(117, 254, 128, 1) 33.33%,
    rgba(74, 220, 223, 1) 40%,
    rgba(238, 254, 117, 1) 46.67%,
    rgba(29, 186, 97, 1) 53.33%,
    rgba(10, 183, 251, 1) 60%,

    /* 第三段 */ rgba(117, 254, 128, 1) 66.67%,
    rgba(74, 220, 223, 1) 73.33%,
    rgba(238, 254, 117, 1) 80%,
    rgba(29, 186, 97, 1) 86.67%,
    rgba(10, 183, 251, 1) 93.33%
  );
  background-size: 440% auto;

  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.group:hover .animated-gradient-border-effect::before {
  opacity: 1;
}
.group:hover .animated-gradient-border-effect::after {
  opacity: 0.4;
}
.is-playing .animated-gradient-border-effect::before {
  opacity: 1;
  animation: gradientFlow 26s linear infinite;
}
.is-playing .animated-gradient-border-effect::after {
  animation: pulse-opacity 8s ease-in-out infinite;
}
/* 首页HeroInput相关 */

.input-border-effect {
  position: relative;
  padding: 2px;
  border-radius: 16px;
  z-index: 0;
}

.input-border-effect::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -10; /* Ensure it's behind the content */
  border-radius: inherit; /* e.g., 16px */
  background-image: linear-gradient(
    150deg,
    rgba(117, 254, 128, 1) 0%,
    rgba(74, 220, 223, 1) 6.67%,
    rgba(238, 254, 117, 1) 13.33%,
    rgba(29, 186, 97, 1) 20%,
    rgba(10, 183, 251, 1) 26.67%,

    /* 第二段 */ rgba(117, 254, 128, 1) 33.33%,
    rgba(74, 220, 223, 1) 40%,
    rgba(238, 254, 117, 1) 46.67%,
    rgba(29, 186, 97, 1) 53.33%,
    rgba(10, 183, 251, 1) 60%,

    /* 第三段 */ rgba(117, 254, 128, 1) 66.67%,
    rgba(74, 220, 223, 1) 73.33%,
    rgba(238, 254, 117, 1) 80%,
    rgba(29, 186, 97, 1) 86.67%,
    rgba(10, 183, 251, 1) 93.33%
  );
  background-size: 440% auto;
  filter: blur(40px);
  opacity: 0.5; /* Or adjust as needed */
  transition: opacity 0.3s ease-in-out;
}

.input-border-effect:focus-within::after {
  opacity: 0.8;
}

.no-gradient-background {
  background-color: hsl(0 10% 100%);
}

.no-gradient-background:hover {
  background-color: hsl(0 10% 100% / 0.9);
}

.no-gradient-background:active {
  background-color: hsl(0 10% 100% / 0.8);
}

/* CTA按钮渐变 */
.gradient-background {
  background-image: linear-gradient(to right, hsl(var(--primary)), hsl(var(--gradient)));
  background-size: 100% 100%;
  position: relative;
  z-index: 1; /* 确保整个元素有合适的z-index */
}

.gradient-background:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(to right, hsl(var(--gradient)), hsl(var(--primary)));
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: inherit;
  z-index: -1; /* 将伪元素置于内容之下 */
}

.gradient-background:hover:before {
  opacity: 1;
}

.tag {
  @apply bg-foreground/10 inline-flex items-center py-1.5 px-3 rounded-md text-sm min-h-8 mx-auto;
}
