/* Enhanced Interactive Timeline Styles */
.timeline-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0 1rem;
}

.timeline-filter-btn {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.timeline-filter-btn:hover {
  background: #f5f9ff;
  border-color: #3a5db0;
  color: #3a5db0;
  box-shadow: var(--shadow-md);
}

.timeline-filter-btn.active {
  background: #3a5db0;
  border-color: #3a5db0;
  color: white;
  box-shadow: var(--shadow-md);
}

/* Timeline container enhancements */
.timeline-container {
  position: relative;
  margin: 2rem 0;
  perspective: 1000px;
}

/* When filter is active, change timeline layout */
.timeline-container.filter-active .timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Enhanced timeline bar */
.timeline-bar {
  position: absolute;
  left: 20%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #e0e0e0;
  transform-style: preserve-3d;
}

.timeline-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to bottom, #3a5db0, #5ac8fa);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: transform;
}

/* Enhanced timeline markers */
.timeline-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid #3a5db0;
  z-index: 2;
  transition: all 0.3s ease;
}

.timeline-marker.active {
  background: #3a5db0;
  box-shadow: 0 0 0 4px rgba(58, 93, 176, 0.3);
}

/* Enhanced timeline items */
.timeline {
  margin-left: 25%;
  position: relative;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              opacity 0.3s ease;
  opacity: 1;
  transform: translateZ(0);
  cursor: pointer;
  will-change: transform, opacity;
}

.timeline-item:hover {
  transform: translateZ(10px);
  box-shadow: var(--shadow-lg);
}

.timeline-item.filtered-out {
  opacity: 0.3;
  transform: translateX(20px) translateZ(-10px);
  pointer-events: none;
}

.timeline-item.filtered-in {
  opacity: 1;
  transform: translateZ(5px);
  animation: pulse 1s ease;
}

@keyframes pulse {
  0% { box-shadow: var(--shadow-card); }
  50% { box-shadow: 0 0 0 4px rgba(58, 93, 176, 0.2); }
  100% { box-shadow: var(--shadow-card); }
}

/* Timeline item content enhancements */
.timeline-item .exp-card-logo {
  transition: transform 0.3s ease;
}

.timeline-item:hover .exp-card-logo {
  transform: scale(1.05);
}

.timeline-item .exp-card-content h3 {
  transition: color 0.3s ease;
}

.timeline-item:hover .exp-card-content h3 {
  color: #3a5db0;
}

/* Timeline item category tags */
.timeline-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.timeline-category-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  background: #f0f5ff;
  color: #3a5db0;
  font-weight: 500;
}

/* Timeline animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-item {
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(var(--animation-order) * 0.1s);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .timeline-bar {
    left: 10%;
  }
  
  .timeline {
    margin-left: 15%;
    max-width: 80%;
  }
  
  .timeline-filter-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .timeline-item {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }
}
