/* PNW-FILE-GUIDE
   css/yv-timeline.css — Timeline editor CastFlow (v6.2 / v84).
   HANYA dimuat oleh youthviews.html. Drawer multi-track ala editor video:
   ruler detik, playhead, clip drag/trim/split, popover editor, dan gaya
   output tambahan (transisi, overlay lower-third/logo, countdown, warna/posisi).
*/

/* ================= DRAWER ================= */
.tlDrawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(48vh, 430px);
  z-index: 40;
  display: none;
  flex-direction: column;
  background: #0b0e14;
  border-top: 1px solid #2a3348;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
  font-family: Inter, system-ui, sans-serif;
}
.tlDrawer.on {
  display: flex;
}

/* ---------- toolbar ---------- */
.tlBar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: #111621;
  border-bottom: 1px solid #2a3348;
  user-select: none;
}
.tlBar .tlGroup {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  margin-right: 2px;
  border-right: 1px solid #2a3348;
}
.tlBar .tlGroup:last-child {
  border-right: 0;
}
.tlBtn {
  appearance: none;
  cursor: pointer;
  border: 1px solid #2a3348;
  background: #171d2b;
  color: #dbe6f5;
  border-radius: 8px;
  padding: 5px 10px;
  font: 600 12px/1 Inter, system-ui, sans-serif;
  white-space: nowrap;
}
.tlBtn:hover {
  background: #1f2637;
}
.tlBtn.primary {
  background: #3b9eff;
  border-color: #3b9eff;
  color: #04121f;
}
.tlBtn.danger {
  color: #f87171;
}
.tlBtn.on {
  background: #3b9eff;
  border-color: #3b9eff;
  color: #04121f;
}
.tlBtn:disabled {
  opacity: 0.4;
  cursor: default;
}
.tlTime {
  font: 700 12px/1 "JetBrains Mono", monospace;
  color: #e8edf7;
  padding: 0 6px;
  min-width: 128px;
}
.tlLive {
  display: none;
  font: 800 10px/1 Inter, sans-serif;
  letter-spacing: 0.12em;
  color: #fff;
  background: #b3261e;
  border-radius: 999px;
  padding: 4px 9px;
  animation: tlLivePulse 1.2s ease-in-out infinite;
}
.tlLive.on {
  display: inline-block;
}
@keyframes tlLivePulse {
  50% {
    opacity: 0.55;
  }
}
.tlSelInfo {
  font: 500 11px/1.2 Inter, sans-serif;
  color: #94a3bc;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tlBar select,
.tlBar input[type="text"] {
  background: #0b0e14;
  border: 1px solid #2a3348;
  color: #dbe6f5;
  border-radius: 8px;
  padding: 5px 8px;
  font: 600 12px/1 Inter, sans-serif;
  max-width: 150px;
}
.tlZoom {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tlZoom input[type="range"] {
  width: 90px;
  accent-color: #3b9eff;
}

/* ---------- body ---------- */
.tlBody {
  flex: 1;
  display: flex;
  min-height: 0;
}
.tlHead {
  width: 132px;
  flex: 0 0 132px;
  background: #111621;
  border-right: 1px solid #2a3348;
  padding-top: 22px; /* tinggi ruler */
}
.tlTrackHead {
  height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(42, 51, 72, 0.6);
}
.tlTrackHead.tall {
  height: 60px;
}
.tlTrackHead b {
  font: 800 10px/1 Inter, sans-serif;
  letter-spacing: 0.1em;
  color: #94a3bc;
}
.tlTrackHead span {
  font: 500 10px/1.2 Inter, sans-serif;
  color: #6b7c99;
}
.tlScroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  background: #0b0e14;
}
.tlCanvas {
  position: relative;
  min-width: 100%;
}
.tlRuler {
  position: sticky;
  top: 0;
  height: 22px;
  border-bottom: 1px solid #2a3348;
  background: #0d1117;
  cursor: pointer;
  z-index: 5;
}
.tlTick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #232c3f;
  font: 600 9px/1 "JetBrains Mono", monospace;
  color: #6b7c99;
  padding: 4px 0 0 4px;
  pointer-events: none;
}
.tlTick.major {
  border-left-color: #2a3348;
  color: #94a3bc;
}
.tlTrack {
  position: relative;
  height: 46px;
  border-bottom: 1px solid rgba(42, 51, 72, 0.6);
}
.tlTrack.tall {
  height: 60px;
}
.tlTrack.dropHint {
  background: rgba(59, 158, 255, 0.06);
}

