/* v1.3.7 PUSHDOWN RESPONSIVENESS FIX */
.mfadw-ad-container{display:none;position:relative;box-sizing:border-box}

/* --- Image and Inner Container Styling --- */
.mfadw-ad-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* FIX: Ensure the image link itself spans full inner dimensions for proper centering */
.mfadw-ad-container.has-image .mfadw-image-link {
    width: 100%; 
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Max content width for Pushdown, Sticky Top, Sticky Bottom to respect the 1490px spec */
#mfadw-pushdown-ad .mfadw-ad-inner,
#mfadw-sticky-top-ad .mfadw-ad-inner,
#mfadw-sticky-bottom-ad .mfadw-ad-inner {
    max-width: 1490px; /* Content constrained to 1490px max */
    margin: 0 auto;
}

/* Image scaling rules: maintain aspect ratio, use full height/width available in container */
.mfadw-wrapper img{
    height: 100%; /* Uses the height of the ad container */
    max-width: 100%;
    width: auto; /* Scales width based on aspect ratio */
    object-fit: contain; /* CRITICAL: Prevents distortion (e.g., squishing) */
    display: block;
    margin: 0 auto;
}
.mfadw-ad-container.has-image .mfadw-text {
    display: none; /* Prevents text overlap when image is present */
}

/* --- 1. PUSHDOWN (30% of page height, max 1490px content width) --- */

#mfadw-pushdown-ad{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:30vh; 
    z-index:9999;
    background:#000;
    transition:transform .4s ease-out,opacity .4s ease-out
}
body.mfadw-pushdown-active{
    margin-top:30vh; 
    transition:margin-top .4s ease-out
}

/* --- 2. STICKY TOP (150px height, max 1490px content width) --- */
#mfadw-sticky-top-ad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px; 
    background: #000;
    z-index: 9998;
    padding: 4px 0; 
}

/* --- 3. STICKY BOTTOM / Sticky Footer (Bottom of page, 30% of page shrinks to 100px) --- */
#mfadw-sticky-bottom-ad{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    height:30vh; /* Default height is 30% of viewport height */
    max-height: 30vh;
    min-height: 100px; /* NEW: Enforces the 100px minimum height */
    background:#000;
    z-index:9999;
    padding:4px 0;
}

/* --- 4. OFFERWALL (1/3 VW x 1/3 VH, centered, overlaps content) --- */
#mfadw-offerwall-ad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 0;
}
#mfadw-offerwall-ad .mfadw-ad-inner {
    /* Set dimensions based on 1/3 viewport */
    width: 33.33vw;
    height: 33.33vh;
    max-width: 100%; 
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative; 
    padding: 0; 
}
/* Position the close button relative to the inner block for Offerwall */
#mfadw-offerwall-ad .mfadw-close-btn {
    position: absolute;
    right: -15px; 
    top: -15px;
    background: red; 
    border-color: #fff;
}


/* --- Banner Mobile Ad Styles (Assumed inline/non-fixed) --- */
#mfadw-banner-mobile-ad {
    position: relative; 
    margin: 15px auto;
    width: 95%; 
    max-width: 728px;
    height: auto;
    min-height: 50px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
}

/* --- Text-only Styles --- */
.mfadw-ad-container.has-text .mfadw-ad-inner {
    padding: 10px;
    flex-direction: column;
}
.mfadw-text{color:#fff;text-align:center}
.mfadw-ad-button{background:#00d1b2;color:#fff;padding:6px 14px;border-radius:20px;text-decoration:none}

/* --- Close Button Styles (Default placement for other formats) --- */
.mfadw-close-btn:not(#mfadw-offerwall-ad .mfadw-close-btn){
    position:absolute;
    right:10px;
    top:10px;
    background:rgba(0, 0, 0, 0.5); 
    color:#fff;
    border:1px solid #fff;
    border-radius:50%;
    width:30px;
    height:30px;
    line-height:28px;
    text-align:center;
    font-size:20px;
    cursor:pointer;
    z-index:10001;
    transition: background-color 0.2s;
}
.mfadw-close-btn:hover {
    background-color: rgba(255, 0, 0, 0.8);
}

/* Media Queries for Mobile Responsiveness */
@media(max-width:768px){
    /* Pushdown height for mobile */
    #mfadw-pushdown-ad{height:100px} 
    body.mfadw-pushdown-active{margin-top:100px}
    
    /* Sticky bottom/top takes less height on mobile */
    #mfadw-sticky-bottom-ad,
    #mfadw-sticky-top-ad {
        height: 100px; 
    }
    
    /* Offerwall on mobile should take a larger portion of the screen */
    #mfadw-offerwall-ad .mfadw-ad-inner {
        width: 80vw;
        height: 50vh;
    }
}
