/* Smart Ads Pro - Frontend Styles */

/* Base container styles */
.smart-ads-pro-container {
    display: block;
    margin: 10px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Position-specific styles */
.smart-ads-header_top,
.smart-ads-header_bottom {
    margin: 15px 0;
}

.smart-ads-sidebar_top,
.smart-ads-sidebar_middle,
.smart-ads-sidebar_bottom {
    margin: 20px 0;
}

.smart-ads-content_top,
.smart-ads-content_middle,
.smart-ads-content_bottom {
    margin: 20px 0;
    clear: both;
}

.smart-ads-footer_top,
.smart-ads-footer_bottom {
    margin: 15px 0;
}

/* Device-specific styles */
.smart-ads-device-mobile .smart-ads-pro-container {
    margin: 8px 0;
}

.smart-ads-device-desktop .smart-ads-pro-container {
    margin: 12px 0;
}

/* Ad type styles */
.smart-ads-type-display {
    display: block;
}

.smart-ads-type-popup {
    position: fixed;
    z-index: 999999;
}

.smart-ads-type-native {
    display: inline-block;
    vertical-align: top;
}

.smart-ads-type-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.smart-ads-type-video iframe,
.smart-ads-type-video object,
.smart-ads-type-video embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Sticky ad styles */
.smart-ads-sticky_top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.smart-ads-sticky_bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

/* Popup overlay styles */
.smart-ads-popup_overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-ads-popup_overlay .ad-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    max-width: 90vw;
    max-height: 90vh;
}

.smart-ads-popup_overlay .ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    z-index: 1;
}

/* Interstitial styles */
.smart-ads-interstitial {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.smart-ads-interstitial .ad-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.smart-ads-interstitial .ad-skip {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #000;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* Lazy loading styles */
.smart-ads-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.smart-ads-lazy.loaded {
    opacity: 1;
}

.smart-ads-lazy .ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    background: #f5f5f5;
    border: 1px dashed #ddd;
    color: #999;
    font-size: 14px;
}

/* Loading animation */
.smart-ads-loading {
    position: relative;
    overflow: hidden;
}

.smart-ads-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Network-specific styles */
.smart-ads-network-google_adsense .adsbygoogle {
    display: block;
}

.smart-ads-network-adstera,
.smart-ads-network-propeller_ads,
.smart-ads-network-pop_ads {
    text-align: center;
}

/* Size-specific styles */
.smart-ads-size-728-90 {
    max-width: 728px;
    height: 90px;
    margin: 0 auto;
}

.smart-ads-size-300-250 {
    max-width: 300px;
    height: 250px;
    margin: 0 auto;
}

.smart-ads-size-320-50 {
    max-width: 320px;
    height: 50px;
    margin: 0 auto;
}

.smart-ads-size-300-600 {
    max-width: 300px;
    height: 600px;
    margin: 0 auto;
}

.smart-ads-size-160-600 {
    max-width: 160px;
    height: 600px;
    margin: 0 auto;
}

/* Responsive styles */
@media (max-width: 768px) {
    .smart-ads-size-728-90 {
        max-width: 320px;
        height: 50px;
    }
    
    .smart-ads-size-300-600 {
        max-width: 300px;
        height: 250px;
    }
    
    .smart-ads-size-160-600 {
        max-width: 300px;
        height: 250px;
    }
    
    .smart-ads-sticky_top,
    .smart-ads-sticky_bottom {
        position: static;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .smart-ads-pro-container {
        margin: 5px 0;
    }
    
    .smart-ads-size-300-250 {
        max-width: 280px;
        height: 200px;
    }
    
    .smart-ads-popup_overlay .ad-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .smart-ads-pro-container {
        background: #1a1a1a;
        color: #fff;
    }
    
    .smart-ads-popup_overlay {
        background: rgba(0,0,0,0.9);
    }
    
    .smart-ads-popup_overlay .ad-content {
        background: #2a2a2a;
    }
    
    .smart-ads-interstitial {
        background: #1a1a1a;
    }
    
    .smart-ads-lazy .ad-placeholder {
        background: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
}

/* Print styles */
@media print {
    .smart-ads-pro-container {
        display: none !important;
    }
}

/* Accessibility */
.smart-ads-pro-container[aria-label] {
    /* Screen reader support */
}

.smart-ads-pro-container:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Animation for rotated ads */
.smart-ads-rotatable {
    transition: all 0.5s ease;
}

.smart-ads-rotatable.rotating {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Error states */
.smart-ads-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

/* Debug mode styles */
.smart-ads-debug {
    border: 2px dashed #ff9800;
    background: rgba(255, 152, 0, 0.1);
    position: relative;
}

.smart-ads-debug::before {
    content: attr(data-position) ' - ' attr(data-network);
    position: absolute;
    top: 0;
    left: 0;
    background: #ff9800;
    color: #fff;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
}

/* WebView optimizations */
.smart-ads-device-android .smart-ads-pro-container,
.smart-ads-device-ios .smart-ads-pro-container {
    /* Mobile WebView optimizations */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

/* AdBlocker detection message */
.smart-ads-blocked {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.smart-ads-blocked a {
    color: #856404;
    text-decoration: underline;
}

/* Custom scrollbar for overflow content */
.smart-ads-pro-container::-webkit-scrollbar {
    width: 8px;
}

.smart-ads-pro-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.smart-ads-pro-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.smart-ads-pro-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}