/* ═══════════════════════════════════════════════════════════
   Video.js Kids Theme — Playful, responsive, kid-friendly
   ═══════════════════════════════════════════════════════════ */

/* ── Base Container ── */
.video-js.vjs-kids-theme {
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  background-color: #0a1220;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  width: 100% !important;
  height: 100% !important;
}

.video-js.vjs-kids-theme .vjs-tech {
  border-radius: 1rem;
}

/* ── Big Play Button ── */
.video-js.vjs-kids-theme .vjs-big-play-button {
  width: 80px;
  height: 80px;
  line-height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #6b97c4 0%, #2f4a6b 100%);
  font-size: 40px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(107, 151, 196, 0.4);
}

.video-js.vjs-kids-theme .vjs-big-play-button:hover {
  background: linear-gradient(135deg, #8eb3d6 0%, #4d7aab 100%);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 10px 28px rgba(107, 151, 196, 0.6);
}

.video-js.vjs-kids-theme .vjs-big-play-button .vjs-icon-placeholder:before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Control Bar ── */
.video-js.vjs-kids-theme .vjs-control-bar {
  background: linear-gradient(180deg, transparent 0%, rgba(10, 18, 32, 0.92) 100%);
  height: 52px;
  padding: 0 10px;
  display: flex;
  align-items: center;
}

.video-js.vjs-kids-theme .vjs-control-bar .vjs-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s;
}

.video-js.vjs-kids-theme .vjs-control-bar .vjs-button:hover {
  background: rgba(107, 151, 196, 0.3);
}

/* Play/Pause */
.video-js.vjs-kids-theme .vjs-play-control {
  width: 48px;
  min-width: 48px;
  font-size: 22px;
}

.video-js.vjs-kids-theme .vjs-play-control:hover {
  background: linear-gradient(135deg, rgba(107, 151, 196, 0.4), rgba(47, 74, 107, 0.4));
}

/* ── Progress Bar ── */
.video-js.vjs-kids-theme .vjs-progress-control {
  position: absolute;
  bottom: 52px;
  left: 0;
  right: 0;
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  transition: height 0.2s;
}

.video-js.vjs-kids-theme:hover .vjs-progress-control,
.video-js.vjs-kids-theme.vjs-user-active .vjs-progress-control {
  height: 10px;
}

.video-js.vjs-kids-theme .vjs-progress-holder {
  height: 100%;
  pointer-events: all;
}

