/**
 * @file
 * Styles for the directory search loading animation.
 */

/* Loading spinner animation */
@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Submit button loading state */
.rocp-directory-search-form .form-actions .form-submit.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 1;
}

/* Hide the original button text when loading */
.rocp-directory-search-form .form-actions .form-submit.is-loading .button-text {
  visibility: hidden;
}

/* Loading text and spinner */
.rocp-directory-search-form .form-actions .form-submit.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

.rocp-directory-search-form .form-actions .form-submit.is-loading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

/* Ensure button maintains its size when loading */
.rocp-directory-search-form .form-actions .form-submit {
  position: relative;
}

