@keyframes toastInRight {
    0% {
        opacity: 0;
        transform: translateX(120%) scale(0.96);
    }
    60% {
        opacity: 1;
        transform: translateX(-10px) scale(1.03);
    }
    80% {
        opacity: 1;
        transform: translateX(2px) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOutRight {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(120%) scale(0.95);
    }
}

/* Toast Container: desktop default (bottom right) */
#toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-end;
    pointer-events: none; /* container passes clicks through */
}

/* Toast message styles */
.toast-message {
    min-width: 260px;
    max-width: 700px;
    width: 100%;
    background: #23272f;
    color: #fff;
    border-radius: var(--reg-radius);
    box-shadow: var(--floating-box-shadow);
    padding: 18px 24px;
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    transition: opacity .35s cubic-bezier(.4, 0, .2, 1), transform .35s cubic-bezier(.4, 0, .2, 1);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 0;
    box-sizing: border-box;
}

.toast-message.anim-in {
    animation: toastInRight 0.6s cubic-bezier(.23,1.1,.58,1) forwards;
}

.toast-message.anim-out {
    animation: toastOutRight 0.45s cubic-bezier(.4,0,.2,1) forwards;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-message.success {
    background: var(--secondary-green-1);
    color: black;
}

.toast-message.error {
    background: var(--secondary-red-1);
    color: #fff;
}

.toast-message.info {
    background: var(--secondary-blue-1);
    color: #fff;
}

/* Icon style (left of message) */
.toast-message .icon {
    font-size: 1.7em;
    font-weight: 900;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

.toast-text {
    flex: 1 1 auto;
    line-height: 1.4;
    word-break: break-word;
}

/* MOBILE: center container, stretch width, limit max width */
@media (max-width: 600px) {
    #toast-container {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        align-items: center;          /* Center horizontally */
        padding: 0 8px 8px 8px;       /* Edge padding */
        gap: 10px;
    }
    .toast-message {
        min-width: 0;
        max-width: 80vw;
        width: 100%;
        border-radius: 12px;
        box-sizing: border-box;
        padding-left: 14px;
        padding-right: 14px;
        font-size: 1rem;
    }
}
