:root {
    --notify-bg:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #f3f9fc 52%,
            #e5f4e8 100%
        );

    --notify-text: var(--color-dark);
    --notify-border: rgba(169, 232, 50, 0.55);

    --notify-progress:
        linear-gradient(
            90deg,
            var(--color-accent),
            var(--color-accent-hover)
        );

    --notify-shadow:
        0 14px 40px rgba(7, 52, 95, 0.18),
        0 4px 14px rgba(7, 52, 95, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    --notify-radius: 16px;
    --notify-transition: 0.3s ease;
}


/* =========================================================
   NOTIFICATION CONTAINER
   ========================================================= */

#notification-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 4000;

    display: flex;
    flex-direction: column;
    gap: 12px;

    width: min(380px, calc(100vw - 32px));

    pointer-events: none;
}


/* =========================================================
   NOTIFICATION
   ========================================================= */

.notification {
    position: relative;
    overflow: hidden;
    width: 100%;

    background: var(--notify-bg);
    color: var(--notify-text);

    border-radius: var(--notify-radius);
    border: 1px solid var(--notify-border);

    padding: 18px 18px 20px;

    box-shadow: var(--notify-shadow);

    animation: notificationSlideIn 0.35s ease forwards;

    pointer-events: auto;

    transform: translateX(120%);
    opacity: 0;
}


/* =========================================================
   TOP HIGHLIGHT
   ========================================================= */

.notification::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    background:
        linear-gradient(
            90deg,
            transparent 0%,
            var(--color-accent) 25%,
            var(--color-accent-hover) 50%,
            var(--color-accent) 75%,
            transparent 100%
        );

    opacity: 0.9;
    pointer-events: none;
}


/* =========================================================
   TEXT
   ========================================================= */

.notification p {
    margin: 0;
    padding-right: 8px;

    color: var(--notify-text);

    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;

    word-break: break-word;
}


/* =========================================================
   MOBILE ANIMATIONS
   ========================================================= */

@keyframes notificationMobileSlideIn {
    from {
        transform: translateY(-120%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes notificationMobileSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-120%);
        opacity: 0;
    }
}


/* =========================================================
   CLOSING
   ========================================================= */

.notification.closing {
    animation: notificationSlideOut 0.3s ease forwards;
}


/* =========================================================
   DESKTOP ANIMATIONS
   ========================================================= */

@keyframes notificationSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}


/* =========================================================
   PROGRESS BAR
   ========================================================= */

.notification .progress-bar {
    position: absolute;

    left: 0;
    bottom: 0;

    height: 4px;
    width: 100%;

    background: var(--notify-progress);

    border-radius:
        0 0
        var(--notify-radius)
        var(--notify-radius);

    box-shadow:
        0 -1px 0 rgba(255, 255, 255, 0.75);

    animation: notificationProgress 7s linear forwards;
}


@keyframes notificationProgress {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}


/* =========================================================
   SUCCESS — SITE GREEN
   ========================================================= */

.notification.success {
    --notify-bg:
        linear-gradient(
            145deg,
            #f8fff0 0%,
            #eef8df 52%,
            #e5f4e8 100%
        );

    --notify-text: #315b28;

    --notify-border:
        rgba(111, 174, 24, 0.48);

    --notify-progress:
        linear-gradient(
            90deg,
            #8fca25,
            var(--color-accent-hover)
        );

    box-shadow:
        0 14px 40px rgba(70, 120, 25, 0.16),
        0 0 20px rgba(169, 232, 50, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}


/* =========================================================
   ERROR — SITE BLUE / WARM CONTRAST
   ========================================================= */

.notification.error {
    --notify-bg:
        linear-gradient(
            145deg,
            #f4f9fd 0%,
            #e8f2f9 52%,
            #dcecf5 100%
        );

    --notify-text: var(--color-dark);

    --notify-border:
        rgba(23, 103, 165, 0.35);

    --notify-progress:
        linear-gradient(
            90deg,
            var(--color-steel),
            var(--color-graphite-light)
        );

    box-shadow:
        0 14px 40px rgba(7, 52, 95, 0.18),
        0 0 20px rgba(77, 134, 181, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}


/* =========================================================
   TABLET / SMALL DESKTOP — 768–1366 PX
   ========================================================= */

@media (min-width: 768px) and (max-width: 1366px) {

    #notification-container {
        right: 18px;
        bottom: 18px;
        left: auto;

        width: min(340px, calc(100vw - 36px));
        gap: 10px;
    }

    .notification {
        padding: 16px 16px 18px;
        border-radius: 16px;

        box-shadow:
            0 12px 32px rgba(7, 52, 95, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .notification p {
        font-size: 14px;
        line-height: 1.45;
    }

    .notification .progress-bar {
        height: 3px;
    }
}


/* =========================================================
   MOBILE — 1024 PX
   ========================================================= */

@media (max-width: 1024px) {

    #notification-container {
        top:
            calc(
                var(--header-height)
                + env(safe-area-inset-top)
                + 10px
            );

        bottom: auto;

        left: 0;
        right: 0;

        width: 100%;
        padding: 0 16px;

        z-index: 4000;

        pointer-events: none;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .notification {
        width: 100%;

        pointer-events: auto;

        transform: translateY(-120%);
        opacity: 0;

        animation:
            notificationMobileSlideIn
            0.35s ease forwards;
    }

    .notification.closing {
        animation:
            notificationMobileSlideOut
            0.3s ease forwards;
    }
}


/* =========================================================
   SMALL MOBILE — 480 PX
   ========================================================= */

@media (max-width: 480px) {

    #notification-container {
        top:
            calc(
                78px
                + env(safe-area-inset-top)
            );

        bottom: auto;

        left: 12px;
        right: 12px;

        gap: 10px;
        width: auto;

        z-index: 4000;
    }

    .notification {
        width: 100%;

        padding: 14px 14px 16px;
        border-radius: 14px;

        box-shadow:
            0 10px 28px rgba(7, 52, 95, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);

        transform: translateY(-120%);
        opacity: 0;

        animation:
            notificationMobileSlideIn
            0.35s ease forwards;
    }

    .notification.closing {
        animation:
            notificationMobileSlideOut
            0.3s ease forwards;
    }

    .notification p {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
    }

    .notification .progress-bar {
        height: 3px;
    }
}


/* =========================================================
   EXTRA SMALL MOBILE — 360 PX
   ========================================================= */

@media (max-width: 360px) {

    #notification-container {
        left: 10px;
        right: 10px;
    }

    .notification {
        padding: 14px 12px 16px;
    }

    .notification p {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .notification,
    .notification.closing,
    .notification .progress-bar {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
}
