/* =====================================================================
   sessions.css — Sessions Catalog.
   1. The lesson playlist is a row of cards ABOVE the player (no more letters stacked in a thin column).
   2. The player control bar looks the same in light mode as in dark mode.
   Load it LAST (after online.css). Pairs with js/sessions.js. Delete its <link>/<script> to switch it off.
   ===================================================================== */

/* ---------- 1. Layout: playlist on top, player under it ---------- */
#vs-layout { max-width: 1120px; margin-inline: auto; width: 100%; }
#vs-player-col { width: 100%; }

#vs-playlist-card { padding: 16px 18px 12px; }
.vs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.vs-head-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vs-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-inline-start: auto; min-width: 0; }
.vs-search { flex: 0 1 300px; width: 300px; max-width: 100%; }
.vs-admin-btn { white-space: nowrap; }
.vs-arrows { display: flex; gap: 6px; }
.vs-arrows.vs-no-scroll { display: none; }
.vs-arrows button {
    width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: #cbd5e1; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
    transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}
.vs-arrows button:hover:not(:disabled) { background: rgba(129, 140, 248, .22); border-color: rgba(129, 140, 248, .55); color: #fff; }
.vs-arrows button:disabled { opacity: .35; cursor: default; }
.vs-arrows svg { width: 16px; height: 16px; }
.light-theme .vs-arrows button { color: #4338ca; background: #fff; border-color: rgba(109, 94, 252, .28); }
.light-theme .vs-arrows button:hover:not(:disabled) { background: #eef2ff; color: #312e81; }
.light-theme .vs-arrows svg { stroke: currentColor !important; }   /* main.css paints every light-mode svg near-black */

/* The row of cards. Same height for all cards, one swipe/scroll direction, snaps card by card. */
#video-sessions-list.vs-strip {
    display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 12px;
    max-height: none; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 12px;
    scroll-snap-type: x proximity; scroll-padding-inline: 2px;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
#video-sessions-list.vs-strip > :not(.vs-row) { flex: 1 0 100%; }      /* the "nothing listed yet" message */

#video-sessions-list.vs-strip > .vs-row,
#video-sessions-list .vs-row {
    flex: 0 0 auto; width: clamp(236px, 26vw, 300px); margin: 0 !important; scroll-snap-align: start;
    flex-direction: column; align-items: stretch; justify-content: space-between; flex-wrap: nowrap;
    gap: 12px; padding: 14px !important; border-radius: 16px;
    content-visibility: visible; contain-intrinsic-size: none;
}
#video-sessions-list .vs-main { flex: 1 1 auto; align-items: flex-start; gap: 10px; min-width: 0; }
#video-sessions-list .vs-main > div:first-child { flex: none; }
/* Titles wrap at word boundaries and show up to 4 lines; the width can no longer collapse to 0 */
#video-sessions-list .vs-title {
    display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    overflow: hidden !important; white-space: normal !important; overflow-wrap: break-word; word-break: normal;
    width: auto !important; max-width: 100% !important; font-size: 14px !important; line-height: 1.35;
}
#video-sessions-list .vs-meta { font-size: 11.5px !important; line-height: 1.4; margin-top: 6px; }
/* Locked / Enter Code / Request sit under the title, wrapping inside the card */
#video-sessions-list .vs-actions { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px; }
#video-sessions-list .vs-actions:not(:has(*)) { display: none; }

/* The session that is playing now */
#video-sessions-list .vs-row.vs-active {
    border-color: rgba(129, 140, 248, .75) !important; background-color: rgba(99, 102, 241, .16);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, .5) inset, 0 10px 26px -14px rgba(99, 102, 241, .8);
}
.light-theme #video-sessions-list .vs-row.vs-active { background-color: #eef2ff; border-color: #6d5efc !important; box-shadow: 0 0 0 1px rgba(109, 94, 252, .45) inset, 0 10px 26px -16px rgba(109, 94, 252, .7); }

/* Hover: lift (the old slide-right made no sense in a row) */
@media (hover: hover) and (pointer: fine) {
    #video-sessions-list.vs-strip > .vs-row:hover { transform: translate3d(0, -3px, 0); }
}

@media (pointer: coarse) { .vs-arrows { display: none; } }   /* fingers swipe */

/* mobile.css un-caps every list on phones (overflow: visible !important). The playlist is a swipe row, so give it back. */
@media (max-width: 1023px), (pointer: coarse) {
    #video-sessions-list.vs-strip { overflow-x: auto !important; overflow-y: hidden !important; max-height: none !important; }
}

/* The little count / session pills were dark text on a dark pill in light mode */
.light-theme #videos-count-badge, .light-theme #current-video-badge {
    color: #4338ca !important; background: #eef2ff !important; border-color: #c7d2fe !important;
}

