/* Video guides page – builds on free-pdf-guides.css (library, filters, search) */

.video-page .is-pte { --exam: #0d56f9; --exam-soft: #eef4ff; }
.video-page .is-ielts { --exam: #e31837; --exam-soft: #fdeef0; }
.video-page .is-det { --exam: #4fae00; --exam-soft: #effae6; }
.video-page .is-celpip { --exam: #a8935a; --exam-soft: #f8f4ea; }
.video-page .is-study { --exam: #0e9f8a; --exam-soft: #e7f7f4; }
.video-page .is-platform { --exam: #6a4cf5; --exam-soft: #f0edff; }

body.vid-modal-open {
    overflow: hidden;
}

/* ---------- Hero ---------- */
.vid-hero {
    background: linear-gradient(180deg, #f5faff 0%, #fff 100%);
}

.vid-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.vid-hero-content {
    max-width: 640px;
}

.vid-hero-content p {
    margin: 22px 0 34px;
    line-height: 190%;
    color: var(--pdf-ink);
    max-width: 570px;
}

.vid-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.vid-hero-actions .comman-btn {
    position: relative;
    overflow: hidden;
}

.vid-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 22px;
    border: 1.5px solid var(--pdf-line);
    border-radius: 10px;
    background: #fff;
    color: var(--pdf-ink);
    font-weight: 700;
    transition: 0.2s ease-out;
}

.vid-subscribe:hover {
    border-color: #ff0000;
    color: var(--pdf-ink);
}

.vid-hero-feature {
    flex: 0 0 500px;
    max-width: 500px;
    background: #fff;
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 24px 60px rgba(13, 40, 120, 0.14);
}

.vid-hero-caption {
    padding: 16px 8px 6px;
}

.vid-hero-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ff0000;
    background: #fff0f0;
    border-radius: 5px;
    padding: 3px 8px;
    margin-bottom: 8px;
}

.vid-hero-caption strong {
    display: block;
    font-size: 17px;
    line-height: 145%;
    color: var(--pdf-ink);
}

.vid-hero-caption > span:last-child {
    display: block;
    font-size: 14px;
    color: var(--pdf-muted);
    margin-top: 4px;
}

/* ---------- Category icons for non-exam tabs ---------- */
.vid-cat-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--exam-soft);
    color: var(--exam);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pdf-filter-block[hidden] {
    display: none;
}

/* ---------- Thumbnail ---------- */
.vid-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #dfe6f1;
}

.vid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease-out;
}

.vid-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border-radius: 50%;
    background: rgba(13, 86, 249, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: scale(0.85);
    transition: 0.25s ease-out;
}

.vid-hero-feature .vid-play {
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    opacity: 1;
    transform: none;
}

.vid-duration,
.vid-new {
    position: absolute;
    bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border-radius: 5px;
    padding: 2px 7px;
}

.vid-duration {
    right: 8px;
    background: rgba(0, 0, 0, 0.78);
}

.vid-new {
    left: 8px;
    background: #ff3b30;
    letter-spacing: 0.4px;
}

/* ---------- Video grid ---------- */
.vid-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 20px;
}

/* The list dividers from the PDF library do not apply to the grid */
.vid-library .vid-grid .pdf-item {
    border-top: 0 !important;
}

.vid-card {
    display: block;
    height: 100%;
    border-radius: 14px;
    padding: 8px 8px 12px;
    transition: background 0.2s ease-out;
}

.vid-card:hover,
.vid-card:focus-visible {
    background: #fff;
    box-shadow: 0 10px 28px rgba(13, 40, 120, 0.08);
}

.vid-card:hover .vid-thumb img {
    transform: scale(1.04);
}

.vid-card:hover .vid-play,
.vid-card:focus-visible .vid-play {
    opacity: 1;
    transform: scale(1);
}

.vid-card-body {
    display: block;
    padding: 12px 4px 0;
}

.vid-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 16px;
    font-weight: 500;
    line-height: 145%;
    color: var(--pdf-ink);
}

.vid-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--pdf-muted);
    margin-top: 6px;
}

/* ---------- Player popup ---------- */
.vid-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vid-modal[hidden] {
    display: none;
}

.vid-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 14, 33, 0.82);
}

.vid-modal-box {
    position: relative;
    width: 100%;
    max-width: 960px;
    background: #0b1020;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.vid-modal-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 12px 12px 20px;
}

.vid-modal-head p {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vid-modal-close {
    flex: 0 0 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vid-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vid-modal-frame {
    aspect-ratio: 16 / 9;
    background: #000;
}

.vid-modal-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.vid-modal-youtube {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #c9d4ff;
}

.vid-modal-youtube:hover {
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .vid-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .vid-hero-feature {
        flex-basis: 420px;
    }
}

@media (max-width: 991px) {
    .vid-hero-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 36px;
    }
    .vid-hero-feature {
        flex-basis: auto;
        max-width: 560px;
    }
}

@media (max-width: 767px) {
    .vid-grid {
        gap: 12px;
    }
    .vid-card {
        padding: 6px 6px 10px;
    }
    .vid-card-title {
        font-size: 15px;
    }
    .vid-play {
        opacity: 1;
        transform: none;
        width: 44px;
        height: 44px;
        margin: -22px 0 0 -22px;
    }
    .vid-hero-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .vid-modal {
        padding: 0;
    }
    .vid-modal-box {
        border-radius: 0;
    }
}

@media (max-width: 575px) {
    .vid-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
