/* ============================================================
   TOAST NOTIFICATION – Thème Cinéflix (refonte moderne)
   ============================================================
   Design épuré : carte verre simple, icône dans un badge rond,
   fade in / fade out fluide + barre de progression discrète.
   ============================================================ */

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 90%;
    max-width: 420px;
    pointer-events: none;
    font-family: 'Inter', 'Space Grotesk', sans-serif;
}

.toast-item {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 14px 14px 16px;
    background: var(--glass, rgba(12, 12, 28, 0.65));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius, 14px);
    box-shadow: var(--shadow-card, 0 8px 40px rgba(0, 0, 0, 0.5));
    overflow: hidden;
    animation: toastIn 0.35s ease forwards;
}

/* Barre de progression discrète en bas de la carte */
.toast-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--cyan, #00d4ff);
    opacity: 0.35;
    transform-origin: left;
    animation: toastProgress linear forwards;
    animation-duration: var(--toast-duration, 4000ms);
}

.toast-item.closing {
    animation: toastOut 0.3s ease forwards;
}

/* Badge icône rond */
.toast-item .toast-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: rgba(0, 212, 255, 0.12);
    color: var(--cyan, #00d4ff);
}

/* Texte */
.toast-item span {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text, #e8e8f0);
    letter-spacing: 0.1px;
}

/* Bouton fermeture — zone de clic généreuse, icône discrète */
.toast-item .toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -6px -6px -6px 0;
    background: none;
    border: none;
    color: var(--text-muted, #9898b8);
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 8px;
    transition: color var(--transition-fast, 0.2s), background var(--transition-fast, 0.2s);
}
.toast-item .toast-close:hover {
    color: var(--text, #e8e8f0);
    background: rgba(255, 255, 255, 0.06);
}

/* ---------- Variantes ---------- */
.toast-item.success::after { background: #10b981; }
.toast-item.success .toast-icon {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
}

.toast-item.error::after { background: #ef4444; }
.toast-item.error .toast-icon {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

.toast-item.info::after { background: #3b82f6; }
.toast-item.info .toast-icon {
    background: rgba(59, 130, 246, 0.14);
    color: #3b82f6;
}

/* ---------- Animations ---------- */
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); max-height: 100px; margin-bottom: 10px; }
    to   { opacity: 0; transform: translateY(-24px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .toast-item, .toast-item::after {
        animation: none !important;
    }
}