/**
 * notification.css
 * Styles pour le système de notifications globales
 * Utilise les classes UI centralisées de ui-components.css
 */

/* ===== Conteneurs de notifications ===== */
.notification-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    max-width: 400px;
    width: 100%;
}

/* Positions */
.notification-container-top-right {
    top: 0;
    right: 0;
}

.notification-container-top-left {
    top: 0;
    left: 0;
}

.notification-container-top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.notification-container-bottom-right {
    bottom: 0;
    right: 0;
}

.notification-container-bottom-left {
    bottom: 0;
    left: 0;
}

.notification-container-bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== Item de notification ===== */
/* Utilise les classes UI centralisées : .ui-card et .ui-card-bordered seront ajoutées via JS */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
    cursor: pointer;
    min-height: 60px;
}

/* ===== Icône ===== */
.notification-icon {
    /* Hérite de ui-card-icon */
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

/* ===== Contenu ===== */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    color: var(--color-text-primary);
}

.notification-message {
    font-size: 0.875rem;
    line-height: 1.5;
   color: var(--color-text-secondary);
    word-wrap: break-word;
}

/* ===== Bouton de fermeture ===== */
.notification-close {
    /* Hérite de ui-btn ui-btn-close */
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}


/* ===== Types de notifications ===== */
/* Les classes ui-card-info, ui-card-success, etc. seront ajoutées via JS pour utiliser les styles centralisés */

/* Info */
.notification-info {
    border-left-color: #3498db;
}

/* Succès */
.notification-success {
    border-left-color: #27ae60;
}

/* Avertissement */
.notification-warning {
    border-left-color: #f39c12;
}

.notification-warning .notification-icon {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

/* Erreur */
.notification-error {
    border-left-color: #e74c3c;
}

.notification-error .notification-icon {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Loading */
.notification-loading {
    border-left-color: #9b59b6;
}

.notification-loading .notification-icon {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Animations ===== */

/* Entrée */
.notification-entering {
    animation: notificationSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pour les positions à gauche */
.notification-container-top-left .notification-entering,
.notification-container-bottom-left .notification-entering {
    animation: notificationSlideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes notificationSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pour les positions centrées */
.notification-container-top-center .notification-entering,
.notification-container-bottom-center .notification-entering {
    animation: notificationSlideInCenter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes notificationSlideInCenter {
    from {
        opacity: 0;
        transform: translateY(-100%) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

/* Visible */
.notification-visible {
    opacity: 1;
}

/* Sortie */
.notification-exiting {
    animation: notificationSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

/* Pour les positions à gauche */
.notification-container-top-left .notification-exiting,
.notification-container-bottom-left .notification-exiting {
    animation: notificationSlideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes notificationSlideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-100%) scale(0.9);
    }
}

/* Pour les positions centrées */
.notification-container-top-center .notification-exiting,
.notification-container-bottom-center .notification-exiting {
    animation: notificationFadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes notificationFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .notification-container {
        max-width: 100%;
        padding: 0.5rem;
    }
    
    .notification-item {
        font-size: 0.875rem;
    }
    
    .notification-icon {
        font-size: 1.25rem;
        width: 28px;
        height: 28px;
    }
}



/* ===== Accessibilité ===== */
@media (prefers-reduced-motion: reduce) {
    .notification-entering,
    .notification-exiting {
        animation: none;
        transition: opacity 0.2s ease;
    }
    
    .notification-item:hover {
        transform: none;
    }
}

/* Focus visible pour l'accessibilité au clavier */
.notification-item:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}
