/**
 * Stepper styles
 * @countermeasure/web-components/navigation/stepper
 */

/* ============================================================================
   STEPPER CONTAINER
   ============================================================================ */
.cmm-stepper {
  display: flex;
  width: 100%;
}

.cmm-stepper__list {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ============================================================================
   STEP ITEM
   ============================================================================ */
.cmm-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  text-align: center;
}

/* ============================================================================
   CONNECTOR LINE
   ============================================================================ */
.cmm-stepper__connector {
  position: absolute;
  top: 16px;
  right: 50%;
  width: 100%;
  height: 2px;
  background-color: hsl(var(--border));
  transform: translateY(-50%);
  z-index: 0;
}

.cmm-stepper__connector--complete {
  background-color: hsl(var(--primary));
}

/* ============================================================================
   STEP INDICATOR
   ============================================================================ */
.cmm-stepper__indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.cmm-stepper__indicator svg {
  width: 1rem;
  height: 1rem;
}

.cmm-stepper__indicator--clickable {
  cursor: pointer;
}

.cmm-stepper__indicator--clickable:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.cmm-stepper__indicator--clickable:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

/* ============================================================================
   STEP STATUS VARIANTS
   ============================================================================ */

/* Pending */
.cmm-stepper__step--pending .cmm-stepper__indicator {
  border-color: hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--muted-foreground));
}

/* Active */
.cmm-stepper__step--active .cmm-stepper__indicator {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Complete */
.cmm-stepper__step--complete .cmm-stepper__indicator {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Error */
.cmm-stepper__step--error .cmm-stepper__indicator {
  border-color: hsl(var(--danger, var(--destructive, 0 84% 60%)));
  background-color: hsl(var(--danger, var(--destructive, 0 84% 60%)));
  color: hsl(var(--primary-foreground));
}

/* Disabled */
.cmm-stepper__step--disabled .cmm-stepper__indicator {
  border-color: hsl(var(--border));
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  opacity: 0.5;
}

/* ============================================================================
   STEP CONTENT
   ============================================================================ */
.cmm-stepper__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  margin-top: 0.5rem;
  max-width: 120px;
}

.cmm-stepper__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1.3;
}

.cmm-stepper__step--disabled .cmm-stepper__label {
  color: hsl(var(--muted-foreground));
  opacity: 0.5;
}

.cmm-stepper__description {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.3;
}

/* ============================================================================
   VERTICAL ORIENTATION
   ============================================================================ */
.cmm-stepper--vertical .cmm-stepper__list {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.cmm-stepper--vertical .cmm-stepper__step {
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  flex: none;
  padding-bottom: 1.5rem;
}

.cmm-stepper--vertical .cmm-stepper__connector {
  position: absolute;
  top: auto;
  right: auto;
  left: 15px;
  bottom: 0;
  width: 2px;
  height: 100%;
  transform: none;
}

.cmm-stepper--vertical .cmm-stepper__content {
  align-items: flex-start;
  margin-top: 0;
  margin-left: 0.75rem;
  max-width: none;
  padding-top: 0.25rem;
}
