/* Timeline CSS */
:root {
  --timeline-track-color: #333333;
  --timeline-dot-color: #b71c1c;
  --timeline-dot-hover-color: #8a1616;
  --event-bg-color: #fff;
  --event-hover-bg-color: #f9f9f9;
  --event-title-color: #b71c1c;
  --tooltip-bg-color: rgba(35, 35, 35, 0.97);
  --tooltip-border-color: #ffd600;
  --tooltip-text-color: #ffd600;
  --language-link-color: #b71c1c;
  --language-link-active-color: #ffd600;
  --language-link-hover-color: #b71c1c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f9f9f9;
  color: #232323;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  font-size: 2rem;
  color: #b71c1c;
  text-align: center;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.2rem;
  color: #333;
  text-align: center;
  margin-bottom: 2rem;
  font-weight: normal;
}

.timeline-container {
  position: relative;
  margin: 40px 0;
  overflow: visible;
}

.timeline-track {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--timeline-track-color);
  z-index: 1;
}

.timeline {
  position: relative;
  padding-top: 50px;
  z-index: 2;
}

.timeline-event {
  position: relative;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.3s ease;
}

.timeline-event:hover {
  transform: translateY(-5px);
  z-index: 100;
}

.timeline-date {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
  background-color: #fff;
  display: inline-block;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--timeline-dot-color);
  margin: 0 auto 15px;
  position: relative;
  z-index: 2;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.timeline-content {
  background-color: var(--event-bg-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(35,35,35,0.07);
  position: relative;
  z-index: 2;
  transition: background-color 0.3s ease;
  height: 100%;
}

.timeline-title {
  color: var(--event-title-color);
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.timeline-snippet {
  font-size: 0.9em;
  color: #333;
}

/* Multi-column tooltip styles */
.timeline-tooltip {
  position: absolute;
  top: calc(100% - 20px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background-color: var(--tooltip-bg-color);
  border: 1px solid var(--tooltip-border-color);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 5px 15px rgba(35,35,35,0.3);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s;
  font-size: 0.85em;
  margin-top: 15px;
  color: var(--tooltip-text-color);
  pointer-events: none;
}

.timeline-tooltip::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--tooltip-border-color) transparent;
}

.timeline-tooltip::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 7px 7px 7px;
  border-style: solid;
  border-color: transparent transparent var(--tooltip-bg-color) transparent;
}

.timeline-tooltip a {
  color: #ffd600;
  text-decoration: none;
  font-weight: bold;
}

.timeline-tooltip a:hover {
  text-decoration: underline;
  color: #fff;
}

.tooltip-help {
  font-style: italic;
  font-size: 0.9em;
  color: #ffd600;
  margin-top: 10px;
}

.timeline-event:hover .timeline-dot {
  background-color: var(--timeline-dot-hover-color);
  transform: scale(1.2);
}

.timeline-event:hover .timeline-content {
  background-color: var(--event-hover-bg-color);
}

/* Show tooltip on hover in multi-column mode only */
.timeline-event:hover .timeline-tooltip,
.timeline-tooltip:hover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.language-link {
  text-decoration: none;
  color: var(--language-link-color);
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.language-link:hover {
  background-color: #ffd600;
  color: #b71c1c;
}

.language-link.active {
  color: var(--language-link-active-color);
  font-weight: bold;
}

/* Medium devices and below */
@media (max-width: 991px) {
  .timeline-content {
    min-height: 150px;
  }
  
  .timeline-tooltip {
    width: 250px;
  }
  
  .timeline-date {
    font-size: 0.9em;
    padding: 4px 8px;
  }
}

/* ==========================================
   SINGLE COLUMN MODE STYLES
   ========================================== */

/* Vertical timeline for single column mode */
body.single-column-mode .timeline-track {
  width: 4px;
  height: 100%;
  left: 30px;
  top: 0;
  bottom: 0;
}

body.single-column-mode .timeline {
  padding-top: 0;
  padding-left: 50px;
}

body.single-column-mode .timeline-date {
  margin-left: 0;
  margin-bottom: 5px;
  font-size: 0.9em;
}

body.single-column-mode .timeline-dot {
  position: absolute;
  left: -44px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

body.single-column-mode .timeline-content {
  margin-bottom: 30px;
  position: relative;
  transition: background-color 0.3s;
}

/* Tooltip for mobile/single column view */
body.single-column-mode .timeline-tooltip {
  position: static;
  visibility: hidden;
  opacity: 0;
  transform: none;
  width: 100%;
  margin-top: 15px;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, opacity 0.3s, visibility 0.3s, margin 0.3s;
}

/* Remove arrow in single column mode since tooltip is below content */
body.single-column-mode .timeline-tooltip::before,
body.single-column-mode .timeline-tooltip::after {
  display: none;
}

/* Show tooltip when event is active in single column mode */
body.single-column-mode .timeline-event.active .timeline-tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  max-height: 800px;
  overflow: visible;
  margin-bottom: 15px;
}

/* Arrow to indicate expandable content */
body.single-column-mode .timeline-content::after {
  content: '▼';
  position: absolute;
  right: 15px;
  bottom: 15px;
  font-size: 0.8em;
  color: #999;
  transition: transform 0.3s;
}

body.single-column-mode .timeline-event.active .timeline-content::after {
  transform: rotate(180deg);
}

/* Disable hover effects in single column mode */
body.single-column-mode .timeline-event:hover {
  transform: none;
}

/* Don't show tooltip on hover in single column mode */
body.single-column-mode .timeline-event:hover .timeline-tooltip {
  visibility: hidden;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Only show tooltip on active events */
body.single-column-mode .timeline-event.active:hover .timeline-tooltip {
  visibility: visible;
  opacity: 1;
  max-height: 800px;
  overflow: visible;
  pointer-events: auto;
}

/* Remove tooltip arrows in single column mode */
body.single-column-mode .timeline-tooltip::before,
body.single-column-mode .timeline-tooltip::after {
  display: none;
}

/* Extra small devices */
@media (max-width: 575px) {
  .timeline-content {
    padding: 15px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
}
