/* ============================================================
   BAID Toast — Feedback visuel post-action
   Usage : window.baidToast(titre, sousTitre, type, durée)
   Types : 'brand' (défaut), 'success', 'error', 'info'
   ============================================================ */

.baid-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    color: #fff;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    min-width: 240px;
    max-width: 340px;
    opacity: 0;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.28s ease;
    pointer-events: none;
}

.baid-toast.baid-toast--visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* ---- Variantes de couleur ---- */
.baid-toast--brand {
    background: linear-gradient(135deg, #6366f1, #ec4899);
}

.baid-toast--success {
    background: #10b981;
}

.baid-toast--error {
    background: #ef4444;
}

.baid-toast--info {
    background: #64748b;
}

/* ---- Structure interne ---- */
.baid-toast__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.baid-toast__content {
    min-width: 0;
}

.baid-toast__title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.baid-toast__sub {
    font-size: 0.8rem;
    opacity: 0.88;
    margin-top: 2px;
}

/* ---- Responsive mobile ---- */
@media (max-width: 480px) {
    .baid-toast {
        top: auto;
        /* Au-dessus de la bottom-nav app (62px) si présente */
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        left: 1rem;
        right: 1rem;
        max-width: none;
        min-width: 0;
        transform: translateY(calc(100% + 2rem));
    }

    /* Pas de bottom-nav (pages sans .baid-user-app) → marge classique */
    body:not(.baid-user-app) .baid-toast {
        bottom: 1.25rem;
    }

    .baid-toast.baid-toast--visible {
        transform: translateY(0);
    }
}
