/* ---------------- REAL-SERVER SYNC INDICATORS (Optimistic UI veil + STASH header) ---------------- */

/* Tile veil: transparent layer, does not hide the icon */
.tile .sync-veil {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 22, 0.48);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}

/* Animated shimmer border drawn on the veil (keeps the tile's own background intact) */
.tile.is-syncing .sync-veil {
  display: flex;
  border: 1.5px solid transparent;
  background:
    linear-gradient(rgba(12, 14, 22, 0.48), rgba(12, 14, 22, 0.48)) padding-box,
    linear-gradient(120deg, rgba(0, 240, 255, 0.15), rgba(168, 85, 247, 0.85), rgba(0, 240, 255, 0.85), rgba(168, 85, 247, 0.15)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: sync-border-run 1.4s linear infinite;
}
@keyframes sync-border-run {
  0% { background-position: 0 0, 0% 0; }
  100% { background-position: 0 0, 300% 0; }
}

/* Thin elegant spinner (cyan/purple) */
.sync-ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.25);
  border-top-color: #a855f7;
  border-right-color: #00f0ff;
  animation: sync-spin 0.8s linear infinite;
  filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.6));
  flex: 0 0 auto;
}
@keyframes sync-spin {
  to { transform: rotate(360deg); }
}

/* Success: very light green flash, 250ms */
.tile.sync-flash {
  animation: sync-ok-flash 250ms ease-out;
}
@keyframes sync-ok-flash {
  0% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.9), 0 0 18px rgba(34, 197, 94, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------------- STASH header indicator ---------------- */
.col-stash .inv-head h2 { display: flex; align-items: center; gap: 7px; }

.col-stash.col-syncing .bar.purple {
  animation: stash-bar-pulse 1.1s ease-in-out infinite;
}
@keyframes stash-bar-pulse {
  0%, 100% { box-shadow: 0 0 3px rgba(168, 85, 247, 0.5); opacity: 1; }
  50% { box-shadow: 0 0 12px rgba(168, 85, 247, 1), 0 0 22px rgba(168, 85, 247, 0.5); opacity: 0.75; }
}

.stash-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b8fbff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.7);
}
.stash-sync .sync-ring { width: 13px; height: 13px; border-width: 1.5px; }
.stash-sync b { font-weight: 900; line-height: 1; }
.stash-sync.done b.ok {
  color: var(--green, #22c55e);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  animation: stash-ok-pop 450ms ease-out;
}
@keyframes stash-ok-pop {
  0% { transform: scale(0.4); opacity: 0; }
  40% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
