
/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-h) + 1rem);
    right: 1.2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    pointer-events: none;
    max-width: 360px;
    width: calc(100vw - 2.4rem);
}

.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    padding: 1rem 1rem 0.6rem 1rem;
    pointer-events: all;
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

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

/* Type colours */
.toast-item.toast-success { border-left-color: #27ae60; }
.toast-item.toast-error   { border-left-color: var(--red); }
.toast-item.toast-warning { border-left-color: var(--gold); }
.toast-item.toast-info    { border-left-color: #3498db; }

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.1rem;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--dark);
    margin-bottom: 0.2rem;
    letter-spacing: 0.01em;
}

.toast-message {
    font-size: 0.82rem;
    color: var(--gray);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color var(--transition);
    margin-top: -0.1rem;
}

.toast-close:hover {
    color: var(--dark);
}

/* Progress bar auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toast-shrink 4s linear forwards;
    transform-origin: left;
}

.toast-progress-success { background: #27ae60; }
.toast-progress-error   { background: var(--red); }
.toast-progress-warning { background: var(--gold); }
.toast-progress-info    { background: #3498db; }

@keyframes toast-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Mobile */
@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        right: 0.8rem;
        left: 0.8rem;
        width: auto;
        max-width: unset;
    }
}
