/* ═══════════════════════════════════════════════════════════════════════
   Trendify Visual — Conversion Boosters Styles
   FOMO Notifications · Exit-Intent Popup · Sticky CTA Bar
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── 1. FOMO TOAST ─── */
.fomo-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-100%) scale(0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fomo-toast.fomo-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.fomo-toast-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    max-width: 340px;
    min-width: 280px;
    position: relative;
    overflow: hidden;
}

/* Subtle animated gradient border */
.fomo-toast-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6, #3b82f6);
    background-size: 200% 100%;
    animation: fomo-gradient 3s ease infinite;
}

@keyframes fomo-gradient {

    0%,
    100% {
        background-position: 0% 0;
    }

    50% {
        background-position: 100% 0;
    }
}

.fomo-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border-radius: 12px;
}

.fomo-toast-content {
    flex: 1;
    min-width: 0;
}

.fomo-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fomo-toast-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fomo-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.fomo-toast-close:hover {
    color: #475569;
    background: rgba(100, 116, 139, 0.1);
}

/* ─── 2. EXIT-INTENT POPUP ─── */
.exit-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease;
    padding: 16px;
}

.exit-overlay.exit-visible {
    opacity: 1;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

.exit-popup {
    background: white;
    border-radius: 24px;
    padding: 40px 32px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.85) translateY(30px);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.exit-visible .exit-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.exit-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.exit-popup-close:hover {
    background: #e2e8f0;
    color: #334155;
    transform: rotate(90deg);
}

.exit-popup-emoji {
    font-size: 56px;
    margin-bottom: 12px;
    animation: exit-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes exit-bounce {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.exit-popup-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.exit-popup-desc {
    font-size: 15px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 20px;
}

.exit-popup-desc strong {
    color: #3b82f6;
    font-weight: 700;
}

.exit-popup-code-box {
    background: linear-gradient(135deg, #f0f9ff, #eef2ff);
    border: 2px dashed #93c5fd;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}

.exit-popup-code-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 8px;
}

.exit-popup-code {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #1e40af;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    margin-bottom: 8px;
}

.exit-popup-copy {
    background: white;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s;
}

.exit-popup-copy:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.exit-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exit-popup-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.exit-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.exit-popup-btn-primary:active {
    transform: translateY(0);
}

.exit-popup-btn-secondary {
    width: 100%;
    padding: 10px 24px;
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.exit-popup-btn-secondary:hover {
    color: #475569;
}

.exit-popup-footer {
    margin-top: 16px;
    font-size: 12px;
    color: #94a3b8;
}

/* ─── 3. STICKY CTA BAR ─── */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9980;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticky-cta.sticky-visible {
    transform: translateY(0);
}

.sticky-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.sticky-cta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sticky-cta-emoji {
    font-size: 24px;
}

.sticky-cta-text {
    display: flex;
    flex-direction: column;
}

.sticky-cta-headline {
    color: #c6f300;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.sticky-cta-sub {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}

.sticky-cta-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sticky-cta-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sticky-cta-avatars {
    display: flex;
    align-items: center;
}

.sticky-cta-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    border: 2px solid #0f172a;
}

.sticky-cta-social-text {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.sticky-cta-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #c6f300, #a8d600);
    color: #0f172a;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(198, 243, 0, 0.35);
    white-space: nowrap;
}

.sticky-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(198, 243, 0, 0.5);
}

.sticky-cta-btn:active {
    transform: translateY(0);
}

.sticky-cta-btn-hot {
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.35) !important;
    animation: sticky-pulse 2s ease infinite;
}

@keyframes sticky-pulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 4px 24px rgba(239, 68, 68, 0.6); }
}

/* ─── Dark Mode ─── */
@media (prefers-color-scheme: dark) {
    .fomo-toast-inner {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(51, 65, 85, 0.6);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .fomo-toast-title {
        color: #f1f5f9;
    }

    .fomo-toast-subtitle {
        color: #94a3b8;
    }

    .fomo-toast-icon {
        background: linear-gradient(135deg, #1e293b, #1e1b4b);
    }

    .fomo-toast-close {
        color: #64748b;
    }

    .fomo-toast-close:hover {
        color: #cbd5e1;
        background: rgba(148, 163, 184, 0.1);
    }

    .exit-popup {
        background: linear-gradient(135deg, #1e293b, #0f172a);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    }

    .exit-popup-close {
        background: #334155;
        color: #94a3b8;
    }

    .exit-popup-close:hover {
        background: #475569;
        color: #f1f5f9;
    }

    .exit-popup-title {
        color: #f8fafc;
    }

    .exit-popup-desc {
        color: #94a3b8;
    }

    .exit-popup-code-box {
        background: linear-gradient(135deg, #1e293b, #1e1b4b);
        border-color: #3b82f6;
    }

    .exit-popup-code {
        color: #60a5fa;
    }

    .exit-popup-copy {
        background: #334155;
        border-color: #475569;
        color: #60a5fa;
    }

    .exit-popup-copy:hover {
        background: #3b82f6;
        color: white;
    }
}

/* Dark mode via class */
.dark .fomo-toast-inner {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(51, 65, 85, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dark .fomo-toast-title {
    color: #f1f5f9;
}

.dark .fomo-toast-subtitle {
    color: #94a3b8;
}

.dark .fomo-toast-icon {
    background: linear-gradient(135deg, #1e293b, #1e1b4b);
}

.dark .exit-popup {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.dark .exit-popup-close {
    background: #334155;
    color: #94a3b8;
}

.dark .exit-popup-title {
    color: #f8fafc;
}

.dark .exit-popup-desc {
    color: #94a3b8;
}

.dark .exit-popup-code-box {
    background: linear-gradient(135deg, #1e293b, #1e1b4b);
    border-color: #3b82f6;
}

.dark .exit-popup-code {
    color: #60a5fa;
}

.dark .exit-popup-copy {
    background: #334155;
    border-color: #475569;
    color: #60a5fa;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .fomo-toast {
        left: 12px;
        right: 12px;
        bottom: 80px;
        /* Above sticky CTA bar */
    }

    .fomo-toast-inner {
        max-width: 100%;
        min-width: 0;
    }

    .exit-popup {
        padding: 32px 20px 24px;
    }

    .exit-popup-emoji {
        font-size: 44px;
    }

    .exit-popup-title {
        font-size: 18px;
    }

    .exit-popup-code {
        font-size: 22px;
        letter-spacing: 2px;
    }

    .sticky-cta-inner {
        padding: 10px 16px;
        gap: 8px;
    }

    .sticky-cta-social {
        display: none;
    }

    .sticky-cta-sub {
        display: none;
    }

    .sticky-cta-btn {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Avoid overlapping with cookie banner */
.sticky-cta+#cookie-consent,
#cookie-consent {
    bottom: 60px !important;
}