@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.app-loader[hidden] {
  display: none;
}

.app-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.app-loader-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.75s linear infinite;
}

.app-loader-text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
}

.btn.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.btn.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
  flex-shrink: 0;
  opacity: 0.9;
}

body.is-app-loading {
  overflow: hidden;
}

.list-item.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.list-item.is-loading .arrow::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
  border: 2px solid var(--text-3);
  border-right-color: transparent;
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}

.list-item.is-loading .arrow {
  font-size: 0;
}

.tx-context-menu-item.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.tx-context-menu-item.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}
