/**
 * NotifyioX SaaS — Frontend Notification Styles
 */

/* ── Container ───────────────────────────────────────── */

#niox-notification-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    max-width: 380px;
    width: 100%;
}

/* Position variants — set by JS via data attribute */
#niox-notification-container[data-position="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

#niox-notification-container[data-position="bottom-right"] {
    bottom: 20px;
    right: 20px;
}

#niox-notification-container[data-position="top-left"] {
    top: 20px;
    left: 20px;
}

#niox-notification-container[data-position="top-right"] {
    top: 20px;
    right: 20px;
}

/* ── Popup ───────────────────────────────────────────── */

.niox-popup {
    pointer-events: auto;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.niox-popup.niox-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide animation */
.niox-popup.niox-anim-slide {
    transform: translateX(-100%);
}

.niox-popup.niox-anim-slide.niox-visible {
    transform: translateX(0);
}

/* Fade animation */
.niox-popup.niox-anim-fade {
    transform: none;
}

.niox-popup.niox-anim-fade.niox-visible {
    opacity: 1;
}

/* Bounce animation */
.niox-popup.niox-anim-bounce {
    transform: scale(0.3);
}

.niox-popup.niox-anim-bounce.niox-visible {
    transform: scale(1);
    animation: niox-bounce 0.5s ease;
}

@keyframes niox-bounce {
    0%   { transform: scale(0.3); }
    50%  { transform: scale(1.05); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Zoom animation */
.niox-popup.niox-anim-zoom {
    transform: scale(0);
}

.niox-popup.niox-anim-zoom.niox-visible {
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── Inner layout ────────────────────────────────────── */

.niox-popup__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.niox-popup__inner:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18),
                0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Image */
.niox-popup__image {
    flex-shrink: 0;
}

.niox-popup__image img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
}

/* No image — icon fallback */
.niox-popup__icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.niox-popup__icon--sale     { background: #dcfce7; }
.niox-popup__icon--signup   { background: #dbeafe; }
.niox-popup__icon--review   { background: #fef3c7; }
.niox-popup__icon--custom   { background: #f3e8ff; }
.niox-popup__icon--page_view { background: #e0f2fe; }

/* Text */
.niox-popup__content {
    flex: 1;
    min-width: 0;
}

.niox-popup__title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.niox-popup__message {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.niox-popup__time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
}

/* Close button */
.niox-popup__close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    opacity: 0;
}

.niox-popup__inner:hover .niox-popup__close {
    opacity: 1;
}

.niox-popup__close:hover {
    color: #475569;
    background: #f1f5f9;
}

/* Branding */
.niox-popup__branding {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    padding: 4px 0 0;
}

.niox-popup__branding a {
    color: #94a3b8;
    text-decoration: none;
}

.niox-popup__branding a:hover {
    color: #64748b;
    text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────── */

@media screen and (max-width: 480px) {
    #niox-notification-container {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        max-width: calc(100% - 20px);
    }

    .niox-popup__inner {
        padding: 12px;
    }

    .niox-popup__image img,
    .niox-popup__icon {
        width: 40px;
        height: 40px;
    }
}
