.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background-color: #2e304b; Change to your preferred color */
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.loading-line {
  width: 3px;
  height: 30%;
  background-color: #fff; /* Line color */
  border-radius: 3px;
  position: relative;
  opacity: 0;
  animation: 
    appear 0.1s 1s forwards,
    grow 2.9s 1.1s cubic-bezier(0.3, 0.7, 0.4, 0.9) forwards,
    reveal 0.8s 3.6s forwards;
}

@keyframes appear {
  to { opacity: 1; }
}

@keyframes grow {
  0% { height: 15%; }
  15% { height: 30%; }
  30% { height: 60%; }
  45% { height: 72%; }
  60% { height: 82%; }
  75% { height: 90%; }
  90% { height: 96%; }
  100% { height: 100%; }
}

@keyframes reveal {
  0% { 
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(0);
    opacity: 0;
  }
}

.loading-overlay::before,
.loading-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  /* background-color: inherit; */
  background-color: var(--theme-secondary);
  z-index: -1;
  transition: transform 0.8s cubic-bezier(0.8, 0, 0.2, 1);
  transform: translateX(0);
}

.loading-overlay::before {
  left: 0;
}

.loading-overlay::after {
  right: 0;
}

.loading-overlay.animate-out::before {
  transform: translateX(-100%);
}

.loading-overlay.animate-out::after {
  transform: translateX(100%);
}