/* ==========================================================================
   Instagram Follow Reward Popup — popup.css
   ========================================================================== */

/* ── CSS custom properties (set by JS for gradient button) ── */
:root {
    --irp-btn-from: #f09433;
    --irp-btn-to:   #E1306C;
}

/* ── Overlay ── */
#irp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 15, 15, 0.60);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    /* Fade controlled via JS class */
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#irp-overlay.irp-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Popup card ── */
#irp-popup {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 2px 4px rgba(0,0,0,.06),
        0 8px 24px rgba(0,0,0,.12),
        0 24px 56px rgba(0,0,0,.12);
    padding: 44px 40px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    /* Slide-up + fade-in */
    transform: translateY(32px) scale(0.96);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(.22,.68,0,1.2), opacity 0.4s ease;
}

#irp-overlay.irp-visible #irp-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Top accent stripe ── */
#irp-popup::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, var(--irp-btn-from), var(--irp-btn-to));
}

/* ── Close button ── */
#irp-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    color: #888;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    line-height: 0;
    padding: 0;
}

#irp-close:hover,
#irp-close:focus-visible {
    background: #ebebeb;
    color: #333;
    transform: rotate(90deg);
    outline: none;
}

/* ── Icon ── */
.irp-icon {
    margin-bottom: 16px;
    line-height: 0;
    display: inline-block;
    /* Gentle pulse on load */
    animation: irpPulse 2.8s ease-in-out 0.6s infinite;
}

@keyframes irpPulse {
    0%, 100% { transform: scale(1);    }
    50%       { transform: scale(1.06); }
}

/* ── Headline ── */
#irp-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 800;
    color: #111;
    margin: 0 0 10px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* ── Message ── */
.irp-message {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.975rem;
    color: #555;
    line-height: 1.65;
    margin: 0 0 28px;
}

.irp-message strong {
    color: #E1306C;
    font-weight: 700;
}

/* ── Shared button base ── */
.irp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition:
        filter 0.25s ease,
        transform 0.18s ease,
        box-shadow 0.25s ease;
    -webkit-font-smoothing: antialiased;
}

/* ── Instagram CTA button ── */
.irp-btn--primary {
    background: linear-gradient(135deg, var(--irp-btn-from) 0%, var(--irp-btn-to) 100%);
    color: #ffffff;
    font-size: 1rem;
    padding: 15px 28px;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(225,48,108,.35);
    letter-spacing: 0.01em;
}

.irp-btn--primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(225,48,108,.45);
    color: #fff;
}

.irp-btn--primary:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

/* ── Coupon section ── */
#irp-coupon-wrap {
    margin-top: 26px;
    background: linear-gradient(135deg, #fff5f8 0%, #fff0f7 100%);
    border: 2px dashed #E1306C;
    border-radius: 14px;
    padding: 22px 20px 18px;
    animation: irpReveal 0.4s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes irpReveal {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.irp-coupon-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #E1306C;
    margin: 0 0 12px;
}

.irp-coupon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#irp-coupon-code {
    font-family: "SF Mono", "Fira Code", "Courier New", monospace;
    font-size: clamp(1.3rem, 5vw, 1.7rem);
    font-weight: 700;
    color: #111;
    letter-spacing: 0.12em;
    background: #fff;
    border: 2px solid #f0d0da;
    border-radius: 8px;
    padding: 6px 18px;
    white-space: nowrap;
}

/* Copy button */
.irp-btn--copy {
    background: #111;
    color: #fff;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.irp-btn--copy:hover {
    background: #2a2a2a;
    transform: translateY(-1px);
}

.irp-btn--copy.irp-copied {
    background: #16a34a;
    animation: irpPop 0.25s ease;
}

@keyframes irpPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.irp-coupon-note {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.78rem;
    color: #888;
    margin: 12px 0 0;
    line-height: 1.5;
}

/* ── "Thank you" micro-copy beneath button ── */
.irp-thankyou {
    font-size: 0.78rem;
    color: #aaa;
    margin-top: 14px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    #irp-popup {
        padding: 36px 20px 28px;
        border-radius: 16px;
    }

    .irp-btn--primary {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    #irp-coupon-code {
        font-size: 1.25rem;
        padding: 5px 12px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    #irp-overlay,
    #irp-popup,
    #irp-coupon-wrap,
    .irp-icon,
    .irp-btn {
        transition: none !important;
        animation: none !important;
    }
}