.video-js.vjs-kids-theme .vjs-play-progress {
  background: linear-gradient(90deg, #6b97c4 0%, #4d7aab 100%);
  border-radius: 6px;
}

.video-js.vjs-kids-theme .vjs-load-progress {
  background: rgba(255, 255, 255, 0.2);
}

.video-js.vjs-kids-theme .vjs-load-progress div {
  background: rgba(255, 255, 255, 0.25);
}

.video-js.vjs-kids-theme .vjs-play-progress:before {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}

.video-js.vjs-kids-theme:hover .vjs-play-progress:before,
.video-js.vjs-kids-theme.vjs-user-active .vjs-play-progress:before {
  transform: translateY(-50%) scale(1);
}

/* ── Time Display ── */
.video-js.vjs-kids-theme .vjs-time-control {
  font-size: 12px;
  font-weight: 700;
  line-height: 44px;
  padding: 0 6px;
  min-width: auto;
}

.video-js.vjs-kids-theme .vjs-current-time,
.video-js.vjs-kids-theme .vjs-duration {
  display: block;
  padding: 0;
}

.video-js.vjs-kids-theme .vjs-time-divider {
  padding: 0 3px;
  min-width: auto;
}

/* ── Volume ── */
.video-js.vjs-kids-theme .vjs-volume-panel {
  width: 44px;
  transition: width 0.3s;
}

.video-js.vjs-kids-theme .vjs-volume-panel:hover {
  width: 110px;
}

.video-js.vjs-kids-theme .vjs-volume-panel .vjs-volume-control {
  opacity: 0;
  transition: opacity 0.3s;
}

.video-js.vjs-kids-theme .vjs-volume-panel:hover .vjs-volume-control {
  opacity: 1;
}

.video-js.vjs-kids-theme .vjs-volume-bar {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.video-js.vjs-kids-theme .vjs-volume-level {
  background: linear-gradient(90deg, #34d399, #10b981);
  border-radius: 4px;
}

.video-js.vjs-kids-theme .vjs-volume-level:before {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
}

/* ── Fullscreen ── */
.video-js.vjs-kids-theme .vjs-fullscreen-control {
  font-size: 18px;
}

/* ── Playback Rate Menu ── */
.video-js.vjs-kids-theme .vjs-playback-rate {
  width: auto;
  min-width: 44px;
  font-weight: 800;
  font-size: 12px;
}

.video-js.vjs-kids-theme .vjs-playback-rate .vjs-menu {
  bottom: 52px;
}

/* ── Hide Download ── */
.video-js.vjs-kids-theme .vjs-download-button,
.video-js.vjs-kids-theme a[download] {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   Quality Selector — dropdown menu
   ═══════════════════════════════════════════════════════════ */
.video-js.vjs-kids-theme .vjs-quality-selector {
  position: relative;
  width: auto;
  min-width: 44px;
  padding: 0 10px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.video-js.vjs-kids-theme .vjs-quality-selector .vjs-quality-text {
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Quality dropdown menu */
.vjs-quality-menu {
  display: none;
  position: absolute;
  bottom: 52px;
  right: 0;
  min-width: 140px;
  background: rgba(10, 18, 32, 0.97);
  border: 1px solid rgba(107, 151, 196, 0.25);
  border-radius: 14px;
  padding: 6px 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.vjs-quality-menu--open {
  display: block !important;
}

.vjs-quality-menu .vjs-menu-content {
  list-style: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

.vjs-quality-menu .vjs-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #bcd1e8;
  text-align: right;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 8px;
  margin: 2px 6px;
  min-height: 40px;
  gap: 8px;
}

.vjs-quality-menu .vjs-menu-item:hover {
  background: rgba(107, 151, 196, 0.2);
  color: #fff;
}

.vjs-quality-menu .vjs-menu-item.vjs-selected {
  background: linear-gradient(90deg, rgba(107, 151, 196, 0.35), rgba(47, 74, 107, 0.35));
  color: #fff;
  font-weight: 900;
}

.vjs-quality-menu .vjs-menu-item-label {
  flex: 1;
}

.vjs-quality-menu .vjs-menu-item-check {
  flex-shrink: 0;
  font-size: 14px;
  color: #6b97c4;
  font-weight: 900;
}

/* ── Loading Spinner ── */
.video-js.vjs-kids-theme .vjs-loading-spinner {
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #6b97c4;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  animation: vjs-kids-spin 0.8s linear infinite;
}

@keyframes vjs-kids-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.video-js.vjs-kids-theme .vjs-loading-spinner:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b97c4, #2f4a6b);
  opacity: 0.8;
}

/* ── Error Display ── */
.video-js.vjs-kids-theme .vjs-error-display {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  border-radius: 1rem;
  padding: 24px;
}

.video-js.vjs-kids-theme .vjs-error-display .vjs-modal-dialog-content {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

/* ── Modal ── */
.video-js.vjs-kids-theme .vjs-modal-dialog {
  background: rgba(10, 18, 32, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 1.5rem;
}

/* ── Subtitles ── */
.video-js.vjs-kids-theme .vjs-text-track-display {
  position: absolute;
  bottom: 72px;
  left: 0;
  right: 0;
  text-align: center;
}

.video-js.vjs-kids-theme .vjs-text-track-display > div {
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  display: inline-block;
}

/* ── Security: disable pointer on <video> ── */
.video-js.vjs-kids-theme video,
.video-js.vjs-kids-theme .vjs-tech {
  pointer-events: none;
}

.video-js.vjs-kids-theme .vjs-control-bar,
.video-js.vjs-kids-theme .vjs-big-play-button,
.video-js.vjs-kids-theme .vjs-progress-holder {
  pointer-events: all;
}

/* ── Focus / A11y ── */
.video-js.vjs-kids-theme .vjs-control:focus,
.video-js.vjs-kids-theme .vjs-control-bar .vjs-button:focus {
  outline: 3px solid #6b97c4;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Next Episode Overlay (generated by JS)
   ═══════════════════════════════════════════════════════════ */
.kvp-next-overlay {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(10, 18, 32, 0.92);
  color: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  z-index: 10000;
  max-width: 300px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(107, 151, 196, 0.2);
  animation: kvp-slide-up 0.4s ease-out;
}

.kvp-next-label {
  font-size: 0.75rem;
  margin: 0 0 0.4rem;
  opacity: 0.7;
  font-weight: 600;
}

.kvp-next-title {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.kvp-next-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.kvp-next-play {
  background: #6b97c4;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.kvp-next-play:hover {
  background: #8eb3d6;
}

.kvp-next-cancel {
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
}

.kvp-next-cancel:hover {
  color: #fff;
}

@keyframes kvp-slide-up {
  from { transform: translateY(80px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .video-js.vjs-kids-theme {
    border-radius: 0.75rem;
  }

  .video-js.vjs-kids-theme .vjs-big-play-button {
    width: 64px;
    height: 64px;
    line-height: 64px;
    font-size: 32px;
    border-width: 2px;
  }

  .video-js.vjs-kids-theme .vjs-control-bar {
    height: 48px;
    padding: 0 6px;
  }

  .video-js.vjs-kids-theme .vjs-control-bar .vjs-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .video-js.vjs-kids-theme .vjs-play-control {
    width: 44px;
    min-width: 44px;
    font-size: 20px;
  }

  .video-js.vjs-kids-theme .vjs-time-control {
    font-size: 10px;
    padding: 0 3px;
  }

  .video-js.vjs-kids-theme .vjs-progress-control {
    bottom: 48px;
    height: 5px;
  }

  .video-js.vjs-kids-theme:hover .vjs-progress-control,
  .video-js.vjs-kids-theme.vjs-user-active .vjs-progress-control {
    height: 8px;
  }

  .video-js.vjs-kids-theme .vjs-volume-panel {
    display: none;
  }

  .vjs-quality-menu {
    bottom: 48px;
    right: -8px;
    min-width: 120px;
    border-radius: 12px;
  }

  .vjs-quality-menu .vjs-menu-item {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  .kvp-next-overlay {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    padding: 1rem 1.25rem;
  }
}

/* ── Touch: larger progress bar hit area ── */
@media (hover: none) and (pointer: coarse) {
  .video-js.vjs-kids-theme .vjs-progress-control {
    height: 8px;
  }

  .video-js.vjs-kids-theme .vjs-play-progress:before {
    width: 18px;
    height: 18px;
    transform: translateY(-50%) scale(1);
  }

  .vjs-quality-menu .vjs-menu-item {
    min-height: 44px;
    padding: 10px 14px;
  }
}

/* ── Very small screens ── */
@media (max-width: 380px) {
  .video-js.vjs-kids-theme .vjs-time-control {
    display: none;
  }

  .video-js.vjs-kids-theme .vjs-time-divider {
    display: none;
  }

  .video-js.vjs-kids-theme .vjs-quality-selector .vjs-quality-text {
    font-size: 10px;
  }
}
