/**
 * IOT Exit Intent Popup & Push Prompt — Styles (Step 6)
 * exit-popup.css
 */

/* ── Overlay ──────────────────────────────────────────────────────────────── */
#iot-exit-overlay {
    position:         fixed;
    inset:            0;
    background:       rgba(0, 0, 0, 0.65);
    z-index:          999999;
    display:          flex;
    align-items:      center;
    justify-content:  center;
    padding:          16px;
    backdrop-filter:  blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* ── Popup box ────────────────────────────────────────────────────────────── */
#iot-exit-popup {
    position:         relative;
    width:            100%;
    max-width:        440px;
    border-radius:    16px;
    padding:          40px 32px 32px;
    text-align:       center;
    box-shadow:       0 24px 60px rgba(0, 0, 0, 0.35);
    transform:        translateY(40px) scale(0.95);
    opacity:          0;
    transition:       transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                      opacity 0.3s ease;
}

#iot-exit-popup.iot-popup-enter {
    transform: translateY(0) scale(1);
    opacity:   1;
}

/* ── Close button ─────────────────────────────────────────────────────────── */
#iot-exit-close {
    position:   absolute;
    top:        12px;
    right:      16px;
    background: none;
    border:     none;
    font-size:  24px;
    line-height: 1;
    cursor:     pointer;
    color:      #888;
    padding:    4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
#iot-exit-close:hover {
    color:      #333;
    background: rgba(0,0,0,0.06);
}

/* ── Icon ─────────────────────────────────────────────────────────────────── */
.iot-popup-icon {
    font-size:    52px;
    line-height:  1;
    margin-bottom: 12px;
    animation:    iot-bounce 1.2s ease infinite;
}

@keyframes iot-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* ── Headline ─────────────────────────────────────────────────────────────── */
.iot-popup-headline {
    font-size:    26px;
    font-weight:  700;
    line-height:  1.2;
    color:        #1a1a1a;
    margin:       0 0 10px;
}

/* ── Subtext ──────────────────────────────────────────────────────────────── */
.iot-popup-subtext {
    font-size:   15px;
    color:       #555;
    line-height: 1.6;
    margin:      0 0 20px;
}

/* ── Countdown timer ──────────────────────────────────────────────────────── */
.iot-popup-timer-wrap {
    margin-bottom: 18px;
}

.iot-popup-timer-label {
    font-size:  13px;
    color:      #888;
    margin:     0 0 8px;
}

.iot-popup-countdown {
    display:         inline-flex;
    align-items:     center;
    gap:             6px;
    background:      #f8f8f8;
    border:          2px solid #eee;
    border-radius:   10px;
    padding:         10px 20px;
    transition:      border-color 0.3s, background 0.3s;
}

.iot-popup-countdown.iot-cd-urgent {
    border-color: #e74c3c;
    background:   #fff5f5;
    animation:    iot-pulse-red 1s ease infinite;
}

@keyframes iot-pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
    50%       { box-shadow: 0 0 0 6px rgba(231,76,60,0.15); }
}

.iot-cd-block {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    min-width:      44px;
}

.iot-cd-block span:first-child {
    font-size:   28px;
    font-weight: 700;
    color:       #e74c3c;
    line-height: 1;
}

.iot-cd-block small {
    font-size:  10px;
    color:      #999;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.iot-cd-sep {
    font-size:   28px;
    font-weight: 700;
    color:       #ccc;
    line-height: 1;
    margin-bottom: 12px;
}

