/* Timeline Styles for Audit History */
.timeline {
  position: relative;
  padding-left: 2rem;
  overflow-x: hidden;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #dee2e6, var(--bs-secondary), #dee2e6);
}

.timeline__item {
  position: relative;
  margin-bottom: 1.5rem;
  width: 100%;
}

.timeline__marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  z-index: 2;
}

.timeline__marker-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem; /* between sm and base — icon marker specific */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 3px solid white;
}

.timeline__content {
  margin-left: 1rem;
  width: calc(100% - 1rem);
  overflow: hidden;
}

.timeline__item:last-child .timeline::before {
  display: none;
}

/* Avatar styles */
.avatar {
  font-weight: bold;
  text-transform: uppercase;
}

/* Change item styles */
.change-item {
  background-color: #f8f9fa;
  border-color: #dee2e6 !important;
  transition: all 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.change-item:hover {
  background-color: #e9ecef;
  border-color: #adb5bd !important;
}

.change-item .badge {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: inline-block;
  flex-shrink: 0;
}

.change-item .d-flex {
  gap: 0.5rem;
}

.change-item .fw-bold {
  flex-shrink: 0;
  min-width: fit-content;
}

/* Timeline & change item responsive adjustments */
@media (max-width: 768px) {
  .timeline {
    padding-left: 1.5rem;
    margin-left: 0;
  }

  .timeline::before {
    left: 0.75rem;
    width: 1px;
  }

  .timeline__marker {
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    z-index: 2;
  }

  .timeline__marker-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: var(--fs-sm);
    border: 2px solid white;
  }

  .timeline__content {
    margin-left: 0.5rem;
    width: calc(100% - 0.5rem);
    display: block;
  }

  .timeline__item {
    position: relative;
    margin-bottom: 1.5rem;
  }

  .timeline__action-badge {
    font-size: var(--fs-sm);
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .timeline__model-badge {
    font-size: var(--fs-sm);
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .change-item {
    padding: 0.75rem !important;
  }

  .change-item .badge {
    font-size: var(--fs-sm);
    line-height: 1.3;
    padding: 0.4rem 0.6rem;
  }

  .change-item .d-flex {
    gap: 0.25rem;
  }

  .change-item .fw-bold {
    font-size: 0.8rem;
  }

  .timeline__content .card {
    margin: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
  }
}

@media (max-width: 576px) {
  .timeline {
    padding-left: 1.25rem;
  }

  .timeline::before {
    left: 0.625rem;
  }

  .timeline__marker {
    left: -1.25rem;
  }

  .timeline__marker-icon {
    width: 1.25rem;
    height: 1.25rem;
    font-size: var(--fs-xs);
  }

  .timeline__content {
    margin-left: 0.25rem;
    width: calc(100% - 0.25rem);
  }

  .timeline__action-badge {
    font-size: var(--fs-xs);
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .timeline__model-badge {
    font-size: var(--fs-xs);
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .change-item {
    padding: 0.5rem !important;
  }

  .change-item .badge {
    font-size: var(--fs-xs);
    line-height: 1.2;
    padding: 0.3rem 0.5rem;
  }

  .change-item .d-flex {
    gap: 0.2rem;
  }

  .change-item .fw-bold {
    font-size: var(--fs-sm);
  }
}
