/* Enhanced Video: playlist mode. The player itself is styled by style.css. */

.webtron-ev-playlist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ev-pl-sidebar-width, 320px);
  gap: 0;
  width: 100%;
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--ev-border-radius, 8px);
  overflow: hidden;
  background: var(--ev-pl-sidebar-bg, #1a1a1a);
}

.webtron-ev-playlist.layout-sidebar-left {
  grid-template-columns: var(--ev-pl-sidebar-width, 320px) minmax(0, 1fr);
}
.webtron-ev-playlist.layout-sidebar-left .webtron-ev-pl-sidebar {
  order: -1;
}
.webtron-ev-playlist.layout-sidebar-bottom,
.webtron-ev-playlist.layout-no-sidebar {
  display: flex;
  flex-direction: column;
}
/* Beside the video the list takes the player's height and scrolls inside it; without this the
   list's own length would stretch the row. */
.webtron-ev-playlist.layout-sidebar-right .webtron-ev-pl-sidebar,
.webtron-ev-playlist.layout-sidebar-left .webtron-ev-pl-sidebar {
  height: 0;
  min-height: 100%;
}
.webtron-ev-playlist.layout-sidebar-bottom .webtron-ev-pl-sidebar {
  max-height: 300px;
}

.webtron-ev-pl-main {
  min-width: 0;
  background: #0f1216;
}
.webtron-ev-pl-main > .webtron-enhanced-video {
  margin: 0;
  --ev-border-radius: 0px;
}

.webtron-ev-pl-info {
  padding: 14px 18px;
  color: #e8ebf0;
}
.webtron-ev-playlist h3.webtron-ev-pl-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8ebf0;
}
.webtron-ev-pl-description {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #aab2bf;
}

/* Sidebar */
.webtron-ev-pl-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  color: #e8ebf0;
  background: var(--ev-pl-sidebar-bg, #1a1a1a);
  overflow: hidden;
}
.webtron-ev-pl-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.webtron-ev-playlist h4.webtron-ev-pl-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #e8ebf0;
}
.webtron-ev-pl-subheading {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #aab2bf;
}
.webtron-ev-pl-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #8b94a3;
}

.webtron-ev-pl-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.webtron-ev-pl-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-135deg);
  transition: transform 0.15s ease;
}
.webtron-ev-pl-toggle[aria-expanded="false"]::after {
  transform: rotate(45deg);
}

.webtron-ev-pl-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.webtron-ev-pl-list.is-collapsed {
  display: none;
}

.webtron-ev-pl-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.webtron-ev-pl-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.webtron-ev-pl-item:focus-visible,
.webtron-ev-pl-chapter:focus-visible,
.webtron-ev-pl-toggle:focus-visible,
.webtron-ev-pl-search-result:focus-visible {
  outline: 2px solid var(--ev-pl-accent, #38bdf8);
  outline-offset: -2px;
}
.webtron-ev-pl-item.is-active {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 3px 0 0 var(--ev-pl-accent, #38bdf8);
}
.webtron-ev-pl-number {
  flex: 0 0 22px;
  font-size: 0.78rem;
  color: #8b94a3;
  text-align: center;
}
.webtron-ev-pl-item.is-active .webtron-ev-pl-number {
  color: var(--ev-pl-accent, #38bdf8);
  font-weight: 700;
}
.webtron-ev-pl-thumb {
  flex: 0 0 64px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}
.webtron-ev-pl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.webtron-ev-pl-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.webtron-ev-pl-item-title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}
.webtron-ev-pl-item-duration {
  font-size: 0.75rem;
  color: #8b94a3;
}
.webtron-ev-pl-check {
  flex: 0 0 auto;
  display: none;
  color: #4ade80;
  font-size: 0.9rem;
}
.webtron-ev-pl-item.is-completed .webtron-ev-pl-check {
  display: block;
}
.webtron-ev-pl-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.webtron-ev-pl-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ev-pl-accent, #38bdf8);
}

/* Chapters in the sidebar */
.webtron-ev-pl-chapters {
  display: none;
  padding: 4px 0 8px;
  background: rgba(0, 0, 0, 0.25);
}
.webtron-ev-pl-chapters.is-visible {
  display: block;
}
.webtron-ev-pl-chapter {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 6px 16px 6px 48px;
  border: 0;
  background: transparent;
  color: #c9ced8;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.webtron-ev-pl-chapter:hover {
  color: #fff;
}
.webtron-ev-pl-chapter.is-active {
  color: var(--ev-pl-accent, #38bdf8);
  font-weight: 600;
}
.webtron-ev-pl-chapter-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: #8b94a3;
}

/* Chapter markers and the hover tooltip on the progress bar */
.webtron-ev-pl-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.webtron-ev-pl-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(0, 0, 0, 0.75);
}
.webtron-ev-progress-container {
  position: relative;
}
.webtron-ev-pl-tooltip {
  position: absolute;
  bottom: 100%;
  margin-bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(18, 22, 28, 0.96);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 26;
}

/* Next and previous */
.webtron-ev-pl-prev:disabled,
.webtron-ev-pl-next:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Transcript search */
.webtron-ev-pl-search {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.webtron-ev-pl-search-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.85rem;
}
.webtron-ev-pl-search-count {
  margin: 8px 0 4px;
  font-size: 0.75rem;
  color: #8b94a3;
}
.webtron-ev-pl-search-list {
  max-height: 220px;
  overflow-y: auto;
}
.webtron-ev-pl-search-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  width: 100%;
  padding: 7px 4px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: #c9ced8;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.webtron-ev-pl-search-result:hover {
  color: #fff;
}
.webtron-ev-pl-search-time {
  color: var(--ev-pl-accent, #38bdf8);
  font-variant-numeric: tabular-nums;
}
.webtron-ev-pl-search-video {
  font-weight: 600;
}
.webtron-ev-pl-search-text {
  grid-column: 1 / -1;
}
.webtron-ev-pl-search-text mark {
  background: rgba(250, 204, 21, 0.35);
  color: #e8ebf0;
}

/* Transcript panel under the player */
.webtron-ev-pl-transcript {
  padding: 0 18px 14px;
  color: #c9ced8;
}
.webtron-ev-pl-transcript
  .webtron-video-transcript__segment.is-active
  .webtron-video-transcript__text {
  color: #fff;
  font-weight: 600;
}

/* Set by playlist.js when the block itself is narrow, whatever the window size: a list beside a
   small player leaves the video too little room. */
.webtron-ev-playlist.is-narrow,
.webtron-ev-playlist.is-narrow.layout-sidebar-left {
  display: flex;
  flex-direction: column;
}
.webtron-ev-playlist.is-narrow.layout-sidebar-left .webtron-ev-pl-sidebar {
  order: 0;
}
.webtron-ev-playlist.is-narrow .webtron-ev-pl-sidebar {
  height: auto;
  min-height: 0;
  max-height: 280px;
}

@media (max-width: 900px) {
  .webtron-ev-playlist,
  .webtron-ev-playlist.layout-sidebar-left {
    display: flex;
    flex-direction: column;
  }
  .webtron-ev-playlist.layout-sidebar-left .webtron-ev-pl-sidebar {
    order: 0;
  }
  .webtron-ev-playlist .webtron-ev-pl-sidebar {
    height: auto;
    min-height: 0;
    max-height: 280px;
  }
}

@media (max-width: 600px) {
  .webtron-ev-pl-thumb {
    display: none;
  }
}