/* ── Coupon block ─────────────────────────────────────────────────────────── */
.iot-popup-coupon {
    background:    linear-gradient(135deg, #fff9e6, #fff3cc);
    border:        2px dashed #f0c040;
    border-radius: 10px;
    padding:       14px 16px;
    margin-bottom: 20px;
}

.iot-coupon-label {
    font-size:  13px;
    color:      #888;
    margin:     0 0 8px;
}

.iot-coupon-code-wrap {
    display:     flex;
    align-items: center;
    justify-content: center;
    gap:         8px;
}

.iot-coupon-code {
    font-size:      20px;
    font-weight:    700;
    font-family:    monospace;
    color:          #b7860b;
    letter-spacing: 2px;
    background:     rgba(255,255,255,0.7);
    padding:        4px 12px;
    border-radius:  6px;
}

.iot-copy-btn {
    background:    #f0c040;
    border:        none;
    border-radius: 6px;
    padding:       6px 12px;
    font-size:     13px;
    font-weight:   600;
    cursor:        pointer;
    color:         #333;
    transition:    background 0.2s, transform 0.1s;
}

.iot-copy-btn:hover {
    background: #d4a800;
    transform:  scale(1.05);
}

/* ── CTA Button ───────────────────────────────────────────────────────────── */
.iot-popup-cta-btn {
    display:        block;
    width:          100%;
    padding:        15px 20px;
    border-radius:  10px;
    font-size:      17px;
    font-weight:    700;
    color:          #fff !important;
    text-decoration: none !important;
    text-align:     center;
    margin-bottom:  12px;
    transition:     opacity 0.2s, transform 0.15s;
    box-shadow:     0 4px 16px rgba(0,0,0,0.2);
}

.iot-popup-cta-btn:hover {
    opacity:   0.9;
    transform: translateY(-2px);
}

/* ── Dismiss link ─────────────────────────────────────────────────────────── */
.iot-popup-dismiss {
    background:  none;
    border:      none;
    color:       #aaa;
    font-size:   13px;
    cursor:      pointer;
    padding:     4px 8px;
    text-decoration: underline;
    transition:  color 0.2s;
    display:     block;
    margin:      0 auto;
}

.iot-popup-dismiss:hover {
    color: #666;
}

/* ── Web Push Prompt ──────────────────────────────────────────────────────── */
#iot-push-prompt {
    position:      fixed;
    bottom:        20px;
    left:          20px;
    right:         20px;
    max-width:     380px;
    margin:        0 auto;
    background:    #1a1a2e;
    color:         #fff;
    border-radius: 14px;
    padding:       16px 20px;
    display:       flex;
    align-items:   center;
    gap:           14px;
    z-index:       999998;
    box-shadow:    0 8px 32px rgba(0,0,0,0.4);
}

.iot-push-icon {
    font-size:   28px;
    flex-shrink: 0;
}

.iot-push-text {
    flex:         1;
    display:      flex;
    flex-direction: column;
    gap:          2px;
}

.iot-push-text strong {
    font-size:   14px;
    font-weight: 700;
}

.iot-push-text span {
    font-size: 12px;
    color:     #aaa;
}

.iot-push-btns {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    flex-shrink:    0;
}

.iot-push-allow,
.iot-push-deny {
    border:        none;
    border-radius: 6px;
    padding:       6px 14px;
    font-size:     12px;
    font-weight:   600;
    cursor:        pointer;
    white-space:   nowrap;
    transition:    opacity 0.2s;
}

.iot-push-allow {
    background: #27ae60;
    color:      #fff;
}

.iot-push-deny {
    background: rgba(255,255,255,0.1);
    color:      #ccc;
}

.iot-push-allow:hover,
.iot-push-deny:hover {
    opacity: 0.85;
}

/* ── Mobile responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #iot-exit-popup {
        padding:       28px 20px 24px;
        border-radius: 14px;
    }

    .iot-popup-headline {
        font-size: 22px;
    }

    .iot-popup-subtext {
        font-size: 14px;
    }

    .iot-cd-block span:first-child {
        font-size: 24px;
    }

    .iot-coupon-code {
        font-size: 17px;
    }

    .iot-popup-cta-btn {
        font-size: 15px;
        padding:   13px 16px;
    }

    #iot-push-prompt {
        flex-wrap: wrap;
        bottom:    10px;
    }

    .iot-push-btns {
        flex-direction: row;
        width:          100%;
    }

    .iot-push-allow,
    .iot-push-deny {
        flex: 1;
    }
}