/* ---------- 2. The player is a dark surface in BOTH themes ---------- */
/* main.css paints every light-mode input white, every svg near-black and many labels slate-grey.
   Inside the player that gave: white boxes over the seek + volume sliders, invisible icons, dim time/title text. */
.light-theme #video-theater input.vc-range {
    background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
    padding: 0 !important; min-height: 0 !important; -webkit-appearance: none; appearance: none;
}
.light-theme #video-theater input.vc-seek { height: 22px !important; }
.light-theme #video-theater input.vc-volume { height: 18px !important; }
#video-theater input.vc-range:focus:not(:focus-visible) { outline: none; box-shadow: none !important; }
#video-theater input.vc-range:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; box-shadow: none !important; border-radius: 9999px !important; }

.light-theme #video-theater svg, .light-theme #video-theater i { stroke: currentColor !important; }
.light-theme #video-theater .vc-btn { color: #e2e8f0 !important; }
.light-theme #video-theater .vc-btn:hover { color: #fff !important; }
.light-theme #video-theater .vc-main, .light-theme #video-theater .vc-cover-play { color: #fff !important; }
.light-theme #video-theater .vc-time,
.light-theme #video-theater .vc-n,
.light-theme #video-theater #vc-quality,
.light-theme #video-theater .vc-speed-btn { color: #e2e8f0 !important; }
.light-theme #video-theater .vc-time { color: #cbd5e1 !important; }
.light-theme #video-theater .vc-menu button { color: #cbd5e1 !important; }
.light-theme #video-theater .vc-menu button:hover { color: #fff !important; }
.light-theme #video-theater .vc-pill { color: #c7d2fe !important; }
.light-theme #video-theater .vc-title { color: #f8fafc !important; }
.light-theme #video-theater .vc-tip { color: #fff !important; }
.light-theme #video-theater #vc-native-fs { color: #fff !important; }

.light-theme #video-theater .vc-cover-title { color: #fff !important; }
.light-theme #video-theater .vc-cover-sub { color: #94a3b8 !important; }
/* ---------- 3. Watermarks (teacher + student name) ---------- */
/* They were 15-20% white at 7-10px, so they vanished on bright pictures. Now: bigger, ~60% white with a dark
   outline, so they read on both dark and bright video, in both themes. They still drift around every 4 s. */
#video-theater #video-watermark-teacher, #video-theater #video-watermark-student,
.light-theme #video-theater #video-watermark-teacher, .light-theme #video-theater #video-watermark-student {
    color: rgba(255, 255, 255, .62) !important;
    font-size: 13px !important; font-weight: 800 !important; letter-spacing: .06em !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, .95), 0 1px 3px rgba(0, 0, 0, .9), 0 0 8px rgba(0, 0, 0, .6) !important;
    padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .18);
    white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
#video-theater #video-watermark-student { color: rgba(255, 255, 255, .7) !important; }
@media (max-width: 767px) {
    #video-theater #video-watermark-teacher, #video-theater #video-watermark-student,
    .light-theme #video-theater #video-watermark-teacher, .light-theme #video-theater #video-watermark-student { font-size: 10px !important; padding: 1px 6px; }
}

/* ---------- 4. PHONE (<=767px): playlist, player and info card look like the PC version ----------
   Lives in a cascade layer so its !important rules beat the !important / :not(#id) chains in main.css, mobile.css,
   ios-glass.css, player.css and viewer-plus.css. Every player rule skips fullscreen. */
