/* Base Ad Container */
#quaker-ad-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    background: transparent !important;
    -webkit-background: transparent !important;
    z-index: 999999 !important;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Iframe Base Styling */
#quaker-ad-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    margin: 0;
    padding: 0;
    background: transparent !important;
    -webkit-background: transparent !important;
    pointer-events: auto !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Video Container Inside Iframe */
.video-container {
    position: relative;
    width: auto;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: transparent;
}

/* Video Element Styling */
.video-container video {
    height: 100%;
    width: auto;
    pointer-events: none;
    object-fit: contain;
}

/* Click Overlay */
.click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10;
    pointer-events: auto;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 0, 0, 1);
}

/* Animation for Close Button */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn.show {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    #quaker-ad-container {
        align-items: center;
    }

    .video-container video {
        width: 100%;
        height: auto;
    }

    .close-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* Ensure Accessibility */
.close-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Hide on Print */
@media print {
    #quaker-ad-container {
        display: none !important;
    }
}
#quaker-ad-container, 
#quaker-ad-container iframe,
#quaker-ad-container video {
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}
