/* AniWatch-style card hover popup — no blur anywhere */

/* ── Card wrapper ──────────────────────────────────── */
.videoPost {
    position: relative;
    overflow: visible !important;
    /* allow popup to escape card bounds */
}

/* Raise hovered card above siblings so popup renders on top */
.videoPost:hover {
    z-index: 100;
}

/* ── Dark overlay on thumbnail when popup is active ── */
.videoPost .image-wrapper {
    position: relative;
    overflow: hidden;
}

.videoPost .image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.videoPost:hover .image-wrapper::after {
    background: rgba(0, 0, 0, 0.4);
}

.videoPost .image-wrapper img {
    transition: filter 0.3s ease, transform 0.3s ease;
}

.videoPost:hover .image-wrapper img {
    filter: blur(4px);
    transform: scale(1.04);
}


.videoPost .tdtv-poster-wrap>.tdtv-card-popup__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 46px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 2;
    padding-left: 6px;
    /* center the triangle visually */
    margin-bottom: 0;
}

.videoPost:hover .tdtv-poster-wrap>.tdtv-card-popup__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}



/* ── Popup panel ────────────────────────────────────── */
/* Base position is a sensible default (card center). JS overrides with
   inline top/left computed from viewport — no !important here so inline wins. */
.tdtv-card-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    background: rgba(26, 26, 34, 0.85);
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.4);
    padding: 16px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s ease;
    color: #e0e0e0;
}

.videoPost:hover .tdtv-card-popup {
    opacity: 1;
    pointer-events: auto;
}

/* Prevent the popup from ever creating a horizontal scrollbar when it
   momentarily extends past the viewport edge before JS repositions it. */
html, body {
    overflow-x: clip;
}


/* Flip states handled dynamically by JS via top/bottom/left/right and offset variables */





/* ── Popup: play button (large, top area) ──────────── */
.tdtv-card-popup__play {
    font-size: 26px;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1;
}

/* ── Popup: title ───────────────────────────────────── */
.tdtv-card-popup__title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.35;
}

/* ── Popup: badges ──────────────────────────────────── */
.tdtv-card-popup__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tdtv-cpbadge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.6;
    letter-spacing: 0.03em;
}

.tdtv-cpbadge--hd {
    background: #2d6a4f;
    color: #b7e4c7;
    border: 1px solid #40916c;
}

.tdtv-cpbadge--type {
    background: #3a3a52;
    color: #b0b0d0;
    border: 1px solid #5a5a7a;
}

.tdtv-cpbadge--views {
    background: #2a2a3a;
    color: #9090b0;
    border: 1px solid #4a4a6a;
}

/* ── Popup: description ─────────────────────────────── */
.tdtv-card-popup__desc {
    font-size: 12.5px;
    line-height: 1.55;
    color: #a0a0b8;
    margin: 0 0 12px;
    text-align: left;
}

/* ── Popup: metadata rows ───────────────────────────── */
.tdtv-card-popup__meta {
    font-size: 12px;
    color: #8888a8;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.tdtv-card-popup__meta-key {
    color: #c0c0d8;
    font-weight: 600;
}

/* ── Popup: actions ─────────────────────────────────── */
.tdtv-card-popup__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tdtv-card-popup__watch-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #ffdd95;
    color: #1a1a00;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 16px;
    border-radius: 30px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.12s ease;
    border: none;
    cursor: pointer;
}

.tdtv-card-popup__watch-btn:hover {
    background: #ffe9a8;
    color: #1a1a00;
    transform: translateY(-1px);
    text-decoration: none;
}

/* ── Thumbnail duration badge ───────────────────────── */
.thumbDuration {
    z-index: 3;
}

/* ── Hide popup on small screens (no hover support) ─── */
@media (max-width: 768px) {
    .tdtv-card-popup {
        display: none;
    }

    .videoPost:hover .image-wrapper::after {
        background: rgba(0, 0, 0, 0);
    }

    .videoPost:hover .tdtv-card-play-icon {
        opacity: 0;
    }
}