.timeline-wrapper {
  padding: 1rem;
}

.timeline {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* WICHTIG: Clearfix für Center-Layout */
.timeline-wrapper--vertical-center {
  overflow: hidden;
}

.timeline-wrapper--vertical-center .timeline::after {
  content: '';
  display: table;
  clear: both;
}

/* ========================================
   VERTICAL LEFT LAYOUT (Standard)
   ======================================== */
.timeline-wrapper--vertical-left .timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
  var(--bs-primary, #007bff) 0%,
  var(--bs-primary, #007bff) 100%);
}

.timeline-wrapper--vertical-left .timeline-item {
  position: relative;
  padding-left: 80px;
  padding-bottom: 3rem;
}

.timeline-wrapper--vertical-left .timeline-marker {
  position: absolute;
  left: 0;
  top: 0;
}

/* ========================================
   VERTICAL CENTER LAYOUT (Abwechselnd)
   ======================================== */
.timeline-wrapper--vertical-center .timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
  var(--bs-primary, #007bff) 0%,
  var(--bs-primary, #007bff) 100%);
}

.timeline-wrapper--vertical-center .timeline-item {
  position: relative;
  padding-bottom: 3rem;
  width: 50%;
  clear: both;
}

.timeline-wrapper--vertical-center .timeline-item--left {
  float: left;
  padding-right: 60px;
  text-align: right;
}

.timeline-wrapper--vertical-center .timeline-item--right {
  float: right;
  padding-left: 60px;
  text-align: left;
}

.timeline-wrapper--vertical-center .timeline-marker {
  position: absolute;
  top: 0;
}

.timeline-wrapper--vertical-center .timeline-item--left .timeline-marker {
  right: -21px;
}

.timeline-wrapper--vertical-center .timeline-item--right .timeline-marker {
  left: -21px;
}

.timeline-wrapper--vertical-center .timeline-item--left .timeline-content {
  text-align: left;
}

.timeline-wrapper--vertical-center .timeline-item--right .timeline-content {
  text-align: left;
}

/* ========================================
   VERTICAL RIGHT LAYOUT
   ======================================== */
.timeline-wrapper--vertical-right .timeline::before {
  content: '';
  position: absolute;
  right: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
  var(--bs-primary, #007bff) 0%,
  var(--bs-primary, #007bff) 100%);
}

.timeline-wrapper--vertical-right .timeline-item {
  position: relative;
  padding-right: 80px;
  padding-bottom: 3rem;
  text-align: right;
}

.timeline-wrapper--vertical-right .timeline-marker {
  position: absolute;
  right: 0;
  top: 0;
}

.timeline-wrapper--vertical-right .timeline-content {
  text-align: left;
}

/* ========================================
   HORIZONTAL LAYOUT (Desktop / Tablet)
   ======================================== */
.timeline-wrapper--horizontal {
  position: relative;
  padding: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;              /* Firefox: Scrollbar verstecken */
}

.timeline-wrapper--horizontal::-webkit-scrollbar {
  display: none;                      /* Chrome, Safari, Edge: Scrollbar verstecken */
}

.timeline-wrapper--horizontal .timeline {
  display: flex;
  flex-direction: row;
  min-width: min-content;
  padding: 0 40px 0 0;  /* rechts 40px Luft */
  position: relative;
  cursor: grab;
}

.timeline-wrapper--horizontal.is-dragging .timeline {
  cursor: grabbing;
  user-select: none;
}

.timeline-wrapper--horizontal .timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: linear-gradient(to right,
  var(--bs-primary, #007bff) 0%,
  var(--bs-primary, #007bff) 100%);
}

.timeline-wrapper--horizontal .timeline-item {
  position: relative;
  flex: 0 0 auto;
  width: 350px;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content:center;
}

.timeline-wrapper--horizontal .timeline-item:first-child {
  padding-left: 0;
}

.timeline-wrapper--horizontal .timeline-item:last-child {
  padding-right: 0;
}

.timeline-wrapper--horizontal .timeline-marker {
  position: relative;
  z-index: 10;
  order: 2;
  margin: 1rem 0;
}

.timeline-wrapper--horizontal .timeline-content {
  order: 1;
  width: 100%;
  margin-bottom: 1rem;
}

/* Nur Pfeil-Hint rechts (kein Gradient) */
.timeline-wrapper--horizontal::after {
  content: none;
}

.timeline-wrapper--horizontal::before {
  content: '➜';
  position: absolute;
  right: 16px;              /* im Wrapper, nicht draußen */
  top: 3%;                 /* oberes Drittel statt ganz oben/zentriert */
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: rgba(var(--bs-body-color-rgb), 0.45); /* dark-mode safe */
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.timeline-wrapper--horizontal.has-more-right::before {
  opacity: 1;
  animation: timeline-arrow-pulse 1.2s ease-in-out infinite;
}

@keyframes timeline-arrow-pulse {
  0%   { transform: translate(0, -50%); opacity: 0.3; }
  50%  { transform: translate(6px, -50%); opacity: 0.9; }
  100% { transform: translate(0, -50%); opacity: 0.3; }
}


/* ========================================
   TIMELINE ITEM ANIMATIONS
   ======================================== */
.timeline-item {
  animation: fadeInUp 0.6s ease-out backwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }

.timeline-item:last-child {
  padding-bottom: 0;
}

/* ========================================
   TIMELINE DOT & ICON
   ======================================== */
.timeline-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bs-body-bg); /* statt #fff */
  border: 3px solid var(--bs-primary, #007bff);
  box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.12); /* statt rgba(0,123,255,...) */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 8px rgba(var(--bs-primary-rgb), 0.18); /* statt rgba(0,123,255,...) */
}

.timeline-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-primary, #007bff);
  position: absolute;
  top: 0;
  left: 0;
}

.timeline-icon svg,
.timeline-icon i {
  width: 20px;
  height: 20px;
  font-size: 20px;
  display: block;
  margin: auto;
}

.timeline-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.timeline-item--highlight .timeline-dot {
  background: var(--bs-primary, #007bff);
  border-color: var(--bs-primary, #007bff);
  box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.25); /* statt rgba(0,123,255,...) */
}

.timeline-item--highlight .timeline-icon {
  color: #fff; /* bewusst weiß: Kontrast auf primary */
}

/* ========================================
   TIMELINE CONTENT
   ======================================== */
.timeline-content {
  background: var(--bs-body-bg); /* statt #fff */
  color: var(--bs-body-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(var(--bs-body-color-rgb), 0.10); /* statt rgba(0,0,0,...) */
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
  box-shadow: 0 4px 16px rgba(var(--bs-body-color-rgb), 0.16); /* statt rgba(0,0,0,...) */
  transform: translateY(-2px);
}

.timeline-date {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.timeline-date__date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-primary, #007bff);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-date__time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bs-secondary, #6c757d);
}

.timeline-image {
  margin-bottom: 1rem;
  border-radius: 6px;
  overflow: hidden;
}

.timeline-image img {
  width: 100%;
  height: auto;
  display: block;
}

.timeline-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--bs-body-color); /* statt var(--bs-dark, #212529) */
}

.timeline-description {
  color: var(--bs-body-color, #6c757d);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.timeline-description:last-child {
  margin-bottom: 0;
}

.timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--bs-primary, #007bff);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.timeline-link:hover {
  background: var(--bs-primary-dark, #0056b3);
  color: #fff;
  transform: translateX(4px);
}

.timeline-link::after {
  content: '→';
  font-size: 1.2em;
  transition: transform 0.3s ease;
}

.timeline-link:hover::after {
  transform: translateX(4px);
}

/* ========================================
   DATE MARKER (Nur Datum/Zeit)
   ======================================== */
.timeline-item--date-marker {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100% !important;
  text-align: center;
  float: none !important;
  clear: both;
}

.timeline-item--date-marker .timeline-marker {
  display: none;
}

.timeline-date-marker {
  display: inline-block;
  background: var(--bs-body-bg); /* statt #fff */
  color: var(--bs-body-color);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  border: 2px solid var(--bs-primary, #007bff);
  box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.22); /* statt rgba(0,123,255,...) */
  position: relative;
  z-index: 10;
}

.timeline-date-marker time {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  white-space: nowrap;
}

.timeline-date-marker__date {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--bs-primary, #007bff);
  letter-spacing: 0.3px;
}

.timeline-date-marker__time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bs-secondary, #6c757d);
}

/* Center Layout - Date Marker immer mittig */
.timeline-wrapper--vertical-center .timeline-item--date-marker {
  width: 100% !important;
  text-align: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Left Layout - Date Marker links versetzt */
.timeline-wrapper--vertical-left .timeline-item--date-marker {
  text-align: left;
  padding-left: 0 !important;
}

.timeline-wrapper--vertical-left .timeline-date-marker {
  margin-left: 10px;
}

/* Right Layout - Date Marker rechts versetzt */
.timeline-wrapper--vertical-right .timeline-item--date-marker {
  text-align: right;
  padding-right: 0 !important;
}

.timeline-wrapper--vertical-right .timeline-date-marker {
  margin-right: 10px;
}

/* Horizontal Layout - Date Marker */
.timeline-wrapper--horizontal .timeline-item--date-marker {
  width: auto !important;
  min-width: 120px;
  padding: 0 1.5rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timeline-wrapper--horizontal .timeline-item--date-marker .timeline-marker {
  display: none !important;
}

.timeline-wrapper--horizontal .timeline-date-marker {
  margin: 0;
  position: relative;
  top: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Kein Icon → kein Kreis/Dot anzeigen */
.timeline-item--no-icon .timeline-marker {
  display: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
  /* Center Layout wird zu Left Layout */
  .timeline-wrapper--vertical-center .timeline::before {
    left: 20px;
    transform: none;
  }

  .timeline-wrapper--vertical-center .timeline-item {
    width: 100%;
    float: none;
    padding-left: 80px;
    padding-right: 0;
    text-align: left;
  }

  .timeline-wrapper--vertical-center .timeline-item--left .timeline-marker,
  .timeline-wrapper--vertical-center .timeline-item--right .timeline-marker {
    left: 0;
    right: auto;
  }

  /* Date Marker auf Mobile */
  .timeline-wrapper--vertical-center .timeline-item--date-marker {
    text-align: left;
    padding-left: 0 !important;
  }

  .timeline-wrapper--vertical-center .timeline-date-marker {
    margin-left: 10px;
  }

  /* Horizontal bleibt horizontal auf Tablet */
  .timeline-wrapper--horizontal .timeline-item {
    width: 240px;
  }
}

/* ========================================
   MOBILE: horizontales Layout wird vertikal
   ======================================== */
@media (max-width: 768px) {
  .timeline::before {
    left: 15px !important;
    right: auto !important;
  }

  .timeline-item,
  .timeline-wrapper--vertical-left .timeline-item,
  .timeline-wrapper--vertical-right .timeline-item,
  .timeline-wrapper--vertical-center .timeline-item {
    padding-left: 60px !important;
    padding-right: 0 !important;
    text-align: left !important;
    width: 100% !important;
    float: none !important;
  }

  .timeline-marker,
  .timeline-wrapper--vertical-right .timeline-marker,
  .timeline-wrapper--vertical-center .timeline-marker {
    left: 0 !important;
    right: auto !important;
  }

  .timeline-dot {
    width: 32px;
    height: 32px;
  }

  .timeline-icon svg,
  .timeline-icon i {
    width: 16px;
    height: 16px;
    font-size: 16px;
  }

  .timeline-content {
    padding: 1rem;
  }

  .timeline-title {
    font-size: 1.25rem;
  }

  /* Date Marker Mobile */
  .timeline-item--date-marker,
  .timeline-wrapper--vertical-left .timeline-item--date-marker,
  .timeline-wrapper--vertical-right .timeline-item--date-marker,
  .timeline-wrapper--vertical-center .timeline-item--date-marker {
    text-align: left !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .timeline-date-marker {
    padding: 0.4rem 1rem;
    margin-left: 5px !important;
    margin-right: 0 !important;
  }

  .timeline-date-marker time {
    gap: 0.5rem;
  }

  .timeline-date-marker__date {
    font-size: 0.8rem;
  }

  .timeline-date-marker__time {
    font-size: 0.7rem;
  }

  /* Horizontal → vertikal umbiegen */
  .timeline-wrapper--horizontal {
    overflow-x: hidden;
    overflow-y: visible;
  }

  .timeline-wrapper--horizontal .timeline {
    display: block;
    padding: 0;
    cursor: auto;
  }

  .timeline-wrapper--horizontal .timeline::before {
    left: 15px;
    right: auto;
    top: 0;
    bottom: 0;
    transform: none;
  }

  .timeline-wrapper--horizontal .timeline-item {
    width: 100% !important;
    padding: 0 0 3rem 60px !important;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .timeline-wrapper--horizontal .timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    order: 0;
  }

  .timeline-wrapper--horizontal .timeline-content {
    order: 0;
    width: 100%;
    margin-bottom: 0;
  }

  .timeline-wrapper--horizontal::before {
    display: none; /* Hint auf Mobile ausblenden */
  }
}
