@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --timeline-bg-color: #1f1f1f;
  --track-bg-color: #1f1f1f;
  --track-bg-alt-color: #2f2f2f;
  --track-header-bg-color: #1f1f1f;
  --track-border-color: #4444;
  --time-scale-bg-color: #1f1f1f;
  --tick-color: #888;
  --tick-label-color: #aaa;
  --needle-color: #ff4757;
  /* A bright color for high visibility */
  --needle-head-color: #ff4757;
  --timecode-bg-color: rgba(0, 0, 0, 0.75);
  --timecode-text-color: #ffffff;
  --button-icon-color: #b0b0b0;
  --button-icon-hover-color: #ffffff;
  --button-delete-hover-color: #ff6b81;
  --text-color: #e0e0e0;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --track-height: 60px;
  --time-scale-height: 30px;
  --track-header-width: 150px;
}

.timeline {
  position: relative;
  background-color: var(--timeline-bg-color);
  width: 100% !important;
  max-height: 253px;
  border-radius: 8px;
  color: var(--text-color);
  font-family: var(--font-family);
}

.zbcontainer {
  display: flex;
  flex-direction: row;
  position: relative;
}

.timeline-clip {
  position: absolute;
  top: 4px;
  width: 8px;
  height: 85%;
  background-color: #0011ff;
  border: 1px solid white;
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.timeline-clip.clip-error {
  background-image: repeating-linear-gradient(45deg,
      rgba(255, 0, 0, 0.7),
      rgba(255, 0, 0, 0.7) 10px,
      rgba(180, 0, 0, 0.7) 10px,
      rgba(180, 0, 0, 0.7) 20px) !important;
  border: 1px solid #ff0000;
}

.clip-delete {
  position: absolute;
  top: 0px;
  right: 2px;
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: red;
  color: #fff;
  font-size: 8px;
  cursor: pointer;
  z-index: 4;
}

.clip-controls {
  position: absolute;
  bottom: 0px;
  right: 10px;
  display: flex;
  gap: 2px;
}

.clip-btn {
  background: #44444400;
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
}

.clip-btn:hover {
  background: #ffffff00;
}

.trackHeaders {
  position: sticky;
  left: 0;
  padding-top: 38px;
  width: var(--track-header-width);
  background-color: var(--track-header-bg-color);
  /* border-right: 1px solid var(--track-border-color); */
  display: flex;
  flex-direction: column;
  z-index: 300;
}

.track-label {
  display: flex;
  position: relative;
  align-items: center;
  width: 139px;
  justify-content: space-between;
  height: var(--track-height);
  padding: 0 15px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--track-border-color);
  border-radius: 10px;
  box-sizing: border-box;
  flex-shrink: 0;
  left: 0px;
}

.track-label .button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.track-label .button svg {
  width: 16px;
  height: 16px;
  fill: var(--button-icon-color);
  transition: fill 0.2s ease;
}

.track-label .button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.track-label .button:hover svg {
  fill: var(--button-icon-hover-color);
}

.track-label .track-delete:hover svg {
  fill: var(--button-delete-hover-color);
}

.tracks-container {
  position: relative;
  display: flex;
  flex-direction: column;
  top: 0px;
  left: 0px;
}

.time-scale {
  position: sticky;
  top: 0;
  height: var(--time-scale-height);
  background-color: var(--time-scale-bg-color);
  border: none;
  z-index: 5;
}

.track {
  height: var(--track-height);
  background-color: var(--track-bg-color);
  border: none;
  box-sizing: border-box;
}

.track:nth-child(even) {
  background-color: var(--track-bg-alt-color);
}

.track-content {
  position: relative;
  height: 100%;
  left: 0px;
  background-color: var(--track-bg-color);
  border: 1px solid var(--track-border-color);
  border-radius: 10px;
  box-sizing: border-box;
}

.keyframe-btn.active {
  background-color: #f59e0b;
  border-color: #f59e0b;
}

.keyframe-btn.active svg {
  fill: white;
}

.timeline-clip .keyframe {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background-color: #f59e0b;
  border: 1px solid white;
  z-index: 10;
  cursor: pointer;
}

