/**
 * Ad Popup Styles
 */

/* Prevent body scroll when popup is open */
body.ad-popup-open {
    overflow: hidden;
}

/* Wrapper - covers entire viewport */
.ad-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
}

.ad-popup-wrapper.ad-popup-visible {
    pointer-events: auto;
}

/* Overlay */
.ad-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-popup-wrapper.ad-popup-animate .ad-popup-overlay {
    opacity: 1;
}

/* Popup container */
.ad-popup {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ad-popup-wrapper.ad-popup-animate .ad-popup {
    opacity: 1;
}

/* Close button */
.ad-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.ad-popup-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Content */
.ad-popup-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-popup-content .ad-item {
    display: block;
}

.ad-popup-content .ad-image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* =========================================
   POSITIONS
   ========================================= */

/* Center (Modal) */
.ad-popup--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: calc(100% - 40px);
}

.ad-popup-wrapper.ad-popup-animate .ad-popup--center {
    transform: translate(-50%, -50%) scale(1);
}

/* Bottom (Banner) */
.ad-popup--bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0;
    max-width: 100% !important;
    transform: translateY(100%);
}

.ad-popup-wrapper.ad-popup-animate .ad-popup--bottom {
    transform: translateY(0);
}

.ad-popup--bottom .ad-popup-close {
    top: 50%;
    transform: translateY(-50%);
    right: 16px;
}

.ad-popup--bottom .ad-popup-content {
    padding: 16px;
}

/* Top Right (Corner) */
.ad-popup--top-right {
    top: 20px;
    right: 20px;
    transform: translateX(120%);
}

.ad-popup-wrapper.ad-popup-animate .ad-popup--top-right {
    transform: translateX(0);
}

/* Bottom Right (Corner) */
.ad-popup--bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translateX(120%);
}

.ad-popup-wrapper.ad-popup-animate .ad-popup--bottom-right {
    transform: translateX(0);
}

/* =========================================
   STYLES
   ========================================= */

/* Modal style (default) */
.ad-popup--modal {
    padding: 0;
}

/* Slide-in style */
.ad-popup--slide-in {
    border-radius: 12px;
}

/* Floating banner style */
.ad-popup--floating-banner {
    border-radius: 4px;
}

.ad-popup--floating-banner .ad-popup-close {
    width: 24px;
    height: 24px;
    top: 4px;
    right: 4px;
}

.ad-popup--floating-banner .ad-popup-close svg {
    width: 14px;
    height: 14px;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .ad-popup--center {
        width: calc(100% - 20px);
    }

    .ad-popup--top-right,
    .ad-popup--bottom-right {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px) !important;
    }

    .ad-popup--top-right {
        top: 10px;
    }

    .ad-popup--bottom-right {
        bottom: 10px;
    }

    .ad-popup-close {
        width: 28px;
        height: 28px;
    }
}

/* =========================================
   AD CONTENT STYLES
   ========================================= */

.ad-popup .ad-link {
    display: block;
}

.ad-popup .ad-html {
    padding: 20px;
}

/* =========================================
   AJAX LOADING
   ========================================= */

.ad-popup-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2rem;
    z-index: 100000;
}
