/* =============================================================
   TVZP Training Video Widget — Base Styles
   All Elementor design controls layer on top of these.
   ============================================================= */

/* ── Layout ──────────────────────────────────────────────────── */
.tvzp-tv-widget {
    position: relative;
}

.tvzp-tv-layout {
    display: flex;
    align-items: flex-start;
}

.tvzp-tv-content {
    flex: 1;
    min-width: 0;
}

/* ── Grid ────────────────────────────────────────────────────── */
.tvzp-tv-grid {
    display: grid;
}

.tvzp-tv-no-results {
    grid-column: 1 / -1;
    padding: 24px 0;
    text-align: center;
}

/* ── Search bar ──────────────────────────────────────────────── */
.tvzp-tv-content--top {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.tvzp-tv-search {
    display: flex;
    margin-bottom: 12px;
    flex: 1;
    gap: 5px;
}

.tvzp-tv-search__input {
    flex: 1;
    min-width: 0;
    outline: none;
    padding: 0 16px;
    box-sizing: border-box;
}

.tvzp-tv-search__btn {
    cursor: pointer;
    border: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #cc0000;
    color: #fff;
    padding: 0 24px;
}

/* ── Search button spinner ───────────────────────────────────── */
.tvzp-tv-search__btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tvzp-spin .6s linear infinite;
    flex-shrink: 0;
}

.tvzp-tv-search__btn.is-loading .tvzp-tv-search__btn-spinner {
    display: inline-block;
}

.tvzp-tv-search__btn.is-loading .tvzp-tv-search__btn-text {
    opacity: .7;
}

/* ── Active filter chips bar ─────────────────────────────────── */
.tvzp-tv-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    padding: 8px 12px;
    background: #cb01001f;
    border-radius: 6px;
}

.tvzp-tv-active-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.tvzp-tv-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #cc0000;
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: tvzp-chip-in .2s ease;
}

.tvzp-tv-chip__remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 2px;
    opacity: .75;
    transition: opacity .15s;
}

.tvzp-tv-chip__remove:hover {
    opacity: 1;
}

.tvzp-tv-active-filters__reset {
    background: none;
    border: 1px solid #ccc;
    color: #555;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s;
}

.tvzp-tv-active-filters__reset:hover {
    background: #cc0000;
    color: #fff;
    border-color: #cc0000;
}

/* ── Grid loader overlay ─────────────────────────────────────── */
.tvzp-tv-grid-wrap {
    position: relative;
}

.tvzp-tv-loader {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .75);
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.tvzp-tv-loader.is-active {
    display: flex;
}

.tvzp-tv-loader__ring {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #cc0000;
    border-radius: 50%;
    animation: tvzp-spin .7s linear infinite;
}

/* ── Card ────────────────────────────────────────────────────── */
.tvzp-tv-card {
    transition: transform .25s ease, box-shadow .25s ease;
}

/* ── Card thumbnail ──────────────────────────────────────────── */
.tvzp-tv-card__thumb {
    position: relative;
    overflow: hidden;
    padding-bottom: 56.25%;  /* 16:9 */
    background: #111;
}

.tvzp-tv-card__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tvzp-tv-card__thumb-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ── Play button ─────────────────────────────────────────────── */
.tvzp-tv-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #cc0000;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: background-color .2s, transform .2s;
}

.tvzp-tv-card__play:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.tvzp-tv-card__play i{
    font-size: 20px;
}
.tvzp-tv-card__play svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ── Download button ─────────────────────────────────────────── */
.tvzp-tv-card__download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, color .2s;
    background-color: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    margin-top: 16px;
}

.tvzp-tv-card__download i,
.tvzp-tv-card__download svg {
    font-size: 14px;
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ── Load More button ────────────────────────────────────────── */
.tvzp-tv-viewall-wrap {
    text-align: center;
}

.tvzp-tv-viewall {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background-color: #cc0000;
    color: #fff;
    transition: background-color .2s, color .2s;
    padding: 12px 36px;
}

.tvzp-tv-loadmore__spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tvzp-spin .6s linear infinite;
    flex-shrink: 0;
}

.tvzp-tv-viewall.is-loading .tvzp-tv-loadmore__spinner {
    display: inline-block;
}

.tvzp-tv-viewall.is-loading .tvzp-tv-loadmore__text {
    opacity: .7;
}

/* ── Sidebar & filter ────────────────────────────────────────── */
.tvzp-tv-filter__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tvzp-tv-filter__item {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border: none;
    background: none;
}

.tvzp-tv-sidebar__close {
    display: none;
}

/* ── Burger button ───────────────────────────────────────────── */
.tvzp-tv-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-bottom: 12px;
}

.tvzp-tv-burger span {
    /*display: block;*/
    /*width: 24px;*/
    /*height: 2px;*/
    /*background: currentColor;*/
    /*border-radius: 2px;*/
    transition: transform .25s, opacity .25s;
}

/* ── Sidebar backdrop (mobile) ───────────────────────────────── */
.tvzp-tv-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1999;
    background: rgba(0, 0, 0, .45);
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes tvzp-spin {
    to { transform: rotate(360deg); }
}

@keyframes tvzp-chip-in {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Show burger */
    .tvzp-tv-burger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Sidebar becomes a slide-in drawer */
    .tvzp-tv-sidebar {
        position: fixed !important;
        top: 0;
        left: -100%;
        bottom: 0;
        width: 80% !important;
        min-width: 0 !important;
        max-width:400px;
        z-index: 2000;
        overflow-y: auto;
        transition: left .3s ease;
        background: #fff;
        box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
    }

    .tvzp-tv-sidebar.is-open {
        left: 0;
    }

    .tvzp-tv-sidebar-backdrop.is-open {
        display: block;
    }

    /* Close X inside drawer */
    .tvzp-tv-sidebar__close {
        display: block;
        right: 12px;
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        line-height: 1;
        margin-bottom: 5px;
    }
    .tvzp-tv-filter__heading {
       display: flex;
       align-items: center;
       justify-content: space-between;
    }

    /* Stack layout */
    .tvzp-tv-layout {
        flex-direction: column;
    }

    .tvzp-tv-content {
        width: 100%;
    }

    .tvzp-tv-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Video modal ─────────────────────────────────────────────── */
.tvzp-tv-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .88);
    align-items: center;
    justify-content: center;
}

.tvzp-tv-modal.is-open {
    display: flex;
}

.tvzp-tv-modal__inner {
    position: relative;
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
}

.tvzp-tv-modal__inner iframe,
.tvzp-tv-modal__inner video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

.tvzp-tv-modal__close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: opacity .2s;
}

.tvzp-tv-modal__close:hover {
    opacity: .7;
}
