/**
 * Système de Notifications Professionnel
 * Philosophie: Élégant mais discret, fluide et naturel, utile et informatif
 */

/* ========================================
   TOAST CONTAINER
   ======================================== */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* ========================================
   TOAST STYLES - ÉLÉGANT & DISCRET
   ======================================== */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-left: 4px solid;
    pointer-events: auto;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    animation: slideUpFromBottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(4px);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    animation: iconScale 0.5s ease-out;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-message {
    margin: 0;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #999;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333;
}

/* Toast Types */
.toast-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

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

.toast-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

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

.toast-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

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

.toast-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

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

/* ========================================
   LOADING MODAL
   ======================================== */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.loading-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.loading-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: white;
    padding: 40px 32px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', sans-serif;
    animation: slideUpScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-message {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

/* ========================================
   ANIMATIONS - PHILOSOPHIE: FLUIDE & NATUREL
   ======================================== */

/* Entrée toast depuis le bas */
@keyframes slideUpFromBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icône apparition avec élévation */
@keyframes iconScale {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Sortie toast vers le bas */
@keyframes slideDownToBottom {
    to {
        opacity: 0;
        transform: translateY(100px);
    }
}

/* Overlay fade */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal slide up */
@keyframes slideUpScale {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Spinner minimaliste */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation de fermeture */
.animate-toast-out {
    animation: slideDownToBottom 0.3s ease-in forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        padding: 14px;
        font-size: 13px;
    }

    .loading-modal-content {
        margin: 20px;
        padding: 32px 24px;
    }

    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }

    .loading-message {
        font-size: 14px;
    }
}
