/* ==========================================================================
   Training videos page (resources/views/training/index.blade.php)
   Uses the brand tokens from app.css; loaded on this page only.
   ========================================================================== */

/* Hero */
.tv-hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; padding: 1.25rem 0 4.25rem;
  background: radial-gradient(900px 420px at 90% -20%, rgba(255, 194, 26, .2), transparent 60%), linear-gradient(135deg, var(--kb-navy) 0%, var(--kb-blue-700) 45%, var(--kb-blue) 100%); }
.tv-hero::before { content: ""; position: absolute; z-index: -1; right: -140px; top: -40px; width: 460px; height: 150%; transform: skewX(-24deg); background: linear-gradient(160deg, rgba(227, 20, 27, .9), rgba(195, 15, 22, .75)); opacity: .85; }
.tv-hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1.2px, transparent 1.6px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.tv-hero .breadcrumb, .tv-hero .breadcrumb a, .tv-hero .breadcrumb-item.active, .tv-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .78); }
.tv-kicker { display: inline-flex; align-items: center; gap: .4rem; font-family: "Hind Siliguri", sans-serif; font-weight: 700; font-size: .85rem; color: var(--kb-navy); background: var(--kb-gold); padding: .2rem .75rem; border-radius: 999px; margin-bottom: .6rem; }
.tv-title { font-family: "Hind Siliguri", var(--bs-body-font-family); font-weight: 700; color: #fff; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); line-height: 1.15; margin: 0 0 .6rem; }
.tv-title span { color: var(--kb-gold); }
.tv-lead { font-family: "Hind Siliguri", var(--bs-body-font-family); color: rgba(255, 255, 255, .85); font-size: 1.05rem; max-width: 620px; margin-bottom: 1.1rem; }
.tv-stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.tv-stats span { display: inline-flex; align-items: center; gap: .4rem; font-family: "Hind Siliguri", sans-serif; font-weight: 600; font-size: .9rem; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); padding: .3rem .8rem; border-radius: 999px; backdrop-filter: blur(4px); }
.tv-stats .bi { color: var(--kb-gold); }

.tv-hero-art { position: relative; height: 210px; }
.tv-screen { position: absolute; inset: 20px 30px 20px 40px; border-radius: 18px; background: linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .8)); box-shadow: var(--kb-shadow-lg); transform: rotate(-3deg); display: grid; place-items: center; }
.tv-screen-play { width: 64px; height: 64px; border-radius: 50%; background: var(--kb-red); color: #fff; display: grid; place-items: center; font-size: 2rem; box-shadow: 0 10px 24px -8px rgba(227, 20, 27, .8); animation: tv-pulse 2.4s infinite; }
.tv-screen-bar { position: absolute; left: 18px; right: 18px; bottom: 16px; height: 6px; border-radius: 3px; background: var(--kb-line); overflow: hidden; }
.tv-screen-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--kb-red), var(--kb-gold)); animation: tv-progress 6s linear infinite; }
.tv-bubble { position: absolute; width: 46px; height: 46px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 1.25rem; box-shadow: var(--kb-shadow); animation: tv-float 4.5s ease-in-out infinite; }
.tv-bubble.b1 { left: 0; top: 10px; color: var(--kb-red); }
.tv-bubble.b2 { right: 6px; top: 0; color: var(--kb-gold-600); animation-delay: -1.5s; }
.tv-bubble.b3 { right: 0; bottom: 6px; color: var(--kb-green); animation-delay: -3s; }

/* Toolbar (floats over the hero edge) */
.tv-main { position: relative; z-index: 2; margin-top: -2.75rem; padding-bottom: 2.5rem; }
.tv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--kb-line); border-radius: 20px; padding: .75rem; box-shadow: var(--kb-shadow); margin-bottom: 1.25rem; }
.tv-chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; flex: 1 1 420px; min-width: 0; padding: 2px; }
.tv-chips::-webkit-scrollbar { display: none; }
.tv-chip { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; border: 1.5px solid var(--kb-line); background: #fff; color: var(--kb-ink); font-family: "Hind Siliguri", var(--bs-body-font-family); font-weight: 600; font-size: .9rem; padding: .4rem .85rem; border-radius: 999px; transition: background .2s, border-color .2s, color .2s; }
.tv-chip:hover { border-color: var(--kb-blue); color: var(--kb-blue); }
.tv-chip.active { background: var(--kb-blue); border-color: var(--kb-blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(10, 79, 196, .7); }
.tv-chip-count { font-size: .75rem; font-weight: 700; background: var(--kb-bg); color: var(--kb-muted); padding: 0 .45rem; border-radius: 999px; }
.tv-chip.active .tv-chip-count { background: rgba(255, 255, 255, .22); color: #fff; }
.tv-search { display: flex; align-items: center; gap: .5rem; flex: 0 1 280px; background: var(--kb-bg); border: 1.5px solid transparent; border-radius: 999px; padding: 0 .9rem; transition: border-color .2s, background .2s; }
.tv-search:focus-within { border-color: var(--kb-blue); background: #fff; }
.tv-search .bi { color: var(--kb-subtle); }
.tv-search input { border: 0; outline: 0; background: transparent; width: 100%; padding: .55rem 0; font-family: "Hind Siliguri", var(--bs-body-font-family); font-size: .92rem; color: var(--kb-ink); min-width: 0; }

/* Cards */
.tv-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.tv-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--kb-line); border-radius: 18px; overflow: hidden; color: var(--kb-ink); text-decoration: none; box-shadow: var(--kb-shadow-xs);
  transition: transform .3s var(--kb-ease), box-shadow .3s var(--kb-ease), border-color .3s; animation: tv-rise .6s var(--kb-ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.tv-card[hidden] { display: none; }
.tv-card:hover, .tv-card:focus-visible { color: var(--kb-ink); transform: translateY(-5px); box-shadow: var(--kb-shadow-lg); border-color: transparent; }
.tv-card:focus-visible { outline: 3px solid var(--kb-gold); outline-offset: 2px; }
.tv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--kb-navy); }
.tv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--kb-ease), filter .3s; }
.tv-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 21, 51, 0) 45%, rgba(11, 21, 51, .55)); transition: background .3s; }
.tv-card:hover .tv-thumb img { transform: scale(1.06); }
.tv-card:hover .tv-thumb::after { background: linear-gradient(180deg, rgba(11, 21, 51, .15), rgba(11, 21, 51, .6)); }
.tv-play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; color: #fff;
  background: rgba(227, 20, 27, .92); box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .5); transition: transform .3s var(--kb-ease), background .3s; }
