/* Step Navigation Styling */
.step-navigation-container {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 100;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 10px;
  min-width: 100px;
  position: relative;
  transition: all 0.3s ease;
  flex: 1; /* Make each step take equal space */
}

/* Connecting line between steps - more precisely aligned */
.step-indicator::before {
  content: "";
  position: absolute;
  top: calc(10px + 15px); /* 10px padding-top + 15px (half of circle height) */
  left: 0;
  width: 50%; /* Start at left edge and end in the middle */
  height: 3px; /* Slightly thicker for better visibility */
  background-color: #dee2e6;
  z-index: 1;
  transition: background-color 0.3s ease; /* Smooth transition for color changes */
}

.step-indicator::after {
  content: "";
  position: absolute;
  top: calc(10px + 15px); /* 10px padding-top + 15px (half of circle height) */
  left: 50%; /* Start from middle */
  width: 50%; /* End at the right edge */
  height: 3px; /* Slightly thicker for better visibility */
  background-color: #dee2e6;
  z-index: 1;
  transition: background-color 0.3s ease; /* Smooth transition for color changes */
}

/* Hide the left line for the first step */
.step-indicator:first-child::before {
  display: none;
}

/* Hide the right line for the last step */
.step-indicator:last-child::after {
  display: none;
}

.step-indicator:last-child::after {
  display: none;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #dee2e6;
  color: #6c757d;
  font-weight: bold;
  position: relative;
  z-index: 2; /* Make sure it appears above the connecting lines */
  margin-bottom: 5px;
  transition: all 0.3s ease;
  /* Add a small border to create better alignment with lines */
  border: 2px solid #dee2e6;
}

.step-title {
  font-size: 12px;
  color: #6c757d;
  text-align: center;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

/* Active step - using !important to override completed state */
.step-indicator.active .step-number {
  background-color: #007bff !important;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  animation: pulse 2s infinite;
}

.step-indicator.active .step-title {
  color: #007bff !important;
  font-weight: bold;
}

/* Active step connector lines */
.step-indicator.active::after {
  background-color: #007bff !important;
  top: calc(10px + 15px); /* Match the positioning of main connector lines */
}

.step-indicator.active::before {
  background-color: #007bff !important;
  top: calc(10px + 15px); /* Match the positioning of main connector lines */
}

/* Completed step */
.step-indicator.completed .step-number {
  background-color: #28a745;
  color: #fff;
}

.step-indicator.completed::after {
  background-color: #28a745;
  top: calc(10px + 15px); /* Match the positioning of main connector lines */
}

/* The line coming from a completed step */
.step-indicator.completed::before {
  background-color: #28a745;
  top: calc(10px + 15px); /* Match the positioning of main connector lines */
}

/* The line going into a completed step */
.step-indicator.completed + .step-indicator::before {
  background-color: #28a745;
}


/* Next available step - same style as other steps, but not clickable */
.step-indicator.next-step {
  cursor: not-allowed;
  /* No special styling to make it look the same as other steps */
}

/* Must override any disabled pointer events */
.step-indicator.completed {
  pointer-events: auto !important; /* Allow interaction with completed steps */
  cursor: pointer !important; /* Allow interaction with completed steps */
}

/* Disabled step */
.step-indicator.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none; /* Completely disable interaction */
}

/* Pulse animation for active step */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .step-navigation-container {
    padding: 5px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .step-indicator {
    padding: 5px;
    min-width: 70px;
  }

  .step-number {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }

  .step-indicator::before,
  .step-indicator::after {
    top: calc(
      5px + 12.5px
    ); /* 5px padding-top + 12.5px (half of circle height) */
  }

  .step-indicator.completed::before,
  .step-indicator.completed::after,
  .step-indicator.active::before,
  .step-indicator.active::after {
    top: calc(5px + 12.5px); /* Match the positioning for mobile */
  }

  .step-title {
    font-size: 10px;
    max-width: 60px;
  }
}