@layer phone-header {
@media (max-width: 767px) {

  /* ================= 1. Lesson playlist ================= */
  #vs-playlist-card { padding: 14px 14px 6px !important; }
  .vs-head { gap: 8px 12px !important; }
  .vs-head-tools { width: 100% !important; margin: 0 !important; }
  .vs-search { flex: 1 1 100% !important; width: 100% !important; max-width: none !important; }
  .vs-arrows { display: none !important; }            /* phones swipe the row */

  #video-sessions-list.vs-strip { gap: 10px !important; padding: 4px 2px 10px !important; scroll-snap-type: x mandatory !important; }
  #video-sessions-list.vs-strip > .vs-row,
  #video-sessions-list .vs-row {
    width: min(74vw, 270px) !important;
    padding: 12px !important;
    gap: 8px !important;
    border-radius: 16px !important;
    scroll-snap-align: start !important;
  }
  #video-sessions-list .vs-title { font-size: 14px !important; line-height: 1.3 !important; -webkit-line-clamp: 3 !important; }
  #video-sessions-list .vs-meta { font-size: 11px !important; margin-top: 4px !important; }

  /* ================= 2. Player (normal view only; fullscreen keeps its own rules) ================= */
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) { border-radius: 18px !important; }

  /* title over the picture: small badge + one line of title, like the PC version */
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-top {
    padding: 10px 12px 22px !important;
    gap: 8px !important;
    align-items: center !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-pill {
    font-size: 9px !important; line-height: 1 !important; letter-spacing: .06em !important;
    padding: 4px 8px !important; border-radius: 8px !important; flex: 0 0 auto !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-title {
    font-size: 13px !important; font-weight: 700 !important; line-height: 1.25 !important;
    min-width: 0 !important; flex: 1 1 auto !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  }

  /* control bar: full-width bottom gradient (no boxed bar) */
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-bar {
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    padding: 26px 10px 6px !important;
    border: 0 !important; border-radius: 0 !important;
    background: linear-gradient(to top, rgba(0,0,0,.86) 0%, rgba(0,0,0,.6) 45%, rgba(0,0,0,0) 100%) !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }

  /* thin seek line + small thumb (the touch area stays tall so it is still easy to drag) */
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-seekwrap { height: 24px !important; margin: 0 2px 2px !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-seek { height: 24px !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-seekwrap::before,
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-buf { height: 3px !important; margin-top: -1.5px !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-range::-webkit-slider-runnable-track { height: 3px !important; border-radius: 3px !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-seek::-webkit-slider-thumb {
    opacity: 1 !important; width: 13px !important; height: 13px !important; margin-top: -5px !important;
    background: #fff !important; border: 0 !important; box-shadow: 0 1px 4px rgba(0,0,0,.6) !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-seek::-moz-range-thumb {
    opacity: 1 !important; width: 13px !important; height: 13px !important; background: #fff !important; border: 0 !important;
  }

  /* button row: slim round buttons, time always readable */
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-row { gap: 5px !important; flex-wrap: nowrap !important; align-items: center !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-btn {
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    width: 32px !important; min-width: 32px !important; max-width: 32px !important;
    height: 32px !important; min-height: 32px !important;
    padding: 0 !important; margin: 0 !important;
    border-radius: 999px !important;
    align-items: center !important; justify-content: center !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-btn svg { width: 17px !important; height: 17px !important; stroke-width: 2.2 !important; filter: none !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-main {
    width: 36px !important; min-width: 36px !important; max-width: 36px !important; height: 36px !important; min-height: 36px !important;
    margin: 0 2px 0 0 !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-main svg { width: 18px !important; height: 18px !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-speed-btn {
    width: auto !important; min-width: 36px !important; max-width: none !important; padding: 0 9px !important;
    font-size: 12px !important; font-weight: 800 !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-time {
    flex: 0 0 auto !important; min-width: 0 !important; overflow: visible !important; text-overflow: clip !important;
    white-space: nowrap !important; font-size: 12px !important; font-weight: 700 !important; padding: 0 4px 0 2px !important;
  }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-spacer { flex: 1 1 0 !important; min-width: 0 !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-menu { bottom: 42px !important; }
  /* the player is always a dark surface: its icons stay light, also in light theme */
  .light-theme #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-btn,
  .light-theme #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vp-bar-btn { color: #f1f5f9 !important; }
  .light-theme #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-btn svg,
  .light-theme #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vp-bar-btn svg { stroke: currentColor !important; }

  /* ================= 3. Info card under the player ================= */
  #vs-player-col > div:last-child { padding: 16px !important; gap: 12px !important; }
  #current-video-badge { font-size: 9px !important; padding: 3px 8px !important; }
  #current-video-title { font-size: 14px !important; line-height: 1.3 !important; }

  /* checkpoint tools: slider on its own row, three equal buttons under it (was a blob wrapping over 3 rows) */
  #video-checkpoint-actions { flex-wrap: wrap !important; gap: 8px !important; width: 100% !important; }
  #video-checkpoint-actions > div { flex: 1 1 100% !important; min-width: 0 !important; }
  #video-checkpoint-actions > div input[type="range"] { flex: 1 1 auto !important; min-width: 0 !important; width: 100% !important; }
  #video-checkpoint-actions > #resume-checkpoint-btn { flex: 1 1 100% !important; }   /* longer label: own row */
  #video-checkpoint-actions > button {
    flex: 1 1 0 !important; min-width: 0 !important;
    height: 38px !important; min-height: 38px !important; padding: 0 10px !important;
    font-size: 11px !important; line-height: 1 !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    justify-content: center !important; gap: 6px !important;
  }
}

/* narrower phones: a little tighter, and the flag button in the bar goes (the same "Save Checkpoint" button sits under the video) */
@media (max-width: 480px) {
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) #vc-back,
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) #vc-fwd { display: none !important; }   /* double-tap on the picture still skips 10s */
}
@media (max-width: 400px) {
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-row { gap: 4px !important; }
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) .vc-time { font-size: 11px !important; }
}
@media (max-width: 380px) {
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) #vc-cp { display: none !important; }
}
@media (max-width: 340px) {
  #video-theater:not(:fullscreen):not(.vc-pseudo-fs) #vc-notes-btn { display: none !important; }   /* Notes is also a tab inside the Ask AI panel */
}

}