/*
 * NexNotify Frontend CSS
 */

:root {
    --nex-notify-z-index-bar: 99999;
    --nex-notify-z-index-popup: 100000;
}

/* =========================================
   Announcement Bar
========================================= */
.nexnotify-bar {
    width: 100%;
    padding: 30px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    z-index: var(--nex-notify-z-index-bar);
    transition: transform 1s ease, opacity 0.3s ease;
    position: relative;
}

/* Top & Sticky */
body .nexnotify-bar.nex-notify-pos-top.nex-notify-is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
}

/* Top & Non-Sticky */
body .nexnotify-bar.nex-notify-pos-top:not(.nex-notify-is-sticky) {
    position: relative;
    z-index: 9999;
}

/* Bottom & Sticky */
body .nexnotify-bar.nex-notify-pos-bottom.nex-notify-is-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
}

/* Bottom & Non-Sticky */
body .nexnotify-bar.nex-notify-pos-bottom:not(.nex-notify-is-sticky) {
    position: relative;
    z-index: 9999;
}

/* Add top padding to body if bar is sticky - handled in JS */
body.has-nex-notify-sticky {
    margin: 0;
    padding: 0;
    /* Set dynamically via JS based on bar height */
}

.nexnotify-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.nexnotify-bar-msg {
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
}

.nexnotify-bar-msg p {
    margin: 0;
    padding: 0;
}

.nexnotify-bar .nex-notify-hidden {
    display: none !important;
}

/* Transitions */
.nex-notify-fade-transition {
    transition: opacity 0.4s ease;
    opacity: 1;
}

.nex-notify-fade-out {
    opacity: 0 !important;
}

/* Slide Transition */
@keyframes NexNTextSlideUpBounce {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px);
        opacity: 1;
    }
    80% {
        transform: translateY(4px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes NexNTextSlideUpOut {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}
.nexnotify-bar .nex-notify-anim-slide-in {
    animation: NexNTextSlideUpBounce 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    display: inline-block;
}
.nexnotify-bar .nex-notify-anim-slide-out {
    animation: NexNTextSlideUpOut 0.4s ease forwards;
    display: inline-block;
}

/* Shimmer & Pop Transition */
@keyframes NexNPopInBounce {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
        opacity: 1;
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes NexNPopOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}
.nexnotify-bar .nex-notify-anim-pop-in {
    animation: NexNPopInBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: inline-block;
}
.nexnotify-bar .nex-notify-anim-pop-out {
    animation: NexNPopOut 0.3s ease forwards;
    display: inline-block;
}
.nexnotify-bar.nex-notify-shimmer-effect::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: NexNShimmerSweep 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 10;
    pointer-events: none;
}
@keyframes NexNShimmerSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 150%;
    }
}

/* Flip Transition */
@keyframes NexNFlipIn {
    0% {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}
@keyframes NexNFlipOut {
    0% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
    100% {
        transform: perspective(400px) rotateX(-90deg);
        opacity: 0;
    }
}
.nexnotify-bar .nex-notify-anim-flip-in {
    animation: NexNFlipIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform-origin: top;
    display: inline-block;
}
.nexnotify-bar .nex-notify-anim-flip-out {
    animation: NexNFlipOut 0.4s ease forwards;
    transform-origin: bottom;
    display: inline-block;
}

/* Confetti Container */
.nexnotify-bar .nex-notify-confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 9999;
}
.nexnotify-bar .nex-notify-confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    opacity: 1;
}

/* CTA Button */
.nexnotify-btn {
    display: inline-flex;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    text-decoration: none;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset -2px -2px 10px -5px rgb(0 0 0 / 40%);
}

.nexnotify-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Timer */
.nexnotify-timer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nexnotify-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    min-width: 40px;
}

