/* 목차, 지금 강의 줄, 섬네일 미리보기 */

/* 목차 */
.toc { padding: 6px 8px 24px; }
.sec { margin-bottom: 2px; }
.sec-head { display: flex; align-items: center; gap: 2px; }

.sec-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.sec-title:hover { background: var(--hover); }
.sec-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-meta { font-size: 12px; font-weight: 400; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }

.sec-fold {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--sub);
  cursor: pointer;
}

.sec-fold:hover { background: var(--hover); }
.sec-fold svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 0.15s; }
.sec.open .sec-fold svg { transform: rotate(180deg); }

.sec-list { display: none; padding-bottom: 6px; }
.sec.open .sec-list { display: block; }

.lec {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px 5px 20px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--sub);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.lec:hover { background: var(--hover); color: var(--text); }
.lec-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lec-dur { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lec .tag { display: none; }
.lec.current { background: var(--accent-bg); color: var(--accent-text); font-weight: 500; }
.lec.current .tag { display: inline-block; }

/* 연속 재생으로 이어서 볼 강의 */
.lec.queued::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}

/* 지금 강의 줄 */
.now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 34px;
  margin-bottom: 10px;
}

.now-sec {
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--hover);
  color: var(--sub);
  font-size: 12px;
  white-space: nowrap;
}

.now-title {
  flex: 1 1 240px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
}

.cont { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

/* 자동 재생 스위치 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sub);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.switch-ui {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: var(--line);
  transition: background 0.15s;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

.cont select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 13px;
  cursor: pointer;
}

.cont-left { color: var(--sub); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 섬네일 미리보기(목차 강의에 마우스를 올렸을 때) */
.thumb-tip {
  position: fixed;
  z-index: 60;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.thumb-tip img,
.thumb-tip video {
  display: block;
  width: 192px;
  height: 108px;
  border-radius: 5px;
  background: #000;
  object-fit: cover;
}
