/* Container for the entire timeline */
.timeline-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  padding: 2rem 0;
  position: relative;

  /* Hide scrollbar by default, show on hover/scroll */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s ease;
}

.timeline-container:hover,
.timeline-container.active {
  scrollbar-color: var(--pale-green) white;
}
.timeline-container.active {
  cursor: grabbing;
}

/* Wrapper for timeline line and content */
.timeline-wrapper {
  position: relative;
  min-width: max-content;
  padding: 0 2rem;
  min-height: 400px;
  display: flex;
  align-items: center;
}

/* Horizontal timeline line */
.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    currentColor 2rem,
    currentColor calc(100% - 2rem),
    transparent
  );
  opacity: 0.3;
  transform: translateY(-50%);
  z-index: 0;
}

/* Container for timeline items */
.timeline-content {
  display: flex;
  gap: 1rem;
  position: relative;
  width: 100%;
  align-items: center;
  height: 100%;
}

/* Individual timeline item - base styles */
.timeline-item {
  position: relative;
  display: flex;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  flex-shrink: 0;
  align-items: center;
}

.timeline-item-above {
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 170px;
}

.timeline-item-below {
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  margin-top: 170px;
}

/* Connector line between card and timeline dot */
.timeline-connector {
  width: 2px;
  height: 24px;
  background: var(--connector-color, currentColor);
  opacity: 0.3;
  flex-shrink: 0;
}

/* Timeline dot - positioned on the main timeline line */
.timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--tag-1);
  border: 3px solid var(--tag-1);
  border-radius: 50%;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 4px var(--tag-1);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 0 8px var(--tag-1);
}

.timeline-item:hover .timeline-connector {
  opacity: 0.6;
  background: var(--tag-1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Timeline card */
.timeline-card {
  background: var(--card-background, #ffffff);
  border: 1px solid var(--faded-text);
  border-radius: 8px;
  padding: 1.2rem;
  width: 300px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--light-green);
  border-color: var(--light-green);
}

/* Card content */
.timeline-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Role title */
.timeline-role-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
}

/* Company info */
.timeline-company {
  font-size: 0.9em;
  color: var(--faded-text);
}

.timeline-company-link {
  color: var(--faded-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.timeline-company-link:hover {
  color: var(--text);
}

/* Duration */
.timeline-duration {
  font-size: 0.875rem;
  color: var(--faded-text);
  font-variant-numeric: tabular-nums;
}

/* Tech tags container within timeline */
.timeline-card .tech-tags-container {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9em;
}

/* Scrollbar styling - hidden by default, visible on hover/scroll */
.timeline-container::-webkit-scrollbar {
  height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.timeline-container::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.timeline-container:hover::-webkit-scrollbar-track,
.timeline-container.active::-webkit-scrollbar-track {
  background: var(--scrollbar-track, #f3f4f6);
}

.timeline-container:hover::-webkit-scrollbar-thumb,
.timeline-container.active::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, #d1d5db);
}

.timeline-container:hover::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, #9ca3af);
}