/* ============================================================
   uq.rocks playback queue — styles
   All classes prefixed with .dtq- to avoid collisions.
   Colors mirror uq.rocks tokens (literal so we have no token deps).
   ============================================================ */

.dtq-add-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(11, 11, 18, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  opacity: 0.9;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.dtq-add-icon:hover {
  opacity: 1;
  background: #e94560;
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(233, 69, 96, 0.5);
}
.dtq-add-icon svg { width: 14px; height: 14px; stroke: currentColor; }

/* Floating action button (always visible, bottom-right) */
.dtq-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e94560;
  color: #fff;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.45);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.dtq-fab:hover {
  background: #f25c76;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(233, 69, 96, 0.6);
}
.dtq-fab svg { width: 24px; height: 24px; stroke: currentColor; }
.dtq-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #3dd68c;
  color: #0b1a14;
  font: 600 12px/22px 'Inter', system-ui, -apple-system, sans-serif;
  text-align: center;
  border: 2px solid #0b0b12;
  box-sizing: border-box;
}
.dtq-fab__badge[hidden] { display: none; }

/* Overlay backdrop */
.dtq-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.dtq-overlay.is-open { display: flex; }

/* Panel */
.dtq-panel {
  background: #151522;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  width: 92%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  color: #f4f4f7;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
.dtq-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.dtq-panel__header svg { width: 22px; height: 22px; color: #e94560; }
.dtq-panel__title {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.dtq-panel__close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(244, 244, 247, 0.65);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dtq-panel__close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.dtq-panel__close svg { width: 14px; height: 14px; }

.dtq-count {
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid rgba(233, 69, 96, 0.25);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.dtq-count__num {
  font-size: 28px;
  font-weight: 600;
  color: #e94560;
  line-height: 1;
  margin-bottom: 4px;
}
.dtq-count__label {
  color: rgba(244, 244, 247, 0.65);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* List */
.dtq-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #1d1d2d;
  margin-bottom: 16px;
  min-height: 80px;
}
.dtq-list__empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(244, 244, 247, 0.45);
  font-size: 13px;
}
.dtq-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dtq-row:last-child { border-bottom: none; }
.dtq-row__thumb {
  width: 96px;
  height: 54px;
  border-radius: 8px;
  background: #0b0b12;
  flex-shrink: 0;
  object-fit: cover;
}
.dtq-row__meta {
  flex: 1;
  min-width: 0;
}
.dtq-row__title {
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 2px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.dtq-row__channel {
  font-size: 11px;
  color: rgba(244, 244, 247, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dtq-row__remove {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(244, 244, 247, 0.65);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dtq-row__remove:hover {
  background: rgba(255, 84, 112, 0.12);
  color: #ff5470;
  border-color: rgba(255, 84, 112, 0.3);
}
.dtq-row__remove svg { width: 12px; height: 12px; }

/* Action row */
.dtq-actions {
  display: flex;
  gap: 8px;
}
.dtq-actions button {
  flex: 1;
  padding: 0 14px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.dtq-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.dtq-actions svg { width: 14px; height: 14px; }
.dtq-actions__play { background: #e94560; color: #fff; }
.dtq-actions__play:not([disabled]):hover { background: #f25c76; }
.dtq-actions__clear {
  background: transparent;
  color: #ff5470;
  border-color: rgba(255, 84, 112, 0.3);
}
.dtq-actions__clear:not([disabled]):hover {
  background: rgba(255, 84, 112, 0.12);
  border-color: #ff5470;
  color: #fff;
}

/* Toast */
.dtq-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(21, 21, 34, 0.95);
  color: #f4f4f7;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10001;
  font: 500 14px/1.4 'Inter', system-ui, -apple-system, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  min-width: 200px;
  max-width: 340px;
}
.dtq-toast.is-visible { transform: translateX(0); opacity: 1; }
.dtq-toast--success { border-left: 3px solid #3dd68c; }
.dtq-toast--error   { border-left: 3px solid #ff5470; }
.dtq-toast--info    { border-left: 3px solid #e94560; }

/* Confirm modal */
.dtq-confirm {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dtq-confirm__panel {
  background: #151522;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.dtq-confirm__msg { font-size: 1rem; line-height: 1.5; margin-bottom: 20px; }
.dtq-confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }
.dtq-confirm__actions button {
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}
.dtq-confirm__cancel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
}
.dtq-confirm__ok {
  border: none;
  background: #e94560;
  color: #fff;
}

/* Keyboard focus — drop-in safe even if host page suppresses outlines */
.dtq-fab:focus-visible,
.dtq-add-icon:focus-visible,
.dtq-panel__close:focus-visible,
.dtq-row__remove:focus-visible,
.dtq-actions button:focus-visible,
.dtq-confirm__actions button:focus-visible {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}

/* Queue mode (viewer with ?dtq=1) row states */
.dtq-row { cursor: default; }
.dtq-row--upcoming { cursor: pointer; transition: background 0.15s ease; }
.dtq-row--upcoming:hover { background: rgba(255, 255, 255, 0.04); }
.dtq-row--playing {
  border-left: 3px solid #e94560;
  padding-left: 9px; /* original padding 12 minus the 3px border */
}
.dtq-row__pill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  background: #e94560;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 999px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ============================================================
   Pop Out button (panel action row)
   ============================================================ */
.dtq-actions__popout {
  background: transparent;
  color: #f4f4f7;
  border-color: rgba(255, 255, 255, 0.14);
}
.dtq-actions__popout:not([disabled]):hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   Popout window mode (body.dtq-popout)
   Strips chrome, makes player-page a flex column filling viewport.
   ============================================================ */
body.dtq-popout {
  margin: 0;
  padding: 0;
  background: #0b0b12;
}

body.dtq-popout .player-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  padding: 0;
  max-width: none;
  overflow: hidden;
}

body.dtq-popout .player-wrapper {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
body.dtq-popout .player-embed {
  margin: 0;
  border-radius: 0;
}

body.dtq-popout .video-meta {
  flex: 0 0 auto;
  padding: 8px 12px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
body.dtq-popout .video-meta__title {
  font-size: 14px;
  margin: 0 0 4px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.dtq-popout .video-meta__ad-toggle {
  font-size: 12px;
}

body.dtq-popout #dtq-popout-queue {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 12px;
}
body.dtq-popout #dtq-popout-queue .dtq-list__empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(244, 244, 247, 0.45);
  font-size: 13px;
}

body.dtq-popout #dtq-popout-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0b12;
}
body.dtq-popout #dtq-popout-actions button {
  flex: 1;
  padding: 0 14px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
body.dtq-popout #dtq-popout-actions .dtq-popout-actions__open {
  background: #e94560;
  color: #fff;
}
body.dtq-popout #dtq-popout-actions .dtq-popout-actions__open:hover {
  background: #f25c76;
}
body.dtq-popout #dtq-popout-actions .dtq-popout-actions__close {
  background: transparent;
  color: rgba(244, 244, 247, 0.75);
  border-color: rgba(255, 255, 255, 0.14);
}
body.dtq-popout #dtq-popout-actions .dtq-popout-actions__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Hide chrome and unrelated widgets */
body.dtq-popout .player-nav,
body.dtq-popout .subtitle-bar,
body.dtq-popout .chapter-timeline,
body.dtq-popout .chapters-section,
body.dtq-popout .transcript-overlay,
body.dtq-popout .transcript-panel,
body.dtq-popout .carousel-row,
body.dtq-popout .modal,
body.dtq-popout .video-meta__channel,
body.dtq-popout .video-meta__summary-link,
body.dtq-popout .video-meta__report,
body.dtq-popout .dtq-fab {
  display: none !important;
}

/* ============================================================
   Next button — popup action bar (leftmost) + in-tab viewer
   ============================================================ */
body.dtq-popout #dtq-popout-actions .dtq-popout-actions__next {
  background: transparent;
  color: rgba(244, 244, 247, 0.75);
  border-color: rgba(255, 255, 255, 0.14);
}
body.dtq-popout #dtq-popout-actions .dtq-popout-actions__next:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.dtq-viewer-next {
  background: #e94560;
  color: #fff;
  border: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}
.dtq-viewer-next:hover {
  background: #f25c76;
}
.dtq-viewer-next:focus-visible {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}
