/* NetSystem Global Site Effects */
#ns-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--hlcolor, #1a73e8), #00d2ff, #7928ca);
  z-index: 999999;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.7), 0 0 5px rgba(0, 210, 255, 0.5);
  transition: width 0.08s ease-out;
}

#ns-effect-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99998;
  pointer-events: none;
  opacity: 1;
}

#ns-cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 380px;
  margin-left: -190px;
  margin-top: -190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 115, 232, 0.16) 0%, rgba(0, 210, 255, 0.07) 40%, rgba(26, 115, 232, 0) 70%);
  pointer-events: none;
  z-index: 99997;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  /* Fade Out: Brisk initial drop (0-300ms down to ~35%), then slow, delicate lingering tail (up to 1.2s) */
  transition: opacity 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: transform, opacity;
}

#ns-cursor-glow.active {
  opacity: 1;
  /* Fade In: Rapid initial response (0-150ms to ~78%), then soft ease-out landing into 100% */
  transition: opacity 0.45s cubic-bezier(0.16, 0.8, 0.25, 1);
}

/* Floating interactive effect widget */
#ns-effect-switcher {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99999;
  font-family: var(--fontfamily, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 13px;
  user-select: none;
}

.ns-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 115, 232, 0.28);
  color: #1e293b;
  padding: 8px 14px;
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 500;
}

.ns-switcher-btn:hover {
  background: #ffffff;
  border-color: var(--hlcolor, #1a73e8);
  box-shadow: 0 6px 22px rgba(26, 115, 232, 0.25);
  transform: translateY(-2px);
}

.ns-switcher-icon {
  font-size: 15px;
  display: inline-block;
  animation: ns-pulse-spin 4s ease-in-out infinite;
}

@keyframes ns-pulse-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.15); }
}

.ns-switcher-menu {
  position: absolute;
  bottom: 48px;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 6px;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#ns-effect-switcher.open .ns-switcher-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ns-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #334155;
  font-size: 12.5px;
  transition: all 0.15s ease;
}

.ns-switcher-item:hover {
  background: rgba(26, 115, 232, 0.08);
  color: var(--hlcolor, #1a73e8);
}

.ns-switcher-item.active {
  background: rgba(26, 115, 232, 0.12);
  color: var(--hlcolor, #1a73e8);
  font-weight: 600;
}

@media (max-width: 768px) {
  #ns-cursor-glow {
    display: none !important;
  }
  #ns-effect-switcher {
    bottom: 14px;
    right: 14px;
  }
  .ns-switcher-label {
    display: none;
  }
  .ns-switcher-btn {
    padding: 8px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #ns-effect-canvas,
  #ns-cursor-glow {
    display: none !important;
  }
}
