* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  height: 100vh;
  background: #f4f5f7;
  color: #222;
}

#sidebar {
  width: 320px;
  max-width: 40%;
  border-right: 1px solid #ddd;
  background: #fff;
  overflow-y: auto;
  padding: 12px;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

#status {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 6px;
  white-space: pre-line; /* allow line breaks */
}

#tree {
  list-style: none;
  padding-left: 0;
  font-size: 0.95rem;
}

details {
  margin: 4px 0;
}

details > summary {
  cursor: pointer;
  list-style: none;
  padding: 4px 6px;
  border-radius: 4px;
  font-weight: 600;
}

details > summary:hover {
  background: #f0f0f0;
}

.lesson-title {
  font-weight: 500;
  padding: 3px 6px;
  margin-top: 4px;
}

.video-list {
  list-style: none;
  padding-left: 20px;
  margin: 4px 0 8px 0;
}

.video-item-button {
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 4px 4px;
  border-radius: 4px;
  width: 100%;
  font-size: 0.92rem;
}

.video-item-button:hover {
  background: #e9f3ff;
}

.video-item-button.active {
  background: #cde4ff;
  font-weight: 600;
}

#video-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

#video-info {
  font-size: 0.9rem;
  color: #555;
  margin-top: 8px;
}

/* Player container with 16:9 ratio */
#video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}

#video-container .moovie {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#video-container .moovie video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

