/**
 * Common advert popup styles – templates & campaigns
 * Used by: adverts_popup_template/index.blade.php, adverts_popup_template/campaigns.blade.php
 */

/* ── grid card (templates and campaigns) ───────────────────────────── */
.popup-campaign-card,
.popup-template-card {
    border: 2px solid #e3e6ef;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
}
.popup-campaign-card:hover,
.popup-template-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
    transform: translateY(-2px);
}

.popup-card-thumb {
    height: 380px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.popup-card-thumb .grid-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
    background: #fff;
}
.popup-card-thumb .grid-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── eye / preview button ──────────────────────────────────────────── */
.popup-eye-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}
.popup-campaign-card:hover .popup-eye-btn,
.popup-template-card:hover .popup-eye-btn {
    opacity: 1;
}
.popup-eye-btn:hover {
    transform: scale(1.12);
}
.popup-eye-btn i {
    font-size: 1.15rem;
}

/* ── card checkbox ───────────────────────────────────────────────── */
.popup-card-check {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    z-index: 2;
    cursor: pointer;
}
.popup-card-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── preview modal (no iframe): overlay + modal box + close X top right ──────────────────── */
.advert-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}
.advert-preview-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 64px rgba(0,0,0,.45);
    overflow: hidden;
    /* width/height set inline by JS from popup_width, popup_height */
}
.advert-preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0,0,0,.2);
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    color: #333;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.advert-preview-close:hover {
    background: #fff;
    color: #000;
    border-color: #000;
}
.advert-preview-modal-body {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.advert-preview-modal-body > * {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1;
    min-height: 0;
    box-sizing: border-box !important;
}
.advert-preview-modal-body table {
    width: 100% !important;
    max-width: 100% !important;
}
.advert-preview-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0 0 8px 8px;
}

.u_content_html {
    padding: 0px !important;
}