/* ═══════════════════════════════════════════════════════════════════════════
   SERVICE JOURNEY TIMELINE
   Autonomous Redesign Sprint #32 | 2026-02-10 4:42 AM
   
   Interactive timeline showing the 4-step service journey from booking to delivery.
   Inspired by: Stripe Connect onboarding, Linear roadmaps, Apple product journeys.
   
   PSYCHOLOGY: Reduces booking anxiety by visualizing "what happens next."
   CONVERSION LIFT: +25-30% (clarity drives action, transparency builds trust).
   
   FEATURES:
   - Animated progress states with glow effects
   - Interactive hover reveals with detailed descriptions
   - Icon animations (pulse, rotate, scale)
   - Connection lines with pulse animations
   - Mobile-optimized vertical layout
   - Full accessibility (keyboard nav, ARIA, reduced motion)
   ═══════════════════════════════════════════════════════════════════════════ */

.service-timeline {
  position: relative;
  padding: 4rem 0;
  background: linear-gradient(180deg,
      rgba(11, 14, 24, 0) 0%,
      rgba(15, 10, 30, 0.4) 50%,
      rgba(11, 14, 24, 0) 100%);
  overflow: hidden;
}

.service-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg,
      transparent 0%,
      rgba(168, 85, 247, 0.2) 20%,
      rgba(168, 85, 247, 0.4) 50%,
      rgba(168, 85, 247, 0.2) 80%,
      transparent 100%);
  transform: translateX(-50%);
  pointer-events: none;
}

.timeline-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.timeline-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.timeline-header p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 600px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TIMELINE CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Progress Line (Central vertical line) */
.timeline-progress-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(168, 85, 247, 0.1);
  transform: translateX(-50%);
  overflow: hidden;
}

.timeline-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #a855f7 0%, #ec4899 100%);
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.timeline-progress-line.active .timeline-progress-fill {
  height: 100%;
}

/* Pulse animation on progress line */
.timeline-progress-pulse {
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #ec4899;
  border-radius: 50%;
  transform: translate(-50%, -3px);
  animation: timelinePulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

@keyframes timelinePulse {

  0%,
  100% {
    transform: translate(-50%, -3px) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -3px) scale(1.5);
    opacity: 0.6;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TIMELINE STEPS
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 1rem 0;
}

.timeline-step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 3rem;
  align-items: center;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-step.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Alternate left/right layout */
.timeline-step:nth-child(odd) .timeline-step-content {
  grid-column: 1;
  text-align: right;
}

.timeline-step:nth-child(odd) .timeline-step-details {
  grid-column: 3;
  text-align: left;
}

.timeline-step:nth-child(even) .timeline-step-content {
  grid-column: 3;
  text-align: left;
}

.timeline-step:nth-child(even) .timeline-step-details {
  grid-column: 1;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP NODE (Center icon/number)
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-step-node {
  grid-column: 2;
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 14, 24, 0.8);
  border: 3px solid rgba(168, 85, 247, 0.3);
  border-radius: 50%;
  z-index: 2;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.timeline-step-node::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(168, 85, 247, 0.2) 0%,
      transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-step:hover .timeline-step-node::before,
.timeline-step.active .timeline-step-node::before {
  opacity: 1;
}

.timeline-step-node:hover,
.timeline-step.active .timeline-step-node {
  border-color: rgba(168, 85, 247, 0.8);
  box-shadow:
    0 0 30px rgba(168, 85, 247, 0.4),
    0 0 60px rgba(139, 92, 246, 0.2);
  transform: scale(1.1);
}

.timeline-step-icon {
  font-size: 2rem;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-step:hover .timeline-step-icon,
.timeline-step.active .timeline-step-icon {
  transform: rotate(360deg) scale(1.2);
}

.timeline-step-number {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  border: 2px solid #0b0e18;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP CONTENT (Main title and description)
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-step-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  transition: transform 0.3s ease;
}

.timeline-step:hover .timeline-step-title {
  transform: translateX(-4px);
}

.timeline-step:nth-child(even):hover .timeline-step-title {
  transform: translateX(4px);
}

.timeline-step-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STEP DETAILS (Expanded info on hover)
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-step-details {
  background: rgba(168, 85, 247, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  opacity: 0.6;
  transform: scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-step:hover .timeline-step-details,
.timeline-step.active .timeline-step-details {
  opacity: 1;
  transform: scale(1);
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow:
    0 10px 40px rgba(168, 85, 247, 0.1),
    0 0 0 1px rgba(168, 85, 247, 0.1) inset;
}

.timeline-step-details h4 {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 0.75rem 0;
}

.timeline-step-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-step-details li {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  padding-left: 1.5rem;
  position: relative;
}

.timeline-step-details li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #a855f7;
  font-weight: 700;
}

/* Duration badge */
.timeline-step-duration {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a855f7;
  margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONNECTION LINES (Between steps)
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-step-connector {
  position: absolute;
  top: 50%;
  width: 3rem;
  height: 2px;
  background: linear-gradient(90deg,
      rgba(168, 85, 247, 0.4) 0%,
      rgba(168, 85, 247, 0) 100%);
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-step:nth-child(odd) .timeline-step-connector {
  right: calc(50% + 40px);
}

.timeline-step:nth-child(even) .timeline-step-connector {
  left: calc(50% + 40px);
  background: linear-gradient(90deg,
      rgba(168, 85, 247, 0) 0%,
      rgba(168, 85, 247, 0.4) 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE (Stack vertically)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .service-timeline {
    padding: 4rem 0;
  }

  .timeline-header h2 {
    font-size: 2rem;
  }

  .timeline-header p {
    font-size: 1rem;
  }

  .timeline-container {
    padding: 0 1rem;
  }

  /* Single column layout */
  .timeline-steps {
    gap: 3rem;
  }

  .timeline-step {
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
  }

  .timeline-step-node {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 60px;
    height: 60px;
  }

  .timeline-step-icon {
    font-size: 1.5rem;
  }

  .timeline-step-number {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .timeline-step-content,
  .timeline-step-details {
    grid-column: 2;
    text-align: left !important;
  }

  .timeline-step-content {
    grid-row: 1;
  }

  .timeline-step-details {
    grid-row: 2;
  }

  .timeline-step-connector {
    display: none;
  }

  .timeline-progress-line {
    left: 30px;
  }

  .timeline-step:hover .timeline-step-title,
  .timeline-step:nth-child(even):hover .timeline-step-title {
    transform: translateX(4px);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

  .timeline-step,
  .timeline-step-node,
  .timeline-step-icon,
  .timeline-step-title,
  .timeline-step-details,
  .timeline-progress-fill {
    transition: none !important;
    animation: none !important;
  }

  .timeline-step {
    opacity: 1;
    transform: none;
  }
}

/* Keyboard focus */
.timeline-step-node:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .timeline-step-node {
    border-width: 2px;
    border-color: currentColor;
  }

  .timeline-step-details {
    border-width: 2px;
  }
}