/* ==================================================================
   Training Media: the topbar Media Center icon + quick panel drawer,
   the library card grid, and the player page. Loaded globally
   (pwa_head.php) since the icon appears in every authenticated page's
   header, same as help.css.
   ================================================================== */

.training-media-library {
    max-width: 1200px;
    margin: 0 auto;
}

.tm-card {
    transition: transform .12s ease, box-shadow .12s ease;
    overflow: hidden;
}

.tm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1) !important;
}

.tm-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bs-tertiary-bg, #eef0f5);
    overflow: hidden;
}

.tm-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--bs-secondary-color, #6c757d);
}

.tm-card-type-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    border-radius: .375rem;
    padding: .15rem .4rem;
    font-size: .8rem;
}

.tm-card-featured-badge {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: var(--bs-warning);
    color: #000;
    border-radius: .375rem;
    padding: .1rem .4rem;
    font-size: .7rem;
    font-weight: 600;
}

.tm-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.training-media-player {
    max-width: 1100px;
    margin: 0 auto;
}

.tm-player-stage video,
.tm-player-stage audio {
    width: 100%;
    background: #000;
    border-radius: .375rem;
}

/* --- Topbar quick panel drawer ------------------------------------- */

#training-media-drawer {
    width: min(400px, 92vw);
}

.tm-drawer-header {
    background: linear-gradient(135deg, var(--brand, #3F51B5), var(--brand-dark, #303F9F));
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
}

.tm-drawer-header .offcanvas-title {
    color: #fff;
    font-weight: 600;
}

.tm-drawer-subtitle {
    color: rgba(255, 255, 255, .75);
    font-size: .78rem;
}

.training-media-quick-panel {
    padding-bottom: 1.25rem;
}

.tm-quick-cta {
    padding: 1rem 1rem .75rem;
}

.tm-quick-empty {
    padding: 2.5rem 1.5rem;
    color: var(--bs-secondary-color, #6c757d);
}

.tm-quick-empty i {
    color: var(--bs-tertiary-color, #adb5bd);
}

.tm-quick-section {
    padding: 0 1rem;
    margin-bottom: 1.35rem;
}

.tm-quick-section-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: .5rem;
}

.tm-quick-list {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.tm-quick-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .4rem;
    border-radius: .5rem;
    text-decoration: none;
    color: inherit;
    transition: background-color .12s ease;
}

.tm-quick-item:hover {
    background: var(--bs-tertiary-bg, #f5f6fa);
}

.tm-quick-thumb {
    flex: 0 0 auto;
    width: 68px;
    height: 42px;
    border-radius: .375rem;
    overflow: hidden;
    background: var(--bs-tertiary-bg, #eef0f5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 1.1rem;
}

.tm-quick-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-quick-item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.tm-quick-item-title-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.tm-quick-item-title {
    font-size: .85rem;
    font-weight: 500;
    color: var(--bs-body-color, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-quick-new-pill {
    flex: 0 0 auto;
    background: var(--bs-danger, #dc3545);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .1rem .35rem;
    border-radius: .25rem;
    line-height: 1.3;
}

.tm-quick-item-meta {
    display: flex;
    align-items: center;
    font-size: .72rem;
    color: var(--bs-secondary-color, #6c757d);
}

.tm-quick-item-arrow {
    flex: 0 0 auto;
    color: var(--bs-tertiary-color, #ced4da);
    font-size: .8rem;
}

.tm-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tm-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: var(--bs-tertiary-bg, #eef0f5);
    color: var(--bs-body-color, #212529);
    font-size: .8rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.tm-quick-chip:hover {
    background: #fff;
    border-color: var(--brand, #3F51B5);
    color: var(--brand, #3F51B5);
}
