/* assets/front/css/toast.css */

/* Conteneur des toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

/* Toast individuel */
.toast {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid;
    position: relative;
}

/* Animation d'entrée */
.toast-show {
    transform: translateX(0);
    opacity: 1;
}

/* Animation de sortie */
.toast-hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Contenu du toast */
.toast-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    position: relative;
    z-index: 2;
}

/* Icône du toast */
.toast-icon {
    margin-right: 12px;
    font-size: 20px;
    flex-shrink: 0;
}

/* Message du toast */
.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
}

/* Bouton de fermeture */
.toast-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    margin-left: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Barre de progression */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
    transform-origin: left;
    animation: toast-progress 5s linear forwards;
}

/* Types de toast */
.toast-success {
    border-left-color: #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

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

.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

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

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-warning .toast-progress {
    background: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-info .toast-progress {
    background: #3b82f6;
}

/* Animation de la barre de progression */
@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        margin-bottom: 8px;
    }
    
    .toast-content {
        padding: 12px 16px;
    }
    
    .toast-message {
        font-size: 13px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .toast-message {
        color: #f9fafb;
    }
    
    .toast-close {
        color: #9ca3af;
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f9fafb;
    }
}

/* Toast spécial pour les erreurs de sécurité */
.toast-security-error {
    border-left-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.toast-security-error .toast-icon {
    color: #dc2626;
    animation: pulse 2s infinite;
}

.toast-security-error .toast-message {
    color: #dc2626;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