.timeline-clip .keyframe.selected {
  background-color: #ef4444;
  border: 2px solid white;
  width: 10px;
  height: 10px;
}

.is-dragging-clip {
  cursor: grabbing !important;
}

.clip-resize-handle {
  cursor: ew-resize;
}

.timeline-clip-placeholder {
 position: absolute;
  top: 4px;
  width: 8px;
  height: 85%;
  background-color: #0011ff;
  border: 1px solid white;
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.timeline-clip.is-dragging {
  opacity: 0.6;
  z-index: 15;
  cursor: grabbing;
}

body.is-dragging-clip {
  cursor: grabbing;
}

.needle {
  position: absolute;
  left: 0px;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #ff0000, #bb0101);
  cursor: pointer;
  z-index: 100;
}

.needle-head {
  position: absolute;
  top: 0;
  right: -9px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid #ff4444;
  /* triangle color */
  cursor: pointer;
}

.digital-square {
  position: absolute;
  top: 16px;
  left: 37px;
  transform: translateX(-50%);
  background-color: #00000080;
  color: white;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-clip .clip-resize-handle svg {
  pointer-events: none;
  width: 100%;
  height: auto;
}

.timeline-clip .clip-resize-handle {
  position: absolute;
  top: 10px;
  width: 7px;
  height: 30px;
  z-index: 4;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid white;
}

.timeline-clip .clip-resize-handle-left {
  left: -4px;
  cursor: ew-resize;
}

.timeline-clip .clip-resize-handle-right {
  right: -4px;
  cursor: ew-resize;
}

.timeline-clip .clip-controls {
  padding-right: 5px;
}

.animation-pills-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;
    pointer-events: none;
}

.anim-pill {
    position: absolute;
    top: 0;
    height: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: all;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.anim-pill-in {
    background-color: rgba(45, 82, 139, 0.9); /* Blue */
    border-right: 1px solid rgba(0,0,0,0.4);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    justify-content: flex-start;
}
.anim-pill-in:hover { background-color: #3b82f6; }

.anim-pill-loop {
    background-color: rgba(34, 115, 76, 0.9); /* Green */
    justify-content: center;
}
.anim-pill-loop:hover { background-color: #22c55e; }

.anim-pill-out {
    background-color: rgba(155, 44, 44, 0.9); /* Red */
    border-left: 1px solid rgba(0,0,0,0.4);
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    justify-content: flex-end;
}
.anim-pill-out:hover { background-color: #ef4444; }

.anim-duration-handle {
    position: absolute;
    top: 0;
    height: 100%;
    width: 8px;
    cursor: ew-resize;
    z-index: 10;
}

.anim-duration-handle.handle-in {
    right: 0;
}

.anim-duration-handle.handle-out {
    left: 0;
}

.anim-pill-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%; /* Start at 0 width */
    background-color: rgba(255, 255, 255, 0.3); /* A semi-transparent white */
    border-radius: 4px;
    transition: width 0.05s linear; /* Smooths out tiny jumps */
}

.anim-pill-text {
    position: relative; /* Ensures text is on top of the progress bar */
    z-index: 1;
}

.timeline-clip.is-dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.track-content.drag-over-active {
    background-color: #374151;
    border: 2px dashed #3b82f6;
}

.timeline-clip.drag-over-left::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 10%;
    height: 80%;
    width: 4px;
    background-color: #3b82f6;
    border-radius: 2px;
}

.timeline-clip.drag-over-right::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 10%;
    height: 80%;
    width: 4px;
    background-color: #3b82f6;
    border-radius: 2px;
}

.snap-line {
    position: absolute;
    top: 30px;
    height: calc(100% - 30px);
    width: 1px;
    background-color: #ff4757;
    z-index: 200; 
    pointer-events:none;
};

.transition-indicator {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background-color: rgba(255, 255, 0, 0.4); /* Semi-transparent yellow */
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    box-sizing: border-box;
    pointer-events: none; /* The indicator should not be clickable */
    z-index: 5; /* Position it above the clip background but below text/controls */
    border-top-right-radius: 4px;   /* Match clip's border radius */
    border-bottom-right-radius: 4px;
}