/* Styles pour la timeline des transactions */
.transaction-timeline {
  position: relative;
  margin: 2rem 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Conteneur principal de la timeline */
.timeline-event {
  display: flex;
  margin-bottom: 1.5rem;
  position: relative;
}

/* Colonne de gauche avec le point et la ligne */
.timeline-event-marker {
  position: relative;
  width: 50px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

/* Ligne verticale qui relie les événements */
.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  transform: translateX(-50%);
}

/* Point sur la timeline */
.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary-color);
  z-index: 2;
  margin-top: 12px;
  position: relative;
}

/* Carte d'événement */
.timeline-card {
  flex-grow: 1;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-left: 15px;
}

/* En-tête de la carte */
.timeline-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 0.75rem 1rem;
}



/* Date */
.timeline-date {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

/* Indicateurs par type d'événement */
.action-indicator {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.action-indicator.creation {
  color: #0d6efd;
}

.action-indicator.validation {
  color: #198754;
}

.action-indicator.rejection {
  color: #dc3545;
}

.action-indicator.modification {
  color: #ffc107;
}

.action-indicator.deposit {
  color: #0dcaf0;
}

.action-indicator.downpayment {
  color: #6c757d;
}

.action-indicator.dispute {
  color: #dc3545;
}

.action-indicator.resolution {
  color: #198754;
}

.action-indicator.completion {
  color: #198754;
}

/* Styles spécifiques pour les différents types d'événements */
.timeline-event.creation .timeline-dot {
  background-color: #1976d2;
  box-shadow: 0 0 0 2px #1976d2;
}

.timeline-event.validation .timeline-dot {
  background-color: #388e3c;
  box-shadow: 0 0 0 2px #388e3c;
}

.timeline-event.rejection .timeline-dot {
  background-color: #d32f2f;
  box-shadow: 0 0 0 2px #d32f2f;
}

.timeline-event.deposit .timeline-dot {
  background-color: #ffa000;
  box-shadow: 0 0 0 2px #ffa000;
}

.timeline-event.dispute .timeline-dot {
  background-color: #e64a19;
  box-shadow: 0 0 0 2px #e64a19;
}

.timeline-event.resolution .timeline-dot {
  background-color: #7b1fa2;
  box-shadow: 0 0 0 2px #7b1fa2;
}

.timeline-event.completion .timeline-dot {
  background-color: #3f51b5;
  box-shadow: 0 0 0 2px #3f51b5;
}

/* Nouveau cycle après rejet */
.timeline-event.new-cycle {
  margin-top: 2rem;
  padding-top: 1rem;
}

.timeline-event.new-cycle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1.25rem;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(to right, #ccc, #ccc 5px, transparent 5px, transparent 10px);
}

/* Badge pour les tentatives multiples */
.timeline-attempt-badge {
  font-size: 0.7rem;
  background: rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
}

/* Texte de l'action */
.timeline-action {
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.timeline-actor {
  font-size: 0.85rem;
  color: #666;
}

/* Détails supplémentaires */
.timeline-details {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #eee;
  font-size: 0.85rem;
}

.timeline-details-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.timeline-details-label {
  color: #666;
}

.timeline-details-value {
  font-weight: 500;
}

/* Loader */
.timeline-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  color: #666;
}

.timeline-loader::after {
  content: '';
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  margin-left: 0.5rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message d'erreur */
.timeline-error {
  padding: 1rem;
  background-color: #ffebee;
  color: #d32f2f;
  border-radius: 0.5rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .timeline-event-marker {
    width: 40px;
  }
  
  .timeline-card {
    margin-left: 10px;
  }
  
  .timeline-date {
    margin-bottom: 0.5rem;
  }
}
