:root { --sidebar-w: 264px; }

.min-w-0 { min-width: 0; }
.text-bg-purple { background-color: #7c3aed; color: #fff; }

/* ----- Sidebar ----- */
.sidebar-wrap { background: var(--bs-body-bg); border-right: 1px solid var(--bs-border-color); }
.offcanvas-lg { --bs-offcanvas-width: 280px; }
@media (min-width: 992px) {
  .sidebar-wrap { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .sidebar { height: 100%; }
  .sidebar .offcanvas-body { min-height: 100%; }
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.2rem; color: var(--bs-primary); }
.brand .bi { font-size: 1.5rem; }

.sidebar-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); padding: 0 .75rem; margin: 1.1rem 0 .35rem; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: .5rem; color: var(--bs-body-color); text-decoration: none; }
.sidebar-link .bi { width: 1.25rem; text-align: center; color: var(--bs-secondary-color); }
.sidebar-link:hover { background: var(--bs-tertiary-bg); }
.sidebar-link.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; }
.sidebar-link.active .bi { color: inherit; }
.sidebar-link .badge { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); font-weight: 500; }
.sidebar-link.active .badge { background: var(--bs-primary); color: #fff; }

/* ----- Topbar ----- */
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(var(--bs-body-bg-rgb), .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bs-border-color); }
.search-box { max-width: 420px; }

/* ----- Thống kê ----- */
.stat-icon { width: 2.75rem; height: 2.75rem; border-radius: .75rem; display: grid; place-items: center; font-size: 1.25rem; flex: none; }

/* ----- Thẻ video ----- */
.video-card { overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.video-card:hover { transform: translateY(-2px); box-shadow: var(--bs-box-shadow); }
.video-card:focus-within { box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .35); }
.video-card.is-active { border-color: var(--bs-primary); box-shadow: 0 0 0 2px var(--bs-primary); }
.video-card .stretched-link { color: var(--bs-body-color); text-align: left; text-decoration: none; }
.video-card .stretched-link:focus-visible { outline: none; }

.thumb { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; color: rgba(255, 255, 255, .92); font-size: 2.4rem; }
.thumb-lap-trinh  { background: linear-gradient(135deg, #4f46e5, #06b6d4); }
.thumb-thiet-ke   { background: linear-gradient(135deg, #db2777, #f59e0b); }
.thumb-kinh-doanh { background: linear-gradient(135deg, #059669, #0ea5e9); }
.thumb-ngoai-ngu  { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .3); font-size: 3rem; opacity: 0; transition: opacity .15s; }
.video-card:hover .play, .video-card:focus-within .play, .video-card.is-active .play { opacity: 1; }
.thumb .duration { position: absolute; right: .5rem; bottom: .75rem; background: rgba(0, 0, 0, .72); font-weight: 500; font-size: .75rem; }
.thumb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0; background: rgba(0, 0, 0, .35); }
.thumb-progress .progress-bar { background: #fbbf24; }
.fav-btn { position: absolute; top: .5rem; right: .5rem; z-index: 2; width: 2.1rem; height: 2.1rem; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; }
.fav-btn:hover { background: rgba(0, 0, 0, .65); }
.fav-btn.is-fav { color: #f87171; }

/* ----- Danh sách phát tiếp theo ----- */
.up-item { display: flex; gap: .75rem; align-items: center; text-align: left; }
.up-thumb { width: 88px; flex: none; border-radius: .4rem; font-size: 1.2rem; }
.up-item .title { font-weight: 600; font-size: .9rem; line-height: 1.3; }

@media (prefers-reduced-motion: reduce) {
  .video-card, .thumb .play { transition: none; }
  .video-card:hover { transform: none; }
}
