/**
 * TOAST NOTIFICATIONS
 * Système de notifications temporaires pour feedback utilisateur
 */

/* Container pour les toasts */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    z-index: 9999;
    transition: bottom 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Toast visible */
.toast.show {
    bottom: 2rem;
}

/* Toast avec icône */
.toast::before {
    content: '';
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ========== TYPES DE TOAST ========== */

/* Success (vert) */
.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-success::before {
    content: '✅';
}

/* Warning (orange) */
.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast-warning::before {
    content: '⚠️';
}

/* Error (rouge) */
.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-error::before {
    content: '❌';
}

/* Info (bleu) */
.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-info::before {
    content: 'ℹ️';
}

/* ========== ANIMATIONS ========== */

/* Animation entrée */
@keyframes slideInUp {
    from {
        bottom: -100px;
        opacity: 0;
    }
    to {
        bottom: 2rem;
        opacity: 1;
    }
}

/* Animation sortie */
@keyframes slideOutDown {
    from {
        bottom: 2rem;
        opacity: 1;
    }
    to {
        bottom: -100px;
        opacity: 0;
    }
}

.toast.show {
    animation: slideInUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.hide {
    animation: slideOutDown 0.3s ease-in;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .toast {
        min-width: 280px;
        max-width: calc(100vw - 2rem);
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        left: 1rem;
        right: 1rem;
        transform: none;
    }

    .toast.show {
        bottom: 1rem;
    }

    .toast::before {
        font-size: 1.25rem;
    }
}

/* ========== TOAST AVEC BOUTON DE FERMETURE ========== */

.toast-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0.25rem;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast avec bouton de fermeture nécessite padding supplémentaire */
.toast.has-close {
    padding-right: 3rem;
}

/* ========== TOAST STACK (plusieurs toasts) ========== */

.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.toast-container .toast {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        transform: none;
        bottom: 1rem;
    }
}

/* ========== TOAST AVEC ICÔNE PERSONNALISÉE ========== */

.toast.custom-icon::before {
    content: attr(data-icon);
}

/* ========== TOAST AVEC BARRE DE PROGRESSION ========== */

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
    border-radius: 0 0 12px 12px;
}

.toast-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

/* Toast avec progress nécessite padding en bas */
.toast.has-progress {
    padding-bottom: 1.25rem;
}
