.timeline-alt-main {
  background: var(--bg);
  height: calc(100vh - 140px); /* Fill the viewport exactly */
  min-height: 600px;
  width: 100%;
  overflow: hidden;
}

.timeline-alt-shell {
  display: grid;
  grid-template-columns: 450px 1fr;
  height: 100%;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}

/* SIDEBAR ON LEFT */
.timeline-alt-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--grid);
  background: var(--bg);
  min-width: 0;
  min-height: 0; /* CRITICAL FOR FLEX SCROLLING IN GRID */
}

.timeline-alt-controls {
  padding: 30px;
  border-bottom: 1px solid var(--grid);
  background: #050505;
  flex-shrink: 0;
}

.timeline-alt-counts {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 13px;
  text-transform: uppercase;
}

.timeline-alt-event-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
}

/* Scrollbar styles for timeline lists */
.timeline-alt-event-list::-webkit-scrollbar,
.timeline-alt-preview::-webkit-scrollbar {
  width: 8px;
}

.timeline-alt-event-list::-webkit-scrollbar-track,
.timeline-alt-preview::-webkit-scrollbar-track {
  background: #050505;
  border-left: 1px solid var(--grid);
}

.timeline-alt-event-list::-webkit-scrollbar-thumb,
.timeline-alt-preview::-webkit-scrollbar-thumb {
  background: #333;
  border: 1px solid #050505;
}

.timeline-alt-event-list::-webkit-scrollbar-thumb:hover,
.timeline-alt-preview::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.alt-event-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--grid);
  padding: 20px 30px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-main);
}

.alt-event-row:hover { background: #111; }
.alt-event-row.active {
  border-left: 6px solid var(--accent);
  background: rgba(255, 42, 42, 0.05);
}

.alt-event-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #111;
}

.alt-event-date-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-data);
  font-size: 12px;
}

.alt-event-title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  text-transform: uppercase;
}

/* CONTENT PANEL ON RIGHT */
.timeline-alt-content-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.timeline-alt-map-panel {
  flex: 1;
  min-height: 0;
  background: #000;
  position: relative;
  border-bottom: 1px solid var(--grid);
}

.timeline-alt-map-frame {
  width: 100%;
  height: 100%;
  position: relative;
}

.timeline-alt-map {
  width: 100%;
  height: 100%;
}

.timeline-alt-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ensure map circles are visible */
.timeline-alt-map circle {
  fill: #333;
  transition: fill 0.2s, stroke 0.2s;
}

.timeline-alt-map circle.map-country-active-alt {
  fill: var(--accent);
  opacity: 0.6;
}

.timeline-alt-map circle.map-dot-active-alt {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 1.5;
  opacity: 1;
}

.map-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-data);
  color: var(--text-muted);
  z-index: 100;
  pointer-events: none;
}

/* PREVIEW BELOW MAP */
.timeline-alt-preview {
  height: 350px;
  background: #080808;
  padding: 40px;
  overflow-y: auto;
  flex-shrink: 0;
}

.timeline-alt-preview-full {
  height: 100%;
}

.timeline-alt-preview .timeline-event-title {
  font-size: 36px;
  font-weight: 700;
  margin: 10px 0;
  text-transform: uppercase;
}

.timeline-alt-preview .timeline-event-description {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .timeline-alt-main { height: auto; overflow: visible; }
  .timeline-alt-shell { grid-template-columns: 1fr; height: auto; }
  .timeline-alt-sidebar { height: 600px; border-right: none; }
  .timeline-alt-map-panel { height: 450px; }
  .timeline-alt-preview { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .alt-event-row,
  .timeline-alt-map circle {
    transition: none !important;
  }
}
