/* =============== TIMELINE STYLES =============== */

.wp-block-group.timeline {
  position: relative;
  max-width: min(1200px, 90vw);
  margin: 0 auto;
  padding: 2rem 0;
  container-type: inline-size;
}

.wp-block-group.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background: linear-gradient(180deg, 
    var(--wp--preset--color--hot-pink) 0%, 
    color-mix(in srgb, var(--wp--preset--color--hot-pink), white 20%) 100%
  );
  border-radius: 3px;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  z-index: -1;
}

.wp-block-group.timeline > .timeline-container {
  position: relative;
  width: 50%;
  padding: 1rem 2.5rem;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(2rem);
  animation: fadeInUp 0.6s ease-out forwards;
}

.timeline-container:nth-child(odd) {
  animation-delay: 0.1s;
}

.timeline-container:nth-child(even) {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-container.left {
  left: 0;
}

.timeline-container.right {
  left: 50%;
}

/* Circles mit modernem Design */
.timeline-container::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  top: 15px;
  background: white;
  border: 4px solid var(--wp--preset--color--hot-pink);
  border-radius: 50%;
  z-index: 1;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--wp--preset--color--hot-pink), transparent 70%);
}

.timeline-container:hover::after {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--wp--preset--color--hot-pink), transparent 90%);
}

.timeline-container.left::after {
  right: -17px;
}

.timeline-container.right::after {
  left: -16px;
}

/* Moderne Arrows mit besserer Performance */
.timeline-container::before {
  content: "";
  position: absolute;
  top: 22px;
  width: 0;
  height: 0;
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-container.left::before {
  right: 30px;
  border: 10px solid transparent;
  border-left-color: white;
}

.timeline-container.right::before {
  left: 30px;
  border: 10px solid transparent;
  border-right-color: white;
}

/* Content box mit modernem Design */
.timeline-content {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  position: relative;
  z-index: 2;
  box-shadow: 
    0 4px 6px -1px color-mix(in srgb, black, transparent 90%),
    0 2px 4px -1px color-mix(in srgb, black, transparent 95%);
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--hot-pink), transparent 85%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-content:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 15px -3px color-mix(in srgb, black, transparent 85%),
    0 4px 6px -2px color-mix(in srgb, black, transparent 90%);
}

.timeline-content h3 {
  color: var(--wp--preset--color--hot-pink);
  margin: 0 0 0.75rem 0;
  font-weight: 600;
}

.timeline-content p {
  margin: 0;
  line-height: 1.6;
  color: color-mix(in srgb, black, transparent 20%);
}

/* Container Queries für bessere Responsivität */
@container (max-width: 768px) {
  .wp-block-group.timeline::after {
    left: 31px;
  }

  .wp-block-group.timeline > .timeline-container {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-container::after {
    left: 15px !important;
    right: auto !important;
  }

  .timeline-container::before {
    left: 60px !important;
    right: auto !important;
    border: 10px solid transparent;
    border-right-color: white !important;
    border-left-color: transparent !important;
  }

  .timeline-container.right {
    left: 0;
  }
}

/* Fallback für Browser ohne Container Queries */
@supports not (container-type: inline-size) {
  @media screen and (max-width: 768px) {
    .wp-block-group.timeline::after {
      left: 31px;
    }

    .wp-block-group.timeline > .timeline-container {
      width: 100%;
      padding-left: 70px;
      padding-right: 25px;
    }

    .timeline-container::after {
      left: 15px !important;
      right: auto !important;
    }

    .timeline-container::before {
      left: 60px !important;
      right: auto !important;
      border: 10px solid transparent;
      border-right-color: white !important;
      border-left-color: transparent !important;
    }

    .timeline-container.right {
      left: 0;
    }
  }
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .timeline-container {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .timeline-container::after,
  .timeline-container::before,
  .timeline-content {
    transition: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .timeline-content {
    background: color-mix(in srgb, white, black 85%);
    border-color: color-mix(in srgb, var(--wp--preset--color--hot-pink), transparent 70%);
  }
  
  .timeline-content p {
    color: color-mix(in srgb, white, transparent 15%);
  }
  
  .wp-block-group.timeline::after {
    background: color-mix(in srgb, white, black 70%);
  }
  
  .timeline-container::after {
    background: color-mix(in srgb, white, black 85%);
  }
  
  .timeline-container::before {
    border-left-color: color-mix(in srgb, white, black 85%);
    border-right-color: color-mix(in srgb, white, black 85%);
  }
}