/* ─── TRACK ORDER PAGE STYLES ─── */

.track-section {
  padding: 160px 20px 100px;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.track-header {
  text-align: center;
  margin-bottom: 60px;
}

.track-header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.1;
}

.track-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Track Search Form */
.track-form-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.track-form-container.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  position: absolute;
}

.track-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.track-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.track-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 102, 241, 0.2);
}

.btn-track {
  margin-top: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-track:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(168, 85, 247, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.track-error {
  color: #ef4444;
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.track-error.active {
  opacity: 1;
}

/* Tracking Results View */
.track-results {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(40px);
  position: absolute;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.track-results.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  position: relative;
}

/* Order Info Card */
.order-info-card {
  padding: 32px 40px;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.order-detail-group h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  font-weight: 600;
}

.order-detail-group p {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}

.order-detail-group .highlight {
  color: var(--primary);
  background: -webkit-linear-gradient(45deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Timeline */
.timeline-wrapper {
  padding: 40px;
}

.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 40px;
}

/* The background connecting line */
.timeline::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  z-index: 0;
}

/* The active progress line */
.timeline-progress {
  position: absolute;
  top: 24px;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 2px;
  z-index: 1;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
}

/* Individual Stage Nodes */
.timeline-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  text-align: center;
}

.stage-dot {
  width: 52px;
  height: 52px;
  background: var(--bg);
  border: 4px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  color: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.stage-dot svg {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

.timeline-stage.completed .stage-dot {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.5);
}

.timeline-stage.active .stage-dot {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4), inset 0 0 10px rgba(6, 182, 212, 0.2);
  animation: pulse-border 2s infinite;
}

.timeline-stage.active .stage-dot svg {
  transform: scale(1.1);
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.5), inset 0 0 10px rgba(6, 182, 212, 0.2); }
  70% { box-shadow: 0 0 0 15px rgba(6, 182, 212, 0), inset 0 0 10px rgba(6, 182, 212, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0), inset 0 0 10px rgba(6, 182, 212, 0.2); }
}

.stage-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.timeline-stage.completed .stage-label,
.timeline-stage.active .stage-label {
  color: var(--text);
}

.reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  display: block;
  margin: 0 auto;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* Responsive Timeline */
@media (max-width: 768px) {
  .timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .timeline::before {
    top: 0;
    bottom: 0;
    left: 24px;
    width: 4px;
    height: auto;
  }

  .timeline-progress {
    top: 0;
    left: 24px;
    width: 4px;
    height: 0;
    transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .timeline-stage {
    flex-direction: row;
    width: 100%;
    text-align: left;
    gap: 24px;
  }

  .stage-dot {
    margin-bottom: 0;
    width: 48px;
    height: 48px;
  }
}
