/* Toast Notifications CSS - KMH */

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

/* Toast individuel */
.toast {
    position: relative;
    min-width: 300px;
    max-width: 400px;
    margin-bottom: 15px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hiding {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
}

/* Types de toast */
.toast.success {
    border-left: 4px solid #27ae60;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff9 100%);
}

.toast.error {
    border-left: 4px solid #e74c3c;
    background: linear-gradient(135deg, #ffffff 0%, #fff8f8 100%);
}

.toast.warning {
    border-left: 4px solid #f39c12;
    background: linear-gradient(135deg, #ffffff 0%, #fffdf7 100%);
}

.toast.info {
    border-left: 4px solid #3498db;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

/* Contenu du toast */
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-top: 2px;
}

.toast.success .toast-icon {
    color: #27ae60;
}

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

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

.toast.info .toast-icon {
    color: #3498db;
}

.toast-message {
    flex: 1;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
}

.toast-description {
    font-weight: 400;
    color: #7f8c8d;
    font-size: 13px;
}

/* Bouton de fermeture */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #7f8c8d;
}

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

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: transform linear;
}

.toast.success .toast-progress-bar {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.toast.error .toast-progress-bar {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.toast.warning .toast-progress-bar {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.toast.info .toast-progress-bar {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

/* Animations supplémentaires */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
    50% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    }
}

.toast.success {
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), toastPulse 2s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        margin-bottom: 10px;
        transform: translateY(-100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast.hiding {
        transform: translateY(-100%);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2c3e50;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #ecf0f1;
    }
    
    .toast-message {
        color: #ecf0f1;
    }
    
    .toast-description {
        color: #bdc3c7;
    }
    
    .toast.success {
        background: linear-gradient(135deg, #2c3e50 0%, #1e3d32 100%);
    }
    
    .toast.error {
        background: linear-gradient(135deg, #2c3e50 0%, #3d1e1e 100%);
    }
    
    .toast.warning {
        background: linear-gradient(135deg, #2c3e50 0%, #3d2f1e 100%);
    }
    
    .toast.info {
        background: linear-gradient(135deg, #2c3e50 0%, #1e2a3d 100%);
    }
}
