/* ============================================================
   AtlasMPS — Toast Notifications
   ============================================================ */

.sa-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    animation: saToastSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes saToastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sa-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 320px;
    max-width: 440px;
    padding: 1rem 1.125rem;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 10px 20px -2px rgba(0,0,0,0.08);
    border: 1px solid #D8D0C3;
    position: relative;
    overflow: hidden;
}

/* Left accent bar */
.sa-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    border-radius: 0;
}

/* Icon */
.sa-toast__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0;
    flex-shrink: 0;
    font-size: 0.8rem;
    margin-top: 0.05rem;
}

/* Body */
.sa-toast__body {
    flex: 1;
    min-width: 0;
}

.sa-toast__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1A1715;
    line-height: 1.3;
    margin-bottom: 0.125rem;
}

.sa-toast__msg {
    font-size: 0.78rem;
    color: #6E6660;
    line-height: 1.45;
}

/* Close button */
.sa-toast__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: none;
    border: none;
    border-radius: 0;
    color: #847C70;
    cursor: pointer;
    font-size: 0.7rem;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    margin-top: 0.05rem;
}

.sa-toast__close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.04);
}

/* Progress bar (auto-dismiss) */
.sa-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    animation: saToastProgress 6s linear forwards;
}

@keyframes saToastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ── Success ── */
.sa-toast--success::before {
    background: #7A8C6E;
}
.sa-toast--success .sa-toast__icon {
    background: #F2F5EE;
    color: #5F7058;
}
.sa-toast--success .sa-toast__progress {
    background: #7A8C6E;
}

/* ── Error ── */
.sa-toast--error::before {
    background: #ef4444;
}
.sa-toast--error .sa-toast__icon {
    background: #fef2f2;
    color: #dc2626;
}
.sa-toast--error .sa-toast__progress {
    background: #ef4444;
}

/* ── Warning ── */
.sa-toast--warning::before {
    background: #C68A3A;
}
.sa-toast--warning .sa-toast__icon {
    background: #fffbeb;
    color: #A87825;
}
.sa-toast--warning .sa-toast__progress {
    background: #C68A3A;
}

/* ── Info ── */
.sa-toast--info::before {
    background: #6E6660;
}
.sa-toast--info .sa-toast__icon {
    background: #EFEBE5;
    color: #524A45;
}
.sa-toast--info .sa-toast__progress {
    background: #847C70;
}

/* Auto-dismiss after animation */
.sa-toast-container {
    animation: saToastSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1),
               saToastFadeOut 0.3s ease 5.7s forwards;
}

@keyframes saToastFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* Mobile */
@media (max-width: 576px) {
    .sa-toast-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }

    .sa-toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Dark theme */
[data-theme-mode="dark"] .sa-toast {
    background: #2A2622;
    border-color: #3D3833;
}

[data-theme-mode="dark"] .sa-toast__title {
    color: #EFEBE5;
}

[data-theme-mode="dark"] .sa-toast__msg {
    color: #847C70;
}

[data-theme-mode="dark"] .sa-toast__close {
    color: #6E6660;
}

[data-theme-mode="dark"] .sa-toast__close:hover {
    background: rgba(255,255,255,0.06);
}

[data-theme-mode="dark"] .sa-toast--success .sa-toast__icon {
    background: rgba(34, 197, 94, 0.12);
}

[data-theme-mode="dark"] .sa-toast--error .sa-toast__icon {
    background: rgba(239, 68, 68, 0.12);
}

[data-theme-mode="dark"] .sa-toast--warning .sa-toast__icon {
    background: rgba(245, 158, 11, 0.12);
}

[data-theme-mode="dark"] .sa-toast--info .sa-toast__icon {
    background: rgba(107, 114, 128, 0.12);
}
