/* Video selection block in chat */
.video-selection {
  margin: 12px 0;
  padding: 0.75rem 1rem;
  background: rgb(44 47 72 / 50%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 15px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.video-header h4 {
  margin: 0;
  color: #e0e0e0;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #8b9cf7 0, #9d7bf0 50%, #f5a5fc 100%);
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.video-count {
  background: rgb(139 156 247 / 30%);
  color: #8b9cf7;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgb(139 156 247 / 30%);
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Legacy-only elements are hidden (rendered by JS card template) */
.video-item,
.video-item.recommended,
.video-header-item,
.video-type,
.video-level,
.video-title,
.video-topic,
.video-reason,
.video-meta,
.video-duration,
.video-actions,
.btn-embed,
.btn-youtube {
  display: none;
}

/* Studio Slate player overlay (legacy path) */
.video-embedded {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: auto;
  background:
    radial-gradient(1000px 500px at 20% -10%, rgb(107 170 255 / 25%), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgb(86 117 163 / 20%), transparent 52%),
    rgb(0 6 16 / 82%);
  backdrop-filter: blur(4px);
}

.video-embedded.is-open {
  display: flex !important;
}

.video-embedded-backdrop {
  position: absolute;
  inset: 0;
}

.video-embedded-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 96vw);
  border: 1px solid #4f6f98;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgb(4 10 21 / 65%);
  background: linear-gradient(160deg, #101722 0%, #1b2737 52%, #152131 100%);
  overflow: hidden;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #324964;
}

.player-title-block {
  min-width: 0;
}

.player-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9eb6d8;
}

.player-title {
  display: block;
  margin-top: 2px;
  color: #eaf2ff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9fb4d4;
}

.player-controls {
  display: flex;
  gap: 8px;
}

.btn-fullscreen,
.btn-close {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #4c6484;
  background: #162335;
  color: #dceaff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.btn-fullscreen:hover,
.btn-close:hover {
  background: #213248;
}

.player-container {
  position: relative;
  width: min(920px, calc(96vw - 32px));
  margin: 12px auto 0;
  border: 1px solid #2d4767;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  padding-bottom: 56.25%;
  height: 0;
}

.player-container #youtube-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.custom-controls {
  margin: 14px 16px 0;
  padding: 12px;
  border: 1px solid #304a67;
  border-radius: 12px;
  background: rgb(13 21 34 / 60%);
}

.btn-play-pause {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 10px;
  border-radius: 9px;
  border: 1px solid #6aa9f2;
  background: #57a4ff;
  color: #07121f;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.2s ease;
}

.btn-play-pause:hover {
  background: #7cbcff;
}

.timeline-control {
  margin: 10px 0;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #c2d5f2;
  margin-bottom: 6px;
}

.timeline-bar {
  position: relative;
  height: 6px;
  background: #25374f;
  border-radius: 999px;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: #57a4ff;
  border-radius: 999px;
}

#timeline-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

#timeline-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #57a4ff;
  border: 1px solid #72b4ff;
}

#timeline-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #72b4ff;
  background: #57a4ff;
}

.playback-rate-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.rate-label {
  color: #c2d5f2;
  font-size: 12px;
  font-weight: 600;
}

.rate-btn {
  padding: 5px 8px;
  border: 1px solid #3a4f6b;
  border-radius: 7px;
  background: #162436;
  color: #d3e2fb;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rate-btn:hover {
  background: #25374f;
}

.rate-btn.active {
  background: rgb(87 164 255 / 35%);
  border-color: #72b4ff;
  color: #eaf2ff;
}

.quick-jump {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.quick-jump button {
  padding: 7px 8px;
  border: 1px solid #3a4f6b;
  border-radius: 8px;
  background: #1b2a3f;
  color: #dceaff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.quick-jump button:hover {
  background: #25374f;
}

.player-footer {
  padding: 12px 16px 16px;
  text-align: center;
}

.btn-youtube-link {
  width: 100%;
  max-width: 360px;
  padding: 9px 12px;
  border: 1px solid #4c6484;
  border-radius: 9px;
  background: #162335;
  color: #dceaff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.btn-youtube-link:hover {
  background: #213248;
}

/* fullscreen support */
.player-container:fullscreen,
.player-container:full-screen {
  width: 100vw;
  height: 100vh;
  padding-bottom: 0;
  border-radius: 0;
}

/* mobile */
@media (width <= 768px) {
  .video-selection {
    margin: 10px 0;
    padding: 10px;
  }

  .video-embedded {
    padding: 6px;
  }

  .video-embedded-panel {
    width: 100%;
    border-radius: 14px;
  }

  .player-header,
  .custom-controls,
  .player-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .player-title {
    font-size: 14px;
  }

  .quick-jump {
    grid-template-columns: 1fr;
  }
}