.nex-notify-num {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.nex-notify-label {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-top: 2px;
}

/* Collapse/Expand Logic */
.nexnotify-bar-collapse {
    position: absolute;
    right: 15px;
    top: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    border-radius: 50%;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
}

.nexnotify-bar-collapse .dashicons {
    vertical-align: baseline;
}

.nexnotify-bar-collapse .dashicons.dashicons-arrow-down-alt2 {
    vertical-align: bottom;
    line-height: 19px;
}

.nexnotify-bar-collapse:hover {
    opacity: 1;
}

.nexnotify-bar.is-collapsed {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}
.nexnotify-bar.nex-notify-pos-bottom.is-collapsed {
    transform: translateY(100%);
}

.nexnotify-bar-expand {
    position: fixed;
    top: 0;
    right: 20px;
    width: 30px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    background: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: var(--nex-notify-z-index-bar);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.nexnotify-bar-expand[data-position="bottom"] {
    top: unset;
    bottom: 0;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nexnotify-bar-expand:hover {
    transform: scale(1.1);
}

.nexnotify-bar-expand .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}


/* =========================================
   Promo Popup
========================================= */
.nexnotify-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--nex-notify-z-index-popup);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nexnotify-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.nexnotify-popup-modal {
    position: relative;
    width: 100%;
    max-height: 90vh;
    margin: 0 20px;
}

/* Default Fallback (Same as Zoom) */
body .nexnotify-popup-overlay:not(.show) .nexnotify-popup-modal {
    transform: scale(0.95);
    opacity: 0;
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal:not([class*="nex-notify-anim-"]) {
    transform: scale(1);
    opacity: 1;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* =========================================
   Premium Popup Animations
========================================= */

/* Fade In */
@keyframes NexNFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal.nex-notify-anim-fade-in {
    animation: NexNFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Zoom In */
@keyframes NexNZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal.nex-notify-anim-zoom-in {
    animation: NexNZoomIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide In Up */
@keyframes NexNSlideInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal.nex-notify-anim-slide-in-up {
    animation: NexNSlideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide In Down */
@keyframes NexNSlideInDown {
    0% {
        opacity: 0;
        transform: translateY(-40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal.nex-notify-anim-slide-in-down {
    animation: NexNSlideInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bounce In */
@keyframes NexNBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal.nex-notify-anim-bounce-in {
    animation: NexNBounceIn 0.6s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

/* 3D Flip In */
@keyframes NexNFlipIn {
    0% {
        opacity: 0;
        transform: perspective(1000px) rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateX(0deg);
    }
}
body .nexnotify-popup-overlay.show .nexnotify-popup-modal.nex-notify-anim-flip-in {
    animation: NexNFlipIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top center;
}

.nexnotify-popup-modal img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.nexnotify-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.nexnotify-popup-close:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

/* =========================================
   Lead Capture Form
========================================= */
.nex-notify-lead-capture-wrapper {
    padding: 0 30px 30px 30px;
}
.nex-notify-subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}
.nex-notify-subscribe-form-inner {
    display: flex;
    width: 100%;
    max-width: 400px;
    gap: 10px;
}
.nex-notify-email-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    min-width: 0;
}
.nex-notify-submit-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.nex-notify-gdpr-wrapper {
    font-size: 13px;
    color: #555;
    text-align: center;
    max-width: 400px;
}
.nex-notify-gdpr-wrapper label {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}
.nex-notify-gdpr-wrapper input[type="checkbox"] {
    margin-top: 3px;
}
.nex-notify-subscribe-msg {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
}
.nex-notify-success-message-box {
    color: #059669;
    background: #ecfdf5;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #10b981;
    text-align: center;
    font-weight: 600;
    width: 100%;
    max-width: 400px;
}

/* =========================================
   Mobile Hide Media Queries
========================================= */
@media (max-width: 768px) {
    .nexnotify-bar-inner {
        flex-direction: column;
        gap: 10px;
    }

    .nexnotify-popup-close {
        top: 10px;
        right: 10px;
    }

    /* Strict Mobile Hiding */
    .nex-notify-hide-mobile {
        display: none !important;
    }
}