/*
 * Process Steps Component
 * Responsive step indicator for workflow displays
 * Used on (detailed variant): /upload/, /rcti/upload/, /vendor-invoice/batch/, /bookings/upload/
 */

/* ================================
 * CONTAINER STYLES
 * ================================ */

.process-steps {
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--pk-surface-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--pk-neutral-border);
}

.process-steps__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ================================
 * STEP ITEM STYLES
 * ================================ */

.process-steps__step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.process-steps__number {
  background: var(--pk-orange);
  color: var(--pk-white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}

.process-steps__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--pk-slate);
  white-space: nowrap;
}

/* ================================
 * SEPARATOR / ARROW STYLES
 * ================================ */

.process-steps__separator {
  color: var(--pk-slate-lighter);
  font-size: var(--text-xs);
  flex-shrink: 0;
  opacity: 0.6;
}

/* ================================
 * RESPONSIVE BREAKPOINTS
 * ================================ */

/* Tablet screens (768px - 1024px) */
@media screen and (max-width: 1024px) {
  .process-steps__container {
    gap: var(--space-2);
  }

  .process-steps__step {
    gap: var(--space-2);
  }

  .process-steps__number {
    width: 22px;
    height: 22px;
    font-size: var(--text-xs);
  }

  .process-steps__label {
    font-size: var(--text-xs);
  }
}

/* Small tablet / large mobile (480px - 768px) */
@media screen and (max-width: 768px) {
  .process-steps {
    padding: var(--space-4) var(--space-5);
  }

  .process-steps__container {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3) var(--space-5);
  }

  .process-steps__step {
    flex: 0 0 auto;
  }

  .process-steps__separator {
    display: none;
  }

  .process-steps__number {
    width: 20px;
    height: 20px;
    font-size: var(--text-micro);
  }

  .process-steps__label {
    font-size: var(--text-xs);
  }
}

/* Mobile screens (< 480px) - Vertical stack */
@media screen and (max-width: 480px) {
  .process-steps {
    padding: var(--space-4);
  }

  .process-steps__container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .process-steps__step {
    width: 100%;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--pk-neutral-border);
  }

  .process-steps__step:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .process-steps__step:first-child {
    padding-top: 0;
  }

  .process-steps__number {
    width: 24px;
    height: 24px;
    font-size: var(--text-xs);
  }

  .process-steps__label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
  }

  /* Add connecting lines for visual continuity on mobile */
  .process-steps__step::after {
    content: none; /* Can be enabled for connecting line effect */
  }
}

/* ================================
 * ALTERNATIVE: COMPACT HORIZONTAL MODE
 * For pages with less horizontal space
 * ================================ */

.process-steps--compact .process-steps__container {
  gap: var(--space-2);
}

.process-steps--compact .process-steps__step {
  gap: var(--space-2);
}

.process-steps--compact .process-steps__number {
  width: 20px;
  height: 20px;
  font-size: var(--text-micro);
}

.process-steps--compact .process-steps__label {
  font-size: var(--text-xs);
}

/* ================================
 * ACCESSIBILITY IMPROVEMENTS
 * ================================ */

/* Ensure adequate touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
  .process-steps__step {
    min-height: var(--touch-target, 44px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .process-steps,
  .process-steps__step,
  .process-steps__number {
    transition: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .process-steps {
    border-width: 2px;
  }

  .process-steps__number {
    outline: 2px solid var(--pk-slate-dark);
    outline-offset: 1px;
  }
}

/* ================================
 * DETAILED VARIANT (4 Sep 2026, upload page base)
 * Additive: pages with the plain label-only markup render unchanged.
 * .process-steps--detailed stacks a description under each label, draws
 * every number as an outlined circle, and fills only the current step.
 * ================================ */

.process-steps__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.process-steps__desc {
  font-size: var(--text-caption);
  color: var(--pk-gray-500);
  white-space: nowrap;
}

.process-steps--detailed {
  padding: var(--space-5) var(--space-6);
  background: var(--pk-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.process-steps--detailed .process-steps__number {
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
  background: var(--pk-white);
  color: var(--pk-gray-700);
  border: 2px solid var(--pk-gray-200);
}

.process-steps--detailed .process-steps__step--current .process-steps__number {
  background: var(--pk-orange);
  color: var(--pk-white);
  border-color: var(--pk-orange);
}

/* The filled orange circle marks the current step; the label stays dark so
   13px text keeps AA (orange measured 3.40:1 on white, 4 Sep 2026). */
.process-steps--detailed .process-steps__step--current .process-steps__label {
  color: var(--pk-gray-900);
  font-weight: var(--font-semibold);
}

@media screen and (max-width: 1024px) {
  .process-steps__desc {
    white-space: normal;
  }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
  /* Two steps per row instead of 3 + 1 once the descriptions make each
     step too wide for four across (measured 4 Sep 2026). Below 480px the
     container is already a column (see the 480px breakpoint above), so
     this rule is inert there. */
  .process-steps--detailed .process-steps__step {
    flex: 1 1 40%;
  }
}
