/* Firefox URL Bar Loading Animation */
:root {
  --w-urlbar-bg_color: #ff6b6b66, #4ecdc466, #ff6b6b66;
}

#urlbar {
  .urlbar-input-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--w-urlbar-bg_color));
    background-size: 200% 100%;
    animation: urlbar-loading-gradient 1s linear reverse infinite;
    animation-play-state: paused;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
  }
}

#main-window:has(.tabbrowser-tab[selected][busy])
  .urlbar-input-container::before {
  animation-play-state: running;
  opacity: 1;
}

@keyframes urlbar-loading-gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}
