#timeline-container {
  padding: 1.5em;
  margin: 1.5em 0;
}

.timeline-controls {
  margin-bottom: 1.5em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  flex-wrap: wrap;
  gap: 1em;
  font-size: var(--font-md);
}

.timeline-controls label {
  font-size: var(--font-md);
  padding: calc(var(--resp-padding) * 0.5) calc(var(--resp-padding) * 2);
  min-width: fit-content;
}

.form-select {
  font-size: var(--font-md);
}

label[for="timelineColorCategory"] {
  padding: 0;
}

.category-dropdown-container {
  display: flex;
  align-items: center;
  gap: 1em;
}

.node {
  cursor: pointer;
  stroke: white;
  stroke-width: 1px;
}

.link {
  stroke: #999;
  stroke-width: 0.5;
  stroke-opacity: 0.6;
  fill: none;
}

.link:hover,
.highlighted-link {
  stroke: var(--color-accent);
  stroke-opacity: 1;
  stroke-width: 1.5;
}

.blurred {
  stroke-opacity: 0.45;
  opacity: 0.3;
}

.coauthor {
  stroke-dasharray: 10, 10;
}

/* Button styling to match site theme */
.btn-timeline {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  min-width: 10em;
}

/* More specific selectors for Bootstrap's btn-check pattern */
.btn-check:checked + .btn-timeline {
  background-color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  color: white !important;
}

.btn-check:not(:checked) + .btn-timeline {
  background-color: white;
  color: #666;
  border-color: var(--color-accent);
}

.btn-check:not(:checked) + .btn-timeline:hover {
  background-color: #f8e6e6;
  border-color: var(--color-accent);
  color: #666;
}

.btn-check:checked + .btn-timeline:hover {
  background-color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  color: white !important;
}

.btn-check:checked + .btn-timeline:hover {
  background-color: #a37c79;
  border-color: #a37c79;
  color: white;
}

/* Container dimensions */
#timeline-graph-container {
  width: 100%;
  overflow: visible;
  margin-bottom: 1.5em;
  text-align: center;
  align-items: center;
  background: var(--color-gray-light);
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

/* Legend styling */
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
}

.timeline-legend-item {
  display: flex;
  align-items: center;
  font-size: var(--font-md);
}

.timeline-legend-line {
  display: flex;
  align-items: center;
  margin-right: 5px;
}

.custom-control:checked {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e") !important;
}

.custom-control:not(:checked) {
  background-color: white;
  border-color: var(--color-accent-dark);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a37c79'/%3e%3c/svg%3e") !important;
}

/* Graph legend */

#legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 2;
  font-size: var(--font-md);
}

#legend h4 {
  font-size: var(--font-xl);
}

#legendNote {
  font-style: italic;
  font-size: var(--font-sm);
  margin-bottom: 0.5em;
}

#legendItems {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  width: 100%;
  gap: 1em;
}

.legendItem {
  display: flex;
  gap: 0.5em;
  align-items: center;
}

#timelineConnectionsContainer,
.centered-cell {
  text-align: center;
  vertical-align: middle;
  user-select: none;
  font-size: var(--font-md);
}

#timelineConnectionsModal button {
  font-size: var(--font-md);
}

#timelineConnectionsContainer th {
  font-size: var(--font-bg);
}

#timelineConnectionsContainer h5 {
  font-size: var(--font-xl);
}

.node-tooltip {
  position: absolute;
  text-align: left;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 0.5em;
}

.tick text {
  font-size: var(--resp-font-ticks);
}

.node-tooltip p {
  margin: 0;
}

@media (max-width: 750px) {
  #visualization-warning {
    display: flex;
  }

  .tick-line {
    stroke: black;
  }

  .tick-text {
    fill: rgb(33, 37, 41);
  }

  #timeline-container {
    padding: var(--resp-padding);
  }

  .timeline-controls {
    flex-direction: column;
    align-items: start;
  }

  .link {
    stroke-width: 0.5;
  }
}
