/* Custom visual effects for Butterfly. */
:root {
  --custom-accent: #36d1dc;
  --custom-accent-2: #ff7eb3;
  --custom-accent-3: #f9f871;
}

.custom-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--custom-accent), var(--custom-accent-2), var(--custom-accent-3));
  box-shadow: 0 0 10px rgba(54, 209, 220, 0.75), 0 0 18px rgba(255, 126, 179, 0.45);
  pointer-events: none;
  transition: width 0.12s ease-out;
}

#custom-line-network,
#custom-click-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#custom-line-network {
  z-index: 0;
}

#custom-click-particles {
  z-index: 9998;
}

#body-wrap,
#sidebar {
  position: relative;
}

#body-wrap,
#sidebar {
  z-index: 1;
}

#rightside {
  z-index: 10002;
}

.avatar-img {
  position: relative;
  overflow: visible !important;
  border-radius: 50%;
}

.avatar-img::before {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: #36d1dc;
  content: "";
  z-index: 0;
  opacity: 0.32;
  filter: blur(10px);
  animation: custom-avatar-glow 3.6s ease-in-out infinite;
  pointer-events: none;
}

.avatar-img img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.82), 0 0 18px rgba(54, 209, 220, 0.38);
  animation: custom-avatar-shadow 3.6s ease-in-out infinite;
}

@keyframes custom-avatar-glow {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.58;
    transform: scale(1.06);
  }
}

@keyframes custom-avatar-shadow {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.82), 0 0 16px rgba(54, 209, 220, 0.34);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92), 0 0 26px rgba(54, 209, 220, 0.6);
  }
}

.recent-post-item,
.card-widget,
#post,
#page,
#archive,
#tag,
#category {
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.recent-post-item:hover,
.card-widget:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 34px rgba(25, 35, 60, 0.2);
}

.recent-post-item .post_cover,
.recent-post-item .post_cover img {
  overflow: hidden;
}

.recent-post-item .post-bg {
  transition: transform 0.45s ease, filter 0.45s ease;
}

.recent-post-item:hover .post-bg {
  transform: scale(1.06);
  filter: saturate(1.12) contrast(1.04);
}

#go-up {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(54, 209, 220, 0.28);
}

#go-up::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(54, 209, 220, 0.45), rgba(255, 126, 179, 0.38));
  content: "";
  opacity: 0;
  transition: opacity 0.25s ease;
}

#go-up:hover::before {
  opacity: 1;
}

#go-up > * {
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .recent-post-item:hover,
[data-theme="dark"] .card-widget:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38), 0 0 22px rgba(54, 209, 220, 0.16);
}

@media screen and (max-width: 768px) {
  .recent-post-item:hover,
  .card-widget:hover {
    transform: translateY(-3px);
  }

  .custom-scroll-progress {
    height: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-img::before,
  .avatar-img img {
    animation: none;
  }

  .recent-post-item,
  .card-widget,
  .recent-post-item .post-bg,
  .custom-scroll-progress {
    transition: none;
  }
}
