/**
 * STRELA — единый in-app toast (насыщенные типы: success / error / info / warn).
 * Появление сверху вниз под хедером, уход вверх-вбок.
 */
:root {
    --strela-toast-gap: 10px;
    --strela-toast-top: calc(56px + env(safe-area-inset-top, 0px) + var(--strela-toast-gap));
}

@media (max-width: 768px) {
    :root {
        --strela-toast-top: calc(52px + env(safe-area-inset-top, 0px) + var(--strela-toast-gap));
    }
}

/* Если подключён header.css — точнее по --strela-header-h */
@supports (top: var(--strela-header-h)) {
    :root {
        --strela-toast-top: calc(var(--strela-header-h, 56px) + var(--strela-toast-gap));
    }
}

#strela-toast-root {
    position: fixed;
    top: var(--strela-toast-top);
    left: 0;
    right: 0;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    padding: 0 12px;
    box-sizing: border-box;
}

.strela-toast-item {
    pointer-events: none;
    width: min(420px, calc(100vw - 32px));
    max-width: 100%;
    box-sizing: border-box;
    background: var(--card, #1e293b);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    color: var(--text, #f8fafc);
    padding: 8px 14px 8px 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
    transform: translate3d(0, -36px, 0);
    opacity: 0;
    transition:
        transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.28s ease;
}

.strela-toast-item__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}

.strela-toast-item__text {
    flex: 1;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.strela-toast-item.is-in {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.strela-toast-item.is-out {
    transform: translate3d(48px, -28px, 0);
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.4, 0, 1, 1),
        opacity 0.24s ease;
}

/* ── Success: насыщенный зелёный градиент ── */
.strela-toast-item--success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.38);
}

.strela-toast-item--success .strela-toast-item__icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
}

/* ── Error: красный градиент ── */
.strela-toast-item--error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.36);
}

.strela-toast-item--error .strela-toast-item__icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
}

/* ── Info: синий градиент ── */
.strela-toast-item--info {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.34);
}

.strela-toast-item--info .strela-toast-item__icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
}

/* ── Warn: янтарный градиент ── */
.strela-toast-item--warn {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border: none;
    color: #111827;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.38);
}

.strela-toast-item--warn .strela-toast-item__icon {
    color: #111827;
    background: rgba(0, 0, 0, 0.12);
}

/* Совместимость: старый класс .toast-notification (footer, QR, смены) */
.toast-notification {
    position: fixed;
    top: var(--strela-toast-top);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-36px);
    width: min(420px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
    color: #fff;
    padding: 8px 14px 8px 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.38);
    z-index: 2147483000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease;
}

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

.toast-notification.error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.36);
}

.toast-notification .toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    font-size: 11px;
}