/* ---------- clip ---------- */
.tlClip {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 7px;
  background: #2557d6;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eaf1ff;
  font: 600 10.5px/1.25 Inter, sans-serif;
  padding: 4px 8px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tlClip:active {
  cursor: grabbing;
}
.tlClip small {
  display: block;
  font: 500 9px/1.2 "JetBrains Mono", monospace;
  opacity: 0.75;
}
.tlClip.sel {
  outline: 2px solid #3b9eff;
  outline-offset: 0;
  z-index: 6;
}
.tlClip.tr-bg {
  background: #33405c;
}
.tlClip.tr-media {
  background: #0d5c63;
}
.tlClip.tr-lyrics {
  background: #2557d6;
}
.tlClip.tr-lyrics.cd {
  background: #b45309;
}
.tlClip.tr-overlay {
  background: #6d28d9;
}
.tlClip .tlEdge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 2;
}
.tlClip .tlEdge.l {
  left: 0;
}
.tlClip .tlEdge.r {
  right: 0;
}
.tlClip .tlTrans {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-size: 9px;
  opacity: 0.85;
}
.tlPlayhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f87171;
  z-index: 8;
  pointer-events: none;
}
.tlPlayhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 6px solid transparent;
  border-top: 8px solid #f87171;
}
.tlGhost {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border: 1px dashed #3b9eff;
  border-radius: 7px;
  pointer-events: none;
  z-index: 7;
}

/* ---------- popover editor ---------- */
.tlEditWrap {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(4, 6, 10, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tlEdit {
  width: min(560px, 92vw);
  max-height: 82%;
  overflow: auto;
  background: #171d2b;
  border: 1px solid #2a3348;
  border-radius: 14px;
  padding: 16px;
  color: #e8edf7;
}
.tlEdit h4 {
  margin: 0 0 10px;
  font: 800 13px/1.2 Inter, sans-serif;
  letter-spacing: 0.04em;
}
.tlEdit .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tlEdit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 600 10.5px/1.2 Inter, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3bc;
  flex: 1;
  min-width: 110px;
}
.tlEdit input,
.tlEdit select,
.tlEdit textarea {
  background: #0b0e14;
  border: 1px solid #2a3348;
  color: #e8edf7;
  border-radius: 8px;
  padding: 7px 9px;
  font: 500 13px/1.4 Inter, sans-serif;
}
.tlEdit textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
}
.tlEdit .tlSlides {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.tlEdit .tlSlideRow {
  border: 1px solid #2a3348;
  border-radius: 10px;
  padding: 8px;
}
.tlEdit .tlSlideRow b {
  font: 700 10px/1 Inter, sans-serif;
  color: #6b7c99;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tlEdit .tlBtns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}
.tlSwatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tlSwatches button {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}
.tlSwatches button.on {
  outline: 2px solid #3b9eff;
}

/* ---------- picker (lagu) ---------- */
.tlPickItem {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #2a3348;
  border-radius: 9px;
  margin-bottom: 6px;
  cursor: pointer;
  font: 600 12.5px/1.3 Inter, sans-serif;
}
.tlPickItem:hover {
  background: #1f2637;
}
.tlPickItem small {
  color: #6b7c99;
}

/* ================= OUTPUT: tambahan v84 ================= */
/* warna & posisi per-clip */
#displayScreen {
  --yv-color: #f4f8ff;
}
#displayScreen.yvSlideMode .dispContent .line,
#displayScreen .dispTextLine,
#displayScreen .dispCountdown {
  color: var(--yv-color);
}
#displayScreen.yvPosTop.yvSlideMode .dispStage {
  justify-content: flex-start;
  padding-top: 7vh;
}
#displayScreen.yvPosBottom.yvSlideMode .dispStage {
  justify-content: flex-end;
  padding-bottom: 7vh;
}

/* transisi antar-clip */
.tlAnim-fade {
  animation: tlFadeIn 0.45s ease both;
}
.tlAnim-zoom {
  animation: tlZoomIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tlAnim-slide {
  animation: tlSlideIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes tlFadeIn {
  from {
    opacity: 0;
  }
}
@keyframes tlZoomIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}
@keyframes tlSlideIn {
  from {
    opacity: 0;
    transform: translateY(3.2vh);
  }
}

/* countdown */
#displayScreen .dispCountdown {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: clamp(60px, 18vh, 220px);
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.85);
  font-variant-numeric: tabular-nums;
}

/* overlay: logo + lower-third */
#displayScreen .dispOverlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: none;
}
#displayScreen .dispOverlay.on {
  display: block;
}
.dispOvLogo {
  position: absolute;
  top: 3vh;
  right: 3vw;
  width: clamp(64px, 9vh, 120px);
  opacity: 0.92;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
}
.dispOvLogo img {
  width: 100%;
  display: block;
}
.dispThird {
  position: absolute;
  left: 6vw;
  bottom: 7vh;
  max-width: 60vw;
  background: rgba(8, 10, 16, 0.72);
  border-left: 4px solid #3b9eff;
  border-radius: 0 12px 12px 0;
  padding: 12px 20px;
  backdrop-filter: blur(6px);
  animation: tlSlideIn 0.4s ease both;
}
.dispThird b {
  display: block;
  color: #f4f8ff;
  font: 800 clamp(18px, 3.4vh, 34px) / 1.2 Inter, sans-serif;
}
.dispThird span {
  display: block;
  color: #b9c6dd;
  font: 500 clamp(13px, 2.2vh, 22px) / 1.35 Inter, sans-serif;
  margin-top: 2px;
}

/* HP kecil: drawer lebih tinggi */
@media (max-width: 900px) {
  .tlDrawer {
    height: 62vh;
  }
  .tlHead {
    width: 84px;
    flex-basis: 84px;
  }
  .tlTime {
    min-width: 0;
  }
}
