/* Custom Multipage Ads Plugin Styles - Enhanced */

/* Popup Enhancements */
#cma-popup .cma-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1;
}

#cma-popup .cma-overlay.cma-blur {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#cma-popup .cma-popup-content {
    position: relative;
    z-index: 2;
}

.cma-timer {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 3;
}

/* Custom Size Popup Style */
#cma-popup.custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cma-popup.custom .cma-popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    position: relative;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Remove screenshot overlay style */

/* In-Article Ads */
.cma-inarticle-ad {
    margin: 20px 0;
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Homepage Ads */
.cma-homepage-ad {
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    background: #f8f9fa;
    border: 2px solid #0073aa;
    border-radius: 8px;
}

/* Time-Based Ads */
.cma-time-based-ad {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

/* Virtual Page Ads */
.cma-virtual-page-ad {
    margin: 15px 0;
    padding: 12px;
    text-align: center;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
}

/* Page Info Display - Admin Only */
.cma-page-info {
    background: #e7f3ff;
    border: 1px solid #0073aa;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-weight: bold;
    color: #0073aa;
    text-align: center;
    font-size: 12px;
}

/* Virtual Pagination */
.cma-virtual-pagination {
    margin: 20px 0;
}

.cma-virtual-content {
    margin-bottom: 20px;
    line-height: 1.6;
}

.cma-virtual-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-top: 20px;
}

.cma-virtual-prev, .cma-virtual-next {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.3s;
}

.cma-virtual-prev:hover, .cma-virtual-next:hover {
    background: #005a87;
}

.cma-virtual-counter {
    font-weight: bold;
    color: #333;
}

/* Multipage Navigation */
.cma-multipage-container {
    margin: 20px 0;
}

.cma-multipage-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-top: 20px;
}

.cma-prev-page, .cma-next-page {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.3s;
}

.cma-prev-page:hover, .cma-next-page:hover {
    background: #005a87;
}

.cma-page-counter {
    font-weight: bold;
    color: #333;
}

/* Popup Templates */
#cma-popup.default {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}

#cma-popup.default .cma-popup-content {
    background: #fff;
    padding: 20px;
    margin: 50px auto;
    width: 90%;
    max-width: 400px;
    position: relative;
    border-radius: 5px;
}

#cma-popup.fullscreen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
}

#cma-popup.fullscreen .cma-popup-content {
    background: #fff;
    padding: 30px;
    margin: 10% auto;
    width: 80%;
    max-width: 600px;
    position: relative;
    border-radius: 5px;
}

#cma-popup.slide-in {
    display: none;
    position: fixed;
    top: 20%;
    right: -400px;
    width: 350px;
    background: #fff;
    padding: 20px;
    z-index: 9999;
    border-radius: 5px 0 0 5px;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.3);
    transition: right 0.5s ease;
}

#cma-popup.slide-in.show {
    right: 0;
}

.cma-popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

/* Floating Ads */
#cma-floating-ads {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    transition: all 0.3s ease;
}

#cma-floating-ads:hover {
    transform: scale(1.05);
}

/* Infinite Scroll Loading */
#cma-loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.cma-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: cma-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes cma-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cma-multipage-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    #cma-popup.default .cma-popup-content,
    #cma-popup.fullscreen .cma-popup-content {
        width: 95%;
        margin: 20px auto;
        padding: 15px;
    }
    
    #cma-popup.slide-in {
        width: 280px;
        right: -280px;
    }
    
    #cma-floating-ads {
        bottom: 10px;
        right: 10px;
        max-width: 250px;
    }
}

/* AMP Compatibility */
.cma-amp-hide {
    display: none !important;
}

/* Anti-Adblock Message */
#cma-adblock-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

#cma-adblock-message h2 {
    color: #d63638;
    margin-bottom: 20px;
}
