.spinner {
  position: fixed;
  /* Fixed positioning makes the spinner cover the whole page */
  z-index: 9999;
  /* Z-index of 9999 ensures the spinner is above all other elements */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  /* Semi-transparent white background */
  display: flex;
  /* Flexbox layout centers the spinner horizontally and vertically */
  justify-content: center;
  align-items: center;
}

.spinner::before {
  content: "";
  width: 50px;
  height: 50px;
  border: 4px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}