/* ============================================================
   LexVault — Toast Notification System
   ============================================================ */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100vw - 48px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--clr-bg-3);
    border: 1px solid var(--clr-border-2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: toast-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    position: relative;
    overflow: hidden;
}

.toast.toast-removing {
    animation: toast-out 0.3s ease forwards;
}

/* Progress bar */
.toast::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 14px 14px;
    animation: toast-progress 5s linear forwards;
    transform-origin: left;
}

.toast-success::before { background: var(--clr-success); }
.toast-error::before   { background: var(--clr-error); }
.toast-info::before    { background: var(--clr-blue); }
.toast-warning::before { background: var(--clr-warning); }

/* Icon */
.toast-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}
.toast-success .toast-icon { background: rgba(34,197,94,0.15);  color: var(--clr-success); }
.toast-error   .toast-icon { background: rgba(239,68,68,0.15);  color: var(--clr-error); }
.toast-info    .toast-icon { background: rgba(59,130,246,0.15); color: var(--clr-blue); }
.toast-warning .toast-icon { background: rgba(245,158,11,0.15); color: var(--clr-warning); }

/* Body */
.toast-body { flex: 1; min-width: 0; }
.toast-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--clr-text);
    margin-bottom: 2px;
    font-family: var(--font-body);
}
.toast-message {
    font-size: 0.82rem;
    color: var(--clr-text-2);
    line-height: 1.4;
    word-break: break-word;
}

/* Close */
.toast-close {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    color: var(--clr-text-3);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.2s, color 0.2s;
}
.toast-close:hover { background: var(--clr-surface-2); color: var(--clr-text); }

/* Borders */
.toast-success { border-left: 3px solid var(--clr-success); }
.toast-error   { border-left: 3px solid var(--clr-error); }
.toast-info    { border-left: 3px solid var(--clr-blue); }
.toast-warning { border-left: 3px solid var(--clr-warning); }

/* Animations */
@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%) scale(0.85); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); max-height: 200px; }
    to   { opacity: 0; transform: translateX(100%) scale(0.85); max-height: 0; padding: 0; margin: 0; }
}
@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Mobile */
@media (max-width: 480px) {
    #toast-container { bottom: 16px; right: 16px; left: 16px; width: auto; max-width: none; }
}
