/**
 * Notifications Toast System CSS
 * Système de notifications visuelles avec animations
 */

/* Container pour les toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

/* Toast individuel */
.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
    padding: 16px;
    border-left: 4px solid #3b82f6;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
    word-wrap: break-word;
}

/* Toast visible */
.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Toast en cours de suppression */
.toast.hide {
    transform: translateX(100%);
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
}

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

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

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

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

/* Header du toast */
.toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Corps du toast */
.toast-body {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    margin: 0;
}

/* Icônes par type */
.toast-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

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

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

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

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

/* Barre de progression */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: #3b82f6;
    width: 100%;
    transform-origin: left;
    animation: toast-progress 5s linear forwards;
}

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

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

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

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

/* Mode sombre */
.dark .toast {
    background: #1f2937;
    color: #f9fafb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dark .toast-title {
    color: #f9fafb;
}

.dark .toast-body {
    color: #d1d5db;
}

.dark .toast-close {
    color: #9ca3af;
}

.dark .toast-close:hover {
    background: #374151;
    color: #f3f4f6;
}

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

/* Animation de pulsation pour les nouvelles notifications */
@keyframes pulse-notification {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.toast.pulse {
    animation: pulse-notification 0.6s ease-in-out;
}

/* Animation de secousse pour attirer l'attention */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.toast.shake {
    animation: shake 0.5s ease-in-out;
}

/* Effet de brillance pour les notifications importantes */
.toast.highlight {
    position: relative;
    overflow: hidden;
}

.toast.highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 2s ease-in-out;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}