/* Toast notification styles - reusable, responsive, stackable */
#toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    right: auto;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    transform: translateX(-50%);
    pointer-events: none; /* allows interaction with page underneath */
}

.toast {
    position: relative;
    pointer-events: auto;
    background: var(--light); /* use site background/light color */
    color: #212529;
    min-width: 260px;
    max-width: 320px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    padding: 8px 12px 6px 12px;
    min-height: 50px;
    display: flex;
    gap: 12px;
    align-items: center;
    transform: translateX(12px);
    opacity: 0;
    transition:
        transform 0.24s ease,
        opacity 0.24s ease;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast .toast-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.toast .toast-icon img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    display: block;
}

.toast .toast-icon .toast-check {
    animation: toast-check-pop 0.55s ease;
}

.toast .toast-body {
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertically center text */
    align-items: center; /* horizontally center text */
    text-align: center;
}

.toast .toast-message {
    margin: 0;
    font-weight: 600;
}

.toast .toast-sub {
    margin-top: 4px;
    color: #ddd;
    font-weight: 400;
    font-size: 13px;
}

.toast .toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
}

.toast .toast-progress .bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        #fac564 0%,
        #fac564 100%
    ); /* user-specified */
    transition: width linear;
}

@keyframes toast-check-pop {
    0% {
        transform: scale(0.6);
        opacity: 0.2;
    }
    60% {
        transform: scale(1.08);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close button (optional) */
.toast .toast-close {
    margin-left: 8px;
    background: transparent;
    border: none;
    color: #fff;
    opacity: 0.8;
    cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 520px) {
    #toast-container {
        left: 50%;
        right: auto;
        top: 0.75rem;
        align-items: center;
        transform: translateX(-50%);
    }
    .toast {
        max-width: calc(100% - 1rem);
    }
}