.tv-play .bi { margin-left: 3px; }
.tv-play::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); opacity: 0; transition: opacity .3s, transform .3s; transform: scale(.85); }
.tv-card:hover .tv-play { transform: scale(1.1); background: var(--kb-red); }
.tv-card:hover .tv-play::before { opacity: 1; transform: scale(1); }
.tv-duration { position: absolute; z-index: 2; right: .55rem; bottom: .55rem; font-size: .75rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .72); padding: .1rem .45rem; border-radius: 6px; }
.tv-cat { position: absolute; z-index: 2; left: .55rem; top: .55rem; display: inline-flex; align-items: center; gap: .3rem; font-family: "Hind Siliguri", sans-serif; font-size: .75rem; font-weight: 700; color: var(--kb-navy); background: rgba(255, 255, 255, .92); padding: .12rem .55rem; border-radius: 999px; backdrop-filter: blur(4px); }
.tv-body { display: flex; flex-direction: column; gap: .35rem; padding: .95rem 1rem 1rem; flex: 1; }
.tv-card-title { font-family: "Hind Siliguri", var(--bs-body-font-family); font-weight: 700; font-size: 1.05rem; line-height: 1.4; color: var(--kb-navy);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-desc { font-family: "Hind Siliguri", var(--bs-body-font-family); font-size: .88rem; line-height: 1.55; color: var(--kb-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tv-watch { margin-top: auto; padding-top: .45rem; display: inline-flex; align-items: center; gap: .35rem; font-family: "Hind Siliguri", sans-serif; font-weight: 700; font-size: .9rem; color: var(--kb-red); transition: gap .25s var(--kb-ease); }
.tv-card:hover .tv-watch { gap: .55rem; }

/* Player modal */
.tv-modal .modal-content { background: var(--kb-navy); color: #fff; border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.tv-frame { background: #000; }
.tv-frame iframe { border: 0; }
.tv-modal-body { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-start; justify-content: space-between; padding: 1rem 1.25rem 1.15rem; }
.tv-modal-title { font-family: "Hind Siliguri", var(--bs-body-font-family); font-weight: 700; font-size: 1.15rem; color: #fff; margin: 0 0 .25rem; }
.tv-modal-desc { font-family: "Hind Siliguri", var(--bs-body-font-family); font-size: .9rem; color: rgba(255, 255, 255, .72); margin: 0; max-width: 760px; white-space: pre-line; }
.tv-modal-desc:empty { display: none; }
.tv-modal-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.tv-close { width: 34px; height: 31px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; font-size: 1rem; transition: background .2s; }
.tv-close:hover { background: var(--kb-red); }
@media (max-width: 575.98px) {
  .tv-modal .modal-dialog { margin: .5rem; }
  .tv-modal .modal-content { border-radius: 14px; }
  .tv-modal-body { padding: .85rem .9rem 1rem; }
  .tv-modal-title { font-size: 1rem; }
}

/* Responsive */
@media (max-width: 767.98px) {
  .tv-hero { padding: 1rem 0 3.5rem; }
  .tv-lead { font-size: .95rem; }
  .tv-main { margin-top: -2.25rem; }
  .tv-toolbar { padding: .6rem; border-radius: 16px; }
  .tv-search { flex: 1 1 100%; }
}
@media (max-width: 575.98px) {
  .tv-grid { gap: .85rem; }
  .tv-stats span { font-size: .8rem; padding: .25rem .65rem; }
}

@keyframes tv-rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: none; } } /* "translate" keeps the hover lift working */
@keyframes tv-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes tv-pulse { 0% { box-shadow: 0 0 0 0 rgba(227, 20, 27, .55); } 70% { box-shadow: 0 0 0 16px rgba(227, 20, 27, 0); } 100% { box-shadow: 0 0 0 0 rgba(227, 20, 27, 0); } }
@keyframes tv-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

@media (prefers-reduced-motion: reduce) {
  .tv-card, .tv-bubble, .tv-screen-play, .tv-screen-bar span { animation: none; }
  .tv-card, .tv-thumb img, .tv-play { transition: none; }
  .tv-card:hover, .tv-card:hover .tv-thumb img { transform: none; }
}
