/**
 * Mobile Step Counter Styles - Compact Breadcrumb Design
 * Only shown on mobile and tablet devices
 */

/* Base styles for mobile step counter */
.mobile-step-counter {
  display: none; /* Hidden by default on desktop */
  background: #fff;
  padding: 12px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 100;
  margin-bottom: 16px;
  border-radius: 8px;
}

/* Hide step counter on last step */
.wizard-step-5 .mobile-step-counter {
  display: none !important;
}

/* Horizontal scrollable container */
.mobile-steps-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.mobile-steps-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Steps container - horizontal layout */
.mobile-steps-container {
  display: flex;
  align-items: stretch; /* Changed from center to stretch for equal heights */
  gap: 6px;
  padding: 4px 6px;
  min-width: fit-content;
}

/* Individual step card */
.mobile-step-card {
  min-height: 60px; /* Changed from fixed height to min-height */
  height: auto; /* Allow height to grow with content */
  overflow: visible; /* Changed from hidden to visible */
  display: flex;
  align-items: center; /* Changed from center to flex-start for better text alignment */
  gap: 8px;
  padding: 8px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  min-width: 100px;
  max-width: 140px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  scroll-snap-align: center;
}

/* Step states */
.mobile-step-card.completed {
  background: #f0f9ff;
  border-color: var(--primary);
  cursor: pointer;
}

.mobile-step-card.completed:hover {
  background: #e0f2fe;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(108, 92, 231, 0.15);
}

.mobile-step-card.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.mobile-step-card.pending {
  background: #f8f9fa;
  border-color: #e9ecef;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Step icon */
.mobile-step-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #94a3b8;
  margin-top: 2px; /* Slight top margin to align with text */
}

.mobile-step-card.completed .mobile-step-icon {
  color: var(--primary);
}

.mobile-step-card.completed .mobile-step-icon i::before {
  content: "\f058"; /* fa-check-circle */
}

.mobile-step-card.active .mobile-step-icon {
  color: #fff;
}

.mobile-step-card.active .mobile-step-icon i::before {
  content: "\f111"; /* fa-circle */
}

/* Step content */
.mobile-step-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Step title */
.mobile-step-title {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-step-card.completed .mobile-step-title {
  color: var(--primary);
}

.mobile-step-card.active .mobile-step-title {
  color: #fff;
}

/* Step values */
.mobile-step-values {
  display: flex;
  flex-direction: column;
  gap: 2px; /* Increased gap between values */
  font-size: 9px;
  color: #64748b;
  line-height: 1.4; /* Increased line height for better readability */
  width: 100%;
}

.mobile-step-card.active .mobile-step-values {
  color: rgba(255, 255, 255, 0.9);
}

.mobile-step-card.completed .mobile-step-values {
  color: #475569;
}

.mobile-value {
  white-space: normal; /* Changed from nowrap to normal to allow wrapping */
  overflow: hidden;
  word-wrap: break-word; /* Break long words if necessary */
  word-break: break-word; /* Break long words if necessary */
  max-width: 100%;
  display: block; /* Always visible */
  line-height: 1.4;
}

.mobile-value:empty {
  display: none; /* Hide only when empty */
}

/* Make step 1 values (substeps) look clickable when on step 1 */
.mobile-step-card.active .mobile-value {
  cursor: pointer;
  position: relative;
  transition: opacity 0.2s ease;
}

.mobile-step-card.active .mobile-value:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Arrow between steps */
.mobile-step-arrow {
  flex-shrink: 0;
  color: #cbd5e1;
  font-size: 12px;
  align-self: center; /* Center arrows vertically between cards */
  padding: 0 2px;
}

/* Tablet styles - slightly larger */
@media (min-width: 481px) and (max-width: 1024px) {
  .mobile-step-counter {
    padding: 14px 10px;
  }

  .mobile-step-card {
    min-width: 120px;
    max-width: 160px;
    padding: 5px 5px;
    min-height: 70px; /* Increased min-height for tablet */
  }

  .mobile-step-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .mobile-step-title {
    font-size: 12px;
  }

  .mobile-step-values {
    font-size: 10px;
    gap: 3px; /* More gap on tablet */
  }

  .mobile-value {
    line-height: 1.5;
  }
}

/* Small mobile - more compact */
@media (max-width: 480px) {
  .mobile-step-card {
    min-width: 90px;
    max-width: 120px;
    padding: 6px 8px;
    gap: 6px;
    min-height: 55px; /* Adequate min-height for small mobile */
  }

  .mobile-step-icon {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  .mobile-step-title {
    font-size: 10px;
  }

  .mobile-step-values {
    font-size: 8px;
    gap: 2px;
  }

  .mobile-value {
    line-height: 1.3;
  }
}

/* Desktop - hide mobile step counter */
@media (min-width: 1025px) {
  .mobile-step-counter {
    display: none !important;
  }
}

/* Mobile & Tablet - show mobile step counter */
@media (max-width: 1024px) {
  .mobile-step-counter {
    display: block;
  }
}

/* Animation for step activation */
@keyframes stepPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.mobile-step-card.active {
  animation: stepPulse 0.6s ease-in-out;
}

/* Smooth scroll behavior */
.mobile-steps-scroll {
  scroll-behavior: smooth;
}

/* Reset button container */
.mobile-reset-container {
  text-align: center;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #e9ecef;
}

.mobile-reset-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobile-reset-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.mobile-reset-btn i {
  font-size: 11px;
}
