/* Training videos page (Client/Pages/Help/TrainingVideos.razor). Colours follow the Radzen theme variables so
   the page reads in light and dark themes; the brand blue is the fallback. */
.tv-page {
    --tv-accent: var(--rz-primary, #003399);
    --tv-text: var(--rz-text-color, #1e293b);
    --tv-muted: var(--rz-text-secondary-color, #64748b);
    --tv-surface: var(--rz-base-background-color, #fff);
    --tv-raised: var(--rz-base-50, #f8fafc);
    --tv-border: var(--rz-base-300, #e2e8f0);
    --tv-soft: color-mix(in srgb, var(--tv-accent) 10%, transparent);
    --tv-ok: var(--rz-success, #16a34a);
    max-width: 1440px;
    margin: 0 auto;
    padding: 4px 4px 40px;
    color: var(--tv-text);
}
.tv-muted { color: var(--tv-muted); font-size: 13px; }

/* Header */
.tv-head { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.tv-head-text { flex: 1 1 520px; min-width: 0; }
.tv-head h1 { font-size: 26px; font-weight: 700; margin: 4px 0 6px; color: var(--tv-text); letter-spacing: -.01em; }
.tv-sub { margin: 0; color: var(--tv-muted); font-size: 14.5px; line-height: 1.5; max-width: 760px; }
.tv-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: var(--tv-accent); }
.tv-progress-card { flex: 0 1 320px; min-width: 240px; padding: 14px 16px; border: 1px solid var(--tv-border);
    border-radius: 12px; background: var(--tv-surface); }
.tv-progress-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.tv-bar { height: 8px; border-radius: 99px; background: var(--tv-border); overflow: hidden; }
.tv-bar-fill { height: 100%; background: var(--tv-accent); border-radius: 99px; transition: width .4s ease; }
.tv-link { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--tv-muted); font-size: 12px;
    text-decoration: underline; cursor: pointer; }

/* Layout */
.tv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
.tv-main { min-width: 0; }

/* Player */
.tv-stage { position: relative; border-radius: 14px; overflow: hidden; background: #0b1220;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.tv-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0b1220; }
.tv-upnext { position: absolute; right: 16px; bottom: 64px; width: min(340px, calc(100% - 32px)); padding: 14px 16px;
    border-radius: 12px; background: rgba(11, 18, 32, .88); color: #fff; backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35); animation: tv-rise .25s ease; }
.tv-upnext-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.tv-upnext-title { font-weight: 600; font-size: 15px; margin: 4px 0 10px; line-height: 1.35; }
.tv-upnext-actions { display: flex; gap: 8px; }
.tv-upnext .tv-btn:not(.tv-btn-primary) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
@keyframes tv-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Controls */
.tv-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.tv-spacer { flex: 1; }
.tv-position { font-size: 13px; color: var(--tv-muted); font-variant-numeric: tabular-nums; }
.tv-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; font-size: 13.5px; font-weight: 600;
    border-radius: 8px; border: 1px solid var(--tv-border); background: var(--tv-surface); color: var(--tv-text); cursor: pointer;
    transition: background .15s, border-color .15s; }
.tv-btn:hover:not(:disabled) { border-color: var(--tv-accent); }
.tv-btn:disabled { opacity: .45; cursor: default; }
.tv-btn-primary { background: var(--tv-accent); border-color: var(--tv-accent); color: #fff; }
.tv-btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.tv-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tv-muted); cursor: pointer; user-select: none; }
.tv-toggle input { accent-color: var(--tv-accent); width: 15px; height: 15px; }
.tv-seg { display: inline-flex; border: 1px solid var(--tv-border); border-radius: 8px; overflow: hidden; }
.tv-seg button { border: 0; background: var(--tv-surface); color: var(--tv-muted); font-size: 12.5px; font-weight: 600; padding: 6px 10px; cursor: pointer; }
.tv-seg button + button { border-left: 1px solid var(--tv-border); }
.tv-seg button.on { background: var(--tv-soft); color: var(--tv-accent); }

/* Details */
.tv-details { margin-top: 12px; padding: 20px 22px; border: 1px solid var(--tv-border); border-radius: 14px; background: var(--tv-surface); }
.tv-details h2 { font-size: 21px; font-weight: 700; margin: 6px 0 8px; color: var(--tv-text); }
.tv-summary { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--tv-text); max-width: 860px; }
.tv-points { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.tv-points li { padding: 4px 11px; border-radius: 99px; background: var(--tv-soft); color: var(--tv-accent); font-size: 12.5px; font-weight: 600; }
.tv-done { display: inline-flex; align-items: center; gap: 5px; color: var(--tv-ok); text-transform: none; letter-spacing: 0; }
.tv-h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tv-muted); margin: 22px 0 8px; }
.tv-chapters { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.tv-chapters button { display: flex; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border: 1px solid transparent;
    border-radius: 10px; background: none; color: inherit; cursor: pointer; transition: background .15s, border-color .15s; }
.tv-chapters button:hover { background: var(--tv-raised); border-color: var(--tv-border); }
.tv-chapters li.on button { background: var(--tv-soft); border-color: color-mix(in srgb, var(--tv-accent) 35%, transparent); }
.tv-ch-time { flex: 0 0 auto; min-width: 40px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tv-accent); padding-top: 1px; }
.tv-ch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tv-ch-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.tv-ch-take { font-size: 12px; color: var(--tv-muted); line-height: 1.35; }
.tv-note { display: flex; gap: 8px; align-items: baseline; margin: 18px 0 0; font-size: 12.5px; color: var(--tv-muted); }

/* Playlist */
.tv-playlist { position: sticky; top: 12px; border: 1px solid var(--tv-border); border-radius: 14px; background: var(--tv-surface);
    overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 120px); }
.tv-playlist-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 10px; font-weight: 700;
    font-size: 14px; border-bottom: 1px solid var(--tv-border); }
.tv-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.tv-item button { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 8px; border: 0; border-radius: 10px;
    background: none; color: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.tv-item button:hover { background: var(--tv-raised); }
.tv-item.on button { background: var(--tv-soft); box-shadow: inset 3px 0 0 var(--tv-accent); }
.tv-thumb { position: relative; flex: 0 0 132px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #0b1220; }
.tv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-dur { position: absolute; right: 5px; bottom: 7px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .75);
    color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-now { position: absolute; left: 6px; top: 6px; padding: 2px 6px; border-radius: 4px; background: var(--tv-accent); color: #fff; font-size: 10px; }
.tv-thumb-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: #ef4444; }
.tv-item.done .tv-thumb-bar { background: var(--tv-ok); }
.tv-item-text { display: flex; gap: 8px; min-width: 0; padding-top: 2px; }
.tv-num { flex: 0 0 22px; font-size: 12.5px; font-weight: 700; color: var(--tv-muted); font-variant-numeric: tabular-nums; }
.tv-item.done .tv-num { color: var(--tv-ok); }
.tv-item.on .tv-num { color: var(--tv-accent); }
.tv-item-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }

@media (max-width: 1100px) {
    .tv-layout { grid-template-columns: minmax(0, 1fr); }
    .tv-playlist { position: static; max-height: none; }
}
@media (max-width: 600px) {
    .tv-head h1 { font-size: 21px; }
    .tv-details { padding: 16px; }
    .tv-thumb { flex-basis: 108px; }
    .tv-chapters { grid-template-columns: minmax(0, 1fr); }
    .tv-progress-card { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .tv-bar-fill, .tv-upnext { transition: none; animation: none; }
}
