/* ============================================================
   Flixbd Site Notifications — popup, banner, toast renderer
   Loaded globally in frontend base layout
   ============================================================ */

/* Root layer above header/sidebar/trending (large rank numbers use z-index 2–4). */
#flixbd-notif-root {
    position: fixed;
    inset: 0;
    z-index: 10050;
    pointer-events: none;
    isolation: isolate;
}

#flixbd-notif-root > * {
    pointer-events: auto;
}

#flixbd-notif-root .fnotif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    z-index: 10051;
    animation: fnotif-in .25s ease;
}

#flixbd-notif-root .fnotif-box {
    position: fixed;
    z-index: 10052;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
    animation: fnotif-pop .3s cubic-bezier(.34, 1.56, .64, 1);
    max-width: 94vw;
    overflow: hidden;
}

#flixbd-notif-root .fnotif-banner {
    position: fixed;
    z-index: 9999;
    left: 0;
    right: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .3);
    animation: fnotif-slide-down .3s ease;
}

#flixbd-notif-root .fnotif-toast {
    position: fixed;
    z-index: 10052;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
    animation: fnotif-pop .3s cubic-bezier(.34, 1.56, .64, 1);
    max-width: 360px;
    overflow: hidden;
}

/* Staggered reveal (HTMX-loaded fragment) */
.fnotif-delay {
    opacity: 0;
    animation: fnotif-pop 0.35s ease forwards;
}

@keyframes fnotif-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* Do not animate `transform` here — popup/toast boxes use inline translate(-50%,-50%)
   etc.; keyframe transform would override that and cause a jump until animation ends. */
@keyframes fnotif-pop {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fnotif-slide-down {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

.fnotif-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0, 0, 0, .18);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s;
}
.fnotif-close:hover { background: rgba(0, 0, 0, .35); }

.fnotif-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity .15s;
}
.fnotif-btn:hover { opacity: .85; }

/* Mobile: admin “popup” / toast often inherit large fixed sizes; cap height and scroll */
@media (max-width: 639px) {
    #flixbd-notif-root .fnotif-box,
    #flixbd-notif-root .fnotif-toast {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        max-height: min(72vh, 440px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    #flixbd-notif-root .fnotif-banner {
        max-height: 38vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
