:root {
  --line-border-fill: #32cd32;
  --line-border-empty: #d3d3d3;
  --progress-height: 6px;
  --circle-size: 2.8rem;
  --animation-duration: 0.8s;
  --pulse-duration: 2s;
  --lime-primary: #32cd32;
  --lime-light: #32cd32;
  --lime-dark: #32cd32;
}

#main .container {
  text-align: center;
  padding-top: 25px !important;
  padding-bottom: 0px !important;
  /* margin-top: 2rem; */
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  #main .container {
    /* padding-top: 3rem !important; */
  }
}

.progress-container {
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  position: relative;
  width: 85%;
  margin: 0 auto;
  /* margin-bottom: 2rem; */
  padding: 1rem 0;
}

/* Enhanced progress line background */
.progress-container::before {
  content: "";
  background: linear-gradient(90deg,
      var(--line-border-empty) 0%,
      var(--line-border-empty) 100%);
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: var(--progress-height);
  width: 100%;
  z-index: 1;
  border-radius: var(--progress-height);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced progress bar with gradient and animation */
#progress {
  background: linear-gradient(90deg,
      var(--lime-primary) 0%,
      var(--lime-light) 50%,
      var(--lime-primary) 100%);
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: var(--progress-height);
  z-index: 2;
  border-radius: var(--progress-height);
  box-shadow: 0 2px 8px rgba(50, 205, 50, 0.3);
  transition: width var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
  animation: progressShimmer 3s ease-in-out infinite;
}

/* Shimmer animation for progress bar */
@keyframes progressShimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Progress width classes with smooth transitions */
.progress--1 {
  width: 0;
}

.progress-0 {
  width: calc(25%/2);
}

.progress-1 {
  width: 25% !important;
}

.progress-2 {
  width: 50% !important;
}

.progress-3 {
  width: 75% !important;
}

.progress-4 {
  width: 100% !important;
}

/* Enhanced rectangle styling */
.circle {
  background-color: var(--white-primary);
  color: var(--text-primary);
  border-radius: 15px;
  height: var(--circle-size);
  width: calc(var(--circle-size) * 2.5);
  border: 1px solid var(--line-border-empty);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 1.2rem;
  position: relative;
  z-index: 3;
  cursor: pointer;
  /* box-shadow: 0 2px 4px var(--shadow-light); */
  overflow: hidden;
  font-family: 'Helvetica', 'Arial', sans-serif;
  padding: 0.5rem;
  gap: 0.25rem;
}

/* Step number styling - hidden */
.step-number {
  display: none;
}

/* Step name styling inside rectangles */
.step-name {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  font-family: 'Helvetica', 'Arial', sans-serif;
  text-align: center;
  color: var(--text-secondary);
  transition: all var(--animation-duration) ease;
}

/* Hover effect for circles */
.circle:hover {
  /* transform: scale(1.02); */
  box-shadow: 0 4px 12px var(--shadow-medium);
}

/* Active circle with enhanced styling */
.circle.active {
  background: linear-gradient(135deg, var(--lime-primary) 0%, var(--lime-light) 100%);
  border-color: var(--lime-primary);
  color: #000000;
  /* box-shadow: 0 4px 16px rgba(50, 205, 50, 0.4); */
  /* animation: activePulse var(--pulse-duration) ease-in-out infinite; */
  /* transform: scale(1.05); */
}

.circle.active .step-name {
  color: #000000;
  font-weight: 500;
}

/* Completed circle styling */
.circle.completed {
  background: linear-gradient(135deg, var(--lime-primary) 0%, var(--lime-dark) 100%);
  border-color: var(--lime-primary);
  color: #000000;
  box-shadow: 0 4px 16px rgba(50, 205, 50, 0.4);
}

.circle.completed .step-name {
  color: #000000;
  font-weight: 500;
}

/* Pulse animation for active step */
@keyframes activePulse {

  0%,
  100% {
    box-shadow: 0 4px 16px var(--shadow-medium);
    transform: scale(1.05);
  }

  50% {
    box-shadow: 0 6px 20px var(--shadow-dark);
    transform: scale(1.08);
  }
}

/* Removed old state-names section - now integrated into rectangles */

/* Connecting lines between rectangles */
.circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: calc(100% - calc(var(--circle-size) * 2.5));
  height: 2px;
  background: var(--line-border-empty);
  transform: translateY(-50%);
  z-index: 1;
  transition: background-color var(--animation-duration) ease;
}

.circle:last-child::after {
  display: none;
}

.circle.active::after {
  background: linear-gradient(90deg, var(--lime-primary) 0%, var(--line-border-empty) 100%);
}

.circle.completed::after {
  background: var(--lime-primary);
}

/* Responsive design */
@media (max-width: 768px) {
  .progress-container {
    width: 98%;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
  }

  .circle {
    height: 2.5rem;
    width: calc(2.5rem * 2.2);
    font-size: 1rem;
    border-radius: 12px;
    min-height: 44px;
    /* Touch target */
  }

  .step-name {
    font-size: 0.7rem;
    line-height: 1.1;
  }

  .name {
    font-size: 0.8rem;
    padding: 0.25rem;
  }

  .state-names {
    min-width: calc(100% - 2rem);
  }

  /* Adjust progress bar height for mobile */
  :root {
    --progress-height: 8px;
  }

  .progress-container::before,
  #progress {
    height: 8px;
  }
}

@media (max-width: 480px) {
  .progress-container {
    width: 100%;
    padding: 0.5rem 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .circle {
    height: 2.2rem;
    width: calc(2.2rem * 2);
    font-size: 0.85rem;
    border-radius: 10px;
    flex-shrink: 0;
    scroll-snap-align: center;
    min-height: 44px;
    /* Touch target */
    padding: 0.3rem;
  }

  .step-name {
    font-size: 0.6rem;
    line-height: 1;
    text-align: center;
  }

  .name {
    font-size: 0.75rem;
    padding: 0.2rem;
  }

  /* Adjust progress bar for very small screens */
  :root {
    --progress-height: 6px;
  }

  .progress-container::before,
  #progress {
    height: 6px;
  }
}

/* iPhone 16 specific optimizations for progress bar */
@media (max-width: 430px) and (min-height: 900px) {
  .progress-container {
    /* margin-top: 1rem; */
    /* margin-bottom: 2rem; */
  }

  .circle {
    height: 2.3rem;
    width: calc(2.3rem * 1.8);
    font-size: 0.8rem;
  }

  .step-name {
    font-size: 0.55rem;
    font-weight: 500;
  }
}

/* Loading animation for progress bar */
.progress-container.loading #progress {
  animation: progressShimmer 1.5s ease-in-out infinite,
    progressFill 2s ease-out forwards;
}

@keyframes progressFill {
  from {
    width: 0;
  }

  to {
    width: var(--target-width, 100%);
  }
}

/* Success animation */
.progress-container.success .circle.completed {
  animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1.05);
  }
}