/*Youtube Chapters CSS*/
.yt-chapters {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.yt-chapter-player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18),
              0 8px 12px rgba(0, 0, 0, 0.12);
}

.yt-chapter-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-chapter-list {
  order: -1;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 0;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.yt-chapter-item {
  flex: 0 0 auto;
  min-width: 140px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: #f3f3f1;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.yt-chapter-item:hover {
  transform: translateY(-2px);
  background: #e9e9e6;
}

.yt-chapter-item.active {
  outline: 2px solid #4f9d7b;
  outline-offset: 2px;
  background: #e4f2ec;
}

.yt-chapter-time {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4f9d7b;
  font-variant-numeric: tabular-nums;
}

.yt-chapter-title {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.25;
  color: #1f1f1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-chapters-empty,
.yt-chapters .yt-error {
  font-size: 0.85rem;
  color: #555;
  margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .yt-chapter-item {
    min-width: 120px;
    max-width: 180px;
  }
}
