/* ==========================================================================
   VSPhim Ads Pro — Clean, High-CTR, Logical Multi-Zone Styling
   ========================================================================== */

.vp-ad-top-wrap {
    padding: 12px 0 6px;
}

.vp-ad-top-wrap:has(#top_addd:empty) {
    display: none;
    padding: 0;
}

.vp-ad-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 1120px;
    margin: 0 auto;
    align-items: center;
}

.vp-ad-grid.vp-ad-single {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.vp-ad-grid:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.vp-ad-mid-wrap {
    margin: 0 auto 32px;
}

.vp-ad-player-slot {
    margin: 0 auto 14px;
}

.vp-ad-under-slot {
    margin: 14px auto 6px;
}

.vp-ad-bottom-wrap {
    padding: 4px 0 26px;
}

.vp-ad-bottom-wrap:has(#bottom_before_footer_ads:empty) {
    display: none;
    padding: 0;
}

.vp-ad-banner-item {
    display: block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #10141f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 0;
}

.vp-ad-banner-item:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 197, 24, 0.55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.vp-ad-banner-item img {
    width: 100%;
    height: auto;
    max-height: 82px;
    object-fit: cover;
    display: block;
}

.vp-ad-tag {
    position: absolute;
    top: 4px;
    left: 5px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(8, 10, 16, 0.78);
    color: #f5c518;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    pointer-events: none;
    text-transform: uppercase;
}

/* ---------- Floating Side Banners (Desktop >= 1440px only so never covers cards) ---------- */
.vp-side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 148px;
    z-index: 900;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.vp-side-ad.vp-side-left {
    left: 10px;
}

.vp-side-ad.vp-side-right {
    right: 10px;
}

@media (min-width: 1460px) {
    .vp-side-ad.vp-side-active {
        display: flex;
    }
}

.vp-side-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #10141f;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.vp-side-card img {
    width: 100%;
    height: auto;
    display: block;
}

.vp-ad-close-sm {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(8, 10, 16, 0.88);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    padding: 0;
}

.vp-ad-close-sm:hover {
    background: #ff2e55;
    border-color: #ff2e55;
}

/* ---------- Floating Corner Balloon Banner ---------- */
#vp_balloon_ads {
    position: fixed;
    right: 16px;
    bottom: 96px;
    z-index: 950;
    width: 270px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#vp_balloon_ads:empty {
    display: none;
}

.vp-balloon-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #121623;
    border: 1px solid rgba(245, 197, 24, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72);
    animation: vpFadeUp 0.35s ease;
}

.vp-balloon-card img {
    width: 100%;
    height: auto;
    max-height: 110px;
    object-fit: cover;
    display: block;
}

/* ---------- Catfish Sticky Footer Banner ---------- */
#footer_fixed_ads {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 960;
    pointer-events: none;
    padding: 0 10px 8px;
}

#footer_fixed_ads:empty {
    display: none;
}

.banner-sticky-footer-wrapper {
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.vp-catfish-box {
    position: relative;
    pointer-events: auto;
    width: 100%;
    max-width: 780px;
    background: rgba(10, 12, 18, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.65);
}

.vp-catfish-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.vp-catfish-grid.vp-ad-single {
    grid-template-columns: 1fr;
}

.vp-catfish-grid a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.vp-catfish-grid img {
    width: 100%;
    height: auto;
    max-height: 64px;
    object-fit: cover;
    display: block;
}

.vp-catfish-close {
    position: absolute;
    top: -12px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #141926;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    padding: 0;
    line-height: 1;
}

.vp-catfish-close:hover {
    background: #ff2e55;
    border-color: #ff2e55;
}

/* ---------- Modern Cinema Popup Modal (#overlay) ---------- */
#overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 7, 12, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
}

#overlay.vp-popup-open {
    display: flex;
    animation: vpFadeIn 0.25s ease;
}

.overlay_block {
    position: relative;
    max-width: 580px;
    width: auto;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
    animation: vpZoomIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.overlay_block .cls_ov {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #111520;
    border: 2px solid rgba(255, 255, 255, 0.75);
    color: #fff !important;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

.overlay_block .cls_ov:hover {
    background: #ff2e55;
    border-color: #ff2e55;
}

.overlay_block .vp-popup-link {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
}

.overlay_block .vp-popup-link img {
    width: 100%;
    height: auto;
    max-height: 76vh;
    object-fit: contain;
    display: block;
}

/* Ensure footer content isn't hidden under Catfish sticky bar */
#footer {
    padding-bottom: 92px !important;
}

@keyframes vpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vpZoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes vpFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mobile Responsive (Coordinates cleanly with Mobile Bottom App Bar) ---------- */
@media (max-width: 991px) {
    #footer_fixed_ads {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
        padding: 0 8px 6px;
    }
    #vp_balloon_ads {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .vp-ad-top-wrap {
        padding: 8px 0 4px;
    }
    .vp-ad-grid,
    .vp-catfish-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .vp-ad-banner-item img {
        max-height: 54px;
    }
    .vp-catfish-box {
        padding: 4px;
        border-radius: 10px;
    }
    .vp-catfish-grid img {
        max-height: 46px;
    }
    .vp-catfish-close {
        width: 24px;
        height: 24px;
        font-size: 14px;
        top: -10px;
        right: -6px;
    }
    .overlay_block {
        max-width: 90vw;
    }
    .overlay_block .cls_ov {
        top: -12px;
        right: -8px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}
