/**
 * Ad System Styles
 * Professional ad display styling
 */

/* Ad Wrapper Container */
.ad-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.ad-wrapper.ad-global-header,
.ad-wrapper.ad-global-footer {
    background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, transparent 100%);
    padding: 0.5rem 0;
}

/* Ad Unit */
.ad-unit {
    position: relative;
    display: inline-block;
    max-width: 100%;
    text-align: center;
}

/* Ad Image */
.ad-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ad-link:hover .ad-image {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Ad Link */
.ad-link {
    display: block;
    text-decoration: none;
}

/* Ad Code Container */
.ad-code {
    display: block;
    width: 100%;
    overflow: hidden;
}

/* Sidebar Ads */
.ad-sidebar {
    margin: 1.5rem 0;
}

.ad-sidebar .ad-unit {
    width: 100%;
}

.ad-sidebar .ad-image {
    width: 100%;
    border-radius: 8px;
}

/* Between Content Ads */
.ad-between-posts,
.ad-between-packages,
.ad-between-services {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin: 2rem 0;
}

/* Sticky Bottom Ad */
.ad-global-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    padding: 0.5rem;
    margin: 0;
}

.ad-global-sticky-bottom .ad-close {
    position: absolute;
    top: -10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup Ad */
.ad-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ad-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.ad-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .ad-wrapper {
        margin: 0.75rem 0;
    }

    .ad-desktop-only {
        display: none !important;
    }

    .ad-global-sticky-bottom {
        padding: 0.25rem;
    }
}

@media (min-width: 769px) {
    .ad-mobile-only {
        display: none !important;
    }
}

/* Ad Label (optional) */
.ad-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading State */
.ad-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ad-shimmer 1.5s infinite;
}

@keyframes ad-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* RTL Support */
[dir="rtl"] .ad-label {
    right: auto;
    left: 5px;
}

[dir="rtl"] .ad-popup-close {
    right: auto;
    left: -12px;
}

[dir="rtl"] .ad-global-sticky-bottom .ad-close {
    right: auto;
    left: 10px;
}
