/**
 * Système de notifications Toast - Design Moderne
 * Types supportés : success, warning, error
 * Format : Titre + Message obligatoires
 */

/* ===== CONTAINER ===== */

.notifications-container {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-index-notification);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

/* ===== NOTIFICATION BASE ===== */

.notification {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(calc(100% + var(--spacing-xl)));
    animation: slideInNotification 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

@keyframes slideInNotification {
    0% {
        opacity: 0;
        transform: translateX(calc(100% + var(--spacing-xl))) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.notification.closing {
    animation: slideOutNotification 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slideOutNotification {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(calc(100% + var(--spacing-xl))) scale(0.9);
    }
}

/* ===== ICÔNE ===== */

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notification-icon svg {
    width: 28px;
    height: 28px;
}

/* ===== CONTENU ===== */

.notification-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.notification-title {
    font-family: var(--font-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-tight);
}

.notification-message {
    font-size: var(--font-size-sm);
    color: var(--color-text-medium);
    line-height: var(--line-height-normal);
    word-wrap: break-word;
}

/* ===== BOUTON FERMER ===== */

.notification-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--color-gray-dark);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-size: 20px;
    line-height: 1;
    opacity: 0.5;
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.notification-close:active {
    transform: scale(0.95);
}

/* ===== BARRE DE PROGRESSION ===== */

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: currentColor;
    opacity: 0.3;
    transform-origin: left;
    animation: progressShrink linear forwards;
}

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ===== TYPES DE NOTIFICATIONS ===== */

/* SUCCESS (Vert) */
.notification--success .notification-icon {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-success-light) 15%, transparent), color-mix(in srgb, var(--color-success) 15%, transparent));
    color: var(--color-success);
}

.notification--success .notification-progress {
    color: var(--color-success);
}

/* WARNING (Orange) */
.notification--warning .notification-icon {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-warning-light) 15%, transparent), color-mix(in srgb, var(--color-warning) 15%, transparent));
    color: var(--color-warning);
}

.notification--warning .notification-progress {
    color: var(--color-warning);
}

/* ERROR (Rouge) */
.notification--error .notification-icon {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-error-light) 15%, transparent), color-mix(in srgb, var(--color-error) 15%, transparent));
    color: var(--color-error);
}

.notification--error .notification-progress {
    color: var(--color-error);
}

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

/* Tablettes (≤ 768px) */
@media (max-width: 768px) {
    .notifications-container {
        right: var(--spacing-md);
        left: var(--spacing-md);
        max-width: none;
        bottom: var(--spacing-md);
    }

    .notification {
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .notification-icon {
        width: 36px;
        height: 36px;
    }

    .notification-icon svg {
        width: 24px;
        height: 24px;
    }

    .notification-title {
        font-size: var(--font-size-sm);
    }

    .notification-message {
        font-size: var(--font-size-xs);
    }

    .notification-close {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

/* Mobile (≤ 480px) */
@media (max-width: 480px) {
    .notifications-container {
        right: var(--spacing-xs);
        left: var(--spacing-xs);
        bottom: var(--spacing-xs);
        gap: var(--spacing-xs);
    }

    .notification {
        padding: 12px;
        gap: 8px;
        max-width: calc(100vw - 24px);
    }

    .notification-icon {
        width: 28px;
        height: 28px;
    }

    .notification-icon svg {
        width: 18px;
        height: 18px;
    }

    .notification-title {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .notification-message {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .notification-close {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
}
