/* ===== FLASH-УВЕДОМЛЕНИЯ (TOAST) ===== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.3s ease forwards;
    position: relative;
    overflow: hidden;
}

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

/* Варианты toast */
.toast--success {
    border-left: 4px solid var(--success);
}

.toast--success .toast__icon {
    color: var(--success);
}

.toast--error {
    border-left: 4px solid var(--danger);
}

.toast--error .toast__icon {
    color: var(--danger);
}

.toast--warning {
    border-left: 4px solid var(--warning);
}

.toast--warning .toast__icon {
    color: var(--warning);
}

.toast--info {
    border-left: 4px solid var(--info);
}

.toast--info .toast__icon {
    color: var(--info);
}

/* Иконки */
.toast__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast__icon .material-icons {
    font-size: 24px;
}

/* Контент */
.toast__content {
    flex: 1;
    min-width: 0;
}

.toast__title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.toast__message {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Кнопка закрытия */
.toast__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.toast__close:hover {
    background: var(--bg);
    color: var(--text);
}

.toast__close .material-icons {
    font-size: 18px;
}

/* Прогресс-бар авто-закрытия */
.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress 5s linear forwards;
}

/* Анимации */
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Адаптивность */
@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .toast {
        animation: toast-in-mobile 0.3s ease forwards;
    }

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

    @keyframes toast-in-mobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes toast-out-mobile {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}
