.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: #3498db; /* Default color */
  transition: width 0.4s ease-in-out, background-color 0.2s ease-in-out; /* Smooth transition */
  z-index: 9999;
  overflow: hidden;
  background-size: 40px 40px; /* Adjust stripe size */
}

.stripes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
  animation: stripeAnimation 1s linear infinite; /* Animation for stripes */
}

@keyframes stripeAnimation {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 40px; /* Move stripes */
  }
}

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #3498db; /* Default color */
  border-top: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Add red color when fail state is triggered */
.page-loader.fail .loader {
  border: 5px solid #e74c3c; /* Red on fail */
  border-top: 5px solid transparent;
}