/* DS Video Editor — crop/trim UI for video uploads */

.ds-video-editor[v-cloak] {
  display: none !important;
}

.ds-video-editor {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: inherit;
}

.ds-video-editor__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.ds-video-editor__icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ds-video-editor__icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ds-video-editor__icon-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.ds-video-editor__title {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.9;
}

.ds-video-editor__confirm-btn {
  min-width: 84px;
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: var(--cl-primary-color, #067aff);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.ds-video-editor__confirm-btn:hover {
  opacity: 0.9;
}

.ds-video-editor__confirm-btn:active {
  transform: scale(0.97);
}

.ds-video-editor__confirm-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.ds-video-editor__stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 0;
}

.ds-video-editor__frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  border-radius: var(--cl-secondary-border-radius, 10px);
  overflow: hidden;
  background: #0d0d0d;
}

.ds-video-editor__frame.ds-ratio-4-5 {
  max-width: 380px;
}

.ds-video-editor__frame.ds-ratio-1-1 {
  max-width: 420px;
}

.ds-video-editor__frame.ds-ratio-original {
  max-width: 100%;
}

.ds-video-editor__crops {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px 4px;
}

.ds-crop-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ds-crop-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.ds-crop-btn.is-active {
  background: var(--cl-primary-color, #067aff);
  border-color: var(--cl-primary-color, #067aff);
  color: #fff;
}

.ds-video-editor__trim {
  flex: 0 0 auto;
  padding: 14px 16px 22px;
}

.ds-trim-track {
  position: relative;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  background: #151515;
  touch-action: none;
}

.ds-trim-track__frames {
  position: absolute;
  inset: 0;
  display: flex;
}

.ds-trim-track__frames img {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.ds-trim-track__dim {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.ds-trim-track__selection {
  position: absolute;
  top: 0;
  bottom: 0;
  border-top: 3px solid var(--cl-primary-color, #067aff);
  border-bottom: 3px solid var(--cl-primary-color, #067aff);
  box-sizing: border-box;
  pointer-events: none;
}

.ds-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  transform: translateX(-50%);
  background: var(--cl-primary-color, #067aff);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  touch-action: none;
}

.ds-trim-handle::after {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
}

.ds-trim-time {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

.ds-editor-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
}

.ds-editor-transport__btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--cl-primary-color, #067aff);
  background: rgb(255 255 255 / 0%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ds-editor-transport__btn:hover {
  background: var(--cl-primary-color, #067aff);
}

.ds-editor-transport__btn:active {
  transform: scale(0.94);
}

.ds-editor-transport__btn svg {
  width: 15px;
  height: 15px;
  fill: #fff !important;
}

.ds-editor-transport__btn--play {
  width: 44px;
  height: 44px;
  /* background: #000000; */
}

.ds-editor-transport__btn--play:hover {
  background: var(--cl-primary-color, #067aff);
  opacity: 0.9;
}

.ds-editor-transport__btn--play svg {
  width: 18px;
  height: 18px;
}

.ds-trim-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transform: translateX(-50%);
  z-index: 2;
}

@media (max-width: 560px) {
  .ds-video-editor__frame.ds-ratio-16-9,
  .ds-video-editor__frame.ds-ratio-4-5,
  .ds-video-editor__frame.ds-ratio-1-1 {
    max-width: 100%;
  }

  .ds-crop-btn {
    padding: 6px 13px;
    font-size: 12px;
  }
}

/* Custom trim-relative progress bar shown on published videos wherever they
   play (feed, thread, compose preview) — replaces Plyr's own progress bar
   for trimmed videos so it reads as a clip of its own trimmed length rather
   than a scrubber spanning the full untrimmed file. */
.ds-play-progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.ds-play-progress__track {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
}

.ds-play-progress__fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  border-radius: 2px;
  background: #fff;
}

.ds-play-progress__time {
  flex: 0 0 auto;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.ds-edit-preview {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 8px;
  cursor: pointer;
  background-color: var(--cl-primary-color, #067aff);
  border-radius: 999px;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  outline: 0;
  z-index: 1000;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ds-edit-preview svg {
  width: 15px;
  height: 15px;
  fill: #ffffff;
  flex: 0 0 auto;
}

.ds-edit-preview span {
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ds-edit-preview:hover {
  opacity: 0.9;
}

.ds-video-editor__processing {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}

.ds-video-editor__processing p {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.ds-video-editor__processing span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.ds-video-editor__spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--cl-primary-color, #067aff);
  animation: ds-spin 0.8s linear infinite;
}

@keyframes ds-spin {
  to {
    transform: rotate(360deg);
  }
}

.ds-video-editor__error-modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ds-video-editor__error-box {
  background: #1c1c1e;
  border-radius: 14px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.ds-video-editor__error-box h4 {
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.ds-video-editor__error-box p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 20px 0;
}

.ds-video-editor__error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-video-editor__error-btn {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ds-video-editor__error-btn--primary {
  background-color: var(--cl-primary-color, #067aff);
  color: #ffffff;
}

.ds-video-editor__error-btn--secondary {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ds-video-editor__error-btn:hover {
  opacity: 0.9;
}

/* Rainbow gradient progress bar, matching high enough specificity to
   override the site's own default solid-colour progress-line styling. */
body div.timeline-pubbox-container form.form div.timeline-pubbox div.timeline-pubbox__progress div.progress-line {
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #f9f871, #47e0a0, #45caff, #a35bff, #ff5f6d);
  background-size: 400% 100%;
  animation: ds-rainbow-flow 3s linear infinite;
}

@keyframes ds-rainbow-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 400% 50%;
  }
}

.ds-progress-wrap {
  position: relative;
}

.ds-status-bubble {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: #1c1c1e;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 999999;
  animation: ds-bubble-float 2.8s ease forwards;
}

.ds-status-bubble--success {
  border: 1px solid #22c55e;
}

.ds-status-bubble--error {
  border: 1px solid #ef4444;
}

@keyframes ds-bubble-float {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px) scale(1.08);
  }
  25% {
    transform: translateX(-50%) translateY(0px) scale(1);
  }
  75% {
    opacity: 1;
    transform: translateX(-50%) translateY(-14px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-32px) scale(0.95);
  }
}




