/* /Users/dan/veggie_bot/mini_app_frontend/css/toast.css */

/* Контейнер для уведомлений */
#toast-container {
    position: fixed;
    /* По умолчанию (планшет/десктоп): сверху справа */
    top: 1rem;
    right: 1rem;
    left: auto;
    bottom: auto;
    z-index: 10001; /* Выше большинства элементов */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none; /* Контейнер не должен перехватывать клики */
}

/* Само уведомление */
.toast-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 280px;
    max-width: 350px;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    color: var(--off-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.215, 0.610, 0.355, 1), opacity 0.4s ease;
    pointer-events: auto; /* Уведомления должны быть кликабельны */
}

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

/* Стили по типам */
.toast-notification.info {
    background: linear-gradient(135deg, var(--dark-eggplant), #6a0dad);
    border-left: 4px solid var(--muted-gold);
}

.toast-notification.success {
    background: linear-gradient(135deg, var(--sage-green), #7a8a4f);
    border-left: 4px solid var(--soft-peach);
}

.toast-notification.warning {
    background: linear-gradient(135deg, var(--muted-gold), #b8860b);
    border-left: 4px solid var(--off-white);
}

.toast-notification.error {
    background: linear-gradient(135deg, #c0392b, #a93226);
    border-left: 4px solid var(--terracotta);
}

/* Мобильная адаптация: снизу по центру, над нижней панелью действий */
@media (max-width: 640px) {
    #toast-container {
        top: auto;
        right: auto;
        left: 50%;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); /* ~64px панель + 20px отступ */
        transform: translateX(-50%);
        width: 100%;
        max-width: min(92vw, 360px);
        padding: 0 8px;
        align-items: center;
    }

    .toast-notification {
        width: 100%;
        max-width: 360px;
        min-width: 0; /* чтобы не выходить за край экрана */
        transform: translateY(120%);
    }

    .toast-notification.show {
        transform: translateY(0);
    }
}