/**
 * RD48 Ads Manager - Frontend Styles
 */

/* Base ad styles */
.rd48-ad {
    margin: 20px 0;
    text-align: center;
}

.rd48-ad__custom,
.rd48-ad__external {
    display: inline-block;
    max-width: 100%;
}

.rd48-ad__image {
    max-width: 100%;
    height: auto;
    display: block;
}

.rd48-ad__custom a {
    display: block;
    text-decoration: none;
}

/* Zone-specific styles */
.rd48-ad--header {
    margin: 10px 0;
}

.rd48-ad--sidebar {
    margin: 15px 0;
}

.rd48-ad--sidebar-item {
    margin-bottom: 20px;
}

.rd48-ad--content {
    margin: 25px auto;
    padding: 15px 0;
    clear: both;
}

.rd48-ad--footer {
    margin: 20px 0;
}

/* Popup styles */
.rd48-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rd48-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.rd48-popup__container {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    z-index: 1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.rd48-popup__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    z-index: 2;
}

.rd48-popup__close:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.rd48-popup__content {
    padding: 0;
}

.rd48-popup__content .rd48-ad__image {
    border-radius: 8px;
}

.rd48-popup__content .rd48-ad__external {
    padding: 20px;
}

/* Animation */
.rd48-popup.rd48-popup--visible {
    animation: rd48FadeIn 0.3s ease-out;
}

.rd48-popup.rd48-popup--hiding {
    animation: rd48FadeOut 0.3s ease-out forwards;
}

@keyframes rd48FadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes rd48FadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .rd48-popup__container {
        max-width: 95%;
        margin: 10px;
    }

    .rd48-popup__close {
        top: -8px;
        right: -8px;
        width: 28px;
        height: 28px;
        font-size: 20px;
    }

    .rd48-ad--content {
        margin: 15px auto;
        padding: 10px 0;
    }
}
