/* File: public/css/custom/timeline.css | Managed for production maintainability. */
/* timeline.css – version refactored */

.timeline-container {
  position: relative;
}

/* colonne vertébrale */
.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    #9ca3af 0px,
    #9ca3af 8px,
    transparent 8px,
    transparent 14px
  );
}

.dark .timeline-line {
  background: repeating-linear-gradient(
    to bottom,
    #6b7280 0px,
    #6b7280 8px,
    transparent 8px,
    transparent 14px
  );
}

/* progression remplissante */
.timeline-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--timeline-progress, 0%);
  background-color: #0c3f74;
  transition: height 300ms ease;
  z-index: 1;
  pointer-events: none;
}

.dark .timeline-line::after {
  background-color: #93c5fd;
}

/* élément de la timeline */
.timeline-item {
  position: relative;
  display: flex;
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-item.active {
  opacity: 1;
  transform: translateY(0);
}

/* points */
.timeline-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 20px;
  height: 20px;
  background-color: #0c3f74;
  border-radius: 50%;
  border: 2px solid white;
  transform: translate(-50%, 0);
  z-index: 10;
  box-shadow: 0 4px 12px -2px rgba(12, 63, 116, 0.2);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  flex-shrink: 0;
  box-sizing: border-box;
  opacity: 0.5;
  scale: 1;
}

/* alternance de couleurs principales */
.timeline-item:nth-child(2) .timeline-dot,
.timeline-item:nth-child(5) .timeline-dot,
.timeline-item:nth-child(8) .timeline-dot {
  background-color: #1470be;
}

.timeline-item:nth-child(3) .timeline-dot,
.timeline-item:nth-child(6) .timeline-dot,
.timeline-item:nth-child(9) .timeline-dot {
  background-color: #645ac0;
}

.dark .timeline-dot {
  border-color: white;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

.timeline-item.active .timeline-dot {
  opacity: 1;
  transform: translate(-50%, 0) scale(1.3);
  box-shadow: 0 12px 24px -4px rgba(12, 63, 116, 0.3);
}

.dark .timeline-item.active .timeline-dot {
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.4);
}

/* contenu */
.timeline-content {
  transition: transform 300ms ease-out;
}

.timeline-item.active .timeline-content {
  transform: scale(1.02);
}

/* carte */
.timeline-card {
  background-color: theme('colors.coolGray.50');
  border-radius: theme('borderRadius.md');
  padding: 1.5rem;
  box-shadow: theme('boxShadow.md');
  transition: all 300ms ease-out;
  border: 1px solid theme('colors.coolGray.100');
}

.dark .timeline-card {
  background-color: theme('colors.coolGray.800');
  border-color: theme('colors.coolGray.700');
}

.timeline-card:hover {
  box-shadow: theme('boxShadow.lg');
  transform: translateY(-2px);
}

.timeline-card h3 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: theme('colors.coolGray.900');
  margin-bottom: 0.75rem;
}

.dark .timeline-card h3 {
  color: theme('colors.white');
}

.timeline-card p {
  font-size: 1rem;
  line-height: 1.625;
  font-weight: 500;
  color: theme('colors.coolGray.600');
  margin: 0;
}

.dark .timeline-card p {
  color: theme('colors.coolGray.300');
}

.timeline-card p + p {
  margin-top: 0.75rem;
}

/* alternance desktop */
@media (min-width: 768px) {
  .timeline-item:nth-child(odd) {
    flex-direction: row;
  }

  .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
  }

  .timeline-content {
    width: calc(50% - 60px);
  }

  .timeline-item:nth-child(odd) .timeline-content {
    padding-right: 60px;
    text-align: right;
  }

  .timeline-item:nth-child(even) .timeline-content {
    padding-left: 60px;
    text-align: left;
  }
}

/* mobile */
@media (max-width: 767px) {
  .timeline-line {
    left: 20px;
  }

  .timeline-item {
    flex-direction: row;
  }

  .timeline-content {
    width: calc(100% - 80px);
    margin-left: 60px;
  }

  .timeline-dot {
    left: 20px;
    transform: translateX(-50%);
  }
}

/* motion réduit */
@media (prefers-reduced-motion: reduce) {
  .timeline-item,
  .timeline-dot,
  .timeline-content,
  .timeline-card,
  .timeline-line,
  .timeline-line::after {
    transition: none;
    animation: none;
  }

  .timeline-item.active {
    opacity: 1;
    transform: translateY(0);
  }

  .timeline-item.active .timeline-dot {
    scale: 1;
    opacity: 1;
  }
}
