/* ===== Image Popup Slider — Popup Ad Style ===== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* Overlay — dim the page */
#ips-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.72) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#ips-overlay.ips-ready {
    animation: ips-fade-in 0.35s ease forwards;
    pointer-events: auto;
}

#ips-overlay.ips-hiding {
    animation: ips-fade-out 0.3s ease forwards;
    pointer-events: none;
}

@keyframes ips-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ips-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ---- Ad Card ---- */
#ips-popup {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    max-width: 480px;
    width: 100%;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.08),
        0 12px 40px rgba(0,0,0,0.35),
        0 0 0 1px rgba(0,0,0,0.06);
    animation: ips-pop-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    display: flex;
    flex-direction: column;
}

@keyframes ips-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- Ad Header Bar ---- */
#ips-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: #f7f7f7;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

#ips-ad-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #999;
}

/* Timer lives in the header, inline */
#ips-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#ips-timer-text {
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
    white-space: nowrap;
}

#ips-timer-badge {
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
    min-width: 24px;
    text-align: center;
    font-family: 'Inter', monospace;
}

/* ---- Close Button — top-right of card ---- */
#ips-close {
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 30;
    background: none;
    border: none;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    line-height: 1;
}

#ips-close:hover {
    background: #e8e8e8;
    color: #222;
}

/* ---- Slider ---- */
#ips-slider-wrap {
    overflow: hidden;
    position: relative;
    width: 100%;
    background: #111;
    /* Fixed ad-style ratio: 4:3 */
    aspect-ratio: 4 / 3;
    max-height: 360px;
    flex-shrink: 0;
}

#ips-slider {
    display: flex;
    height: 100%;
    transition: transform 0.42s cubic-bezier(0.77, 0, 0.18, 1);
}

.ips-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;
    display: block;
}

.ips-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    display: block;
    -webkit-user-drag: none;
}

/* ---- Nav Arrows — inside the image ---- */
.ips-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.42);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    padding: 0;
}

.ips-arrow:hover {
    background: rgba(0,0,0,0.72);
}

#ips-prev { left: 10px; }
#ips-next { right: 10px; }

/* ---- Dots — over the image at bottom ---- */
#ips-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.ips-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.ips-dot.active {
    background: #fff;
    transform: scale(1.35);
}

/* ---- Bottom CTA Bar ---- */
#ips-ad-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #ebebeb;
    flex-shrink: 0;
}

#ips-counter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
}

#ips-ad-skip {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.15s;
}

#ips-ad-skip:hover { color: #333; }

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

@media (max-width: 540px) {
    #ips-overlay { padding: 12px; }

    #ips-popup {
        max-width: 100%;
        border-radius: 8px;
    }

    #ips-slider-wrap {
        max-height: 280px;
    }

    .ips-arrow { width: 30px; height: 30px; }
}

@media (max-width: 380px) {
    #ips-prev, #ips-next { display: none; }

    #ips-timer-text { display: none; }

    #ips-ad-header { padding: 8px 12px; }
    #ips-ad-footer { padding: 8px 12px; }

    #ips-slider-wrap { max-height: 240px; }
}
