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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
}

/* Controls Bar */
#controls-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.controls-center {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  justify-content: center;
  max-width: 500px;
}

#controls-bar button {
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #533483;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

#controls-bar button:hover {
  background: #533483;
}

#controls-bar button.playing {
  background: #e74c3c;
  border-color: #c0392b;
}

#time-display {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 16px;
  color: #fff;
  min-width: 120px;
  text-align: center;
}

#progress-bar {
  width: 200px;
  height: 6px;
  background: #0f3460;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

#progress-fill {
  height: 100%;
  background: #533483;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

#speed-select {
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #533483;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
}

label {
  font-size: 13px;
  color: #aaa;
}

/* Column Headers */
#column-headers {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  height: 45px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  background: #16213e;
  z-index: 99;
  border-bottom: 2px solid #0f3460;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Timeline Viewport */
#timeline-viewport {
  position: fixed;
  top: 97px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 149px,
      rgba(255, 255, 255, 0.03) 149px,
      rgba(255, 255, 255, 0.03) 150px
    );
}

#now-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e94560;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

#now-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 12px;
  height: 12px;
  background: #e94560;
  border-radius: 50%;
}

#now-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: -5px;
  width: 12px;
  height: 12px;
  background: #e94560;
  border-radius: 50%;
}

#timeline-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  will-change: transform;
}

.column {
  position: relative;
  min-height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.column:last-child {
  border-right: none;
}

/* Time markers on left side */
.time-marker {
  position: absolute;
  left: -60px;
  width: 55px;
  text-align: right;
  font-size: 11px;
  color: #666;
  font-family: "SF Mono", monospace;
  transform: translateY(-50%);
}

/* Event Cards */
.event-card {
  position: absolute;
  left: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-left: 3px solid #666;
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
  cursor: default;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.event-card.visible {
  opacity: 1;
  transform: translateX(0);
}

.event-card.has-media {
  cursor: pointer;
}

.event-card.has-media:hover {
  background: rgba(255, 255, 255, 0.14);
}

.event-card .event-time {
  font-size: 11px;
  color: #888;
  font-family: "SF Mono", monospace;
  margin-bottom: 4px;
}

.event-card .event-text {
  font-size: 14px;
  line-height: 1.4;
}

.event-card .event-thumbnail {
  margin-top: 8px;
  max-width: 100%;
  max-height: 80px;
  border-radius: 4px;
  object-fit: cover;
}

.event-card .video-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: #e94560;
  background: rgba(233, 69, 96, 0.15);
  padding: 3px 8px;
  border-radius: 3px;
}

/* Media Overlay */
#media-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#media-overlay.hidden {
  display: none;
}

#overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

#overlay-content {
  position: relative;
  width: 85vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#overlay-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 201;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#overlay-close:hover {
  color: #e94560;
}

#overlay-media img {
  max-width: 85vw;
  max-height: 70vh;
  border-radius: 8px;
}

#overlay-media video {
  max-width: 85vw;
  max-height: 70vh;
  border-radius: 8px;
  background: #000;
}

#overlay-text {
  color: #fff;
  font-size: 18px;
  text-align: center;
  max-width: 700px;
  line-height: 1.5;
}

/* Scrollbar hide */
#timeline-viewport::-webkit-scrollbar {
  display: none;
}
