/**
 * ========================================================================
 * CSS Notifications Globales - Modale des notifications utilisateur
 * ========================================================================
 * Fichier: /static/css/common/global-notifications.css
 */

/* ✅ Configuration de la modale */
.global-notifications-dialog {
    width: 50%;
    min-width: 350px;
    max-width: 800px;
}

.global-notifications-dialog .modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideInDown 0.3s ease-out;
}

/* ✅ En-tête de la modale */
.global-notifications-dialog .modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 1.25rem;
}

.global-notifications-dialog .modal-title {
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.global-notifications-dialog .modal-title .fa-bell {
    color: #0d6efd;
    animation: bellRing 2s ease-in-out;
}

/* ✅ Corps de la modale */
.global-notifications-dialog .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    background-color: #ffffff;
}

/* ✅ Item de notification */
.notification-item {
    display: flex;
    padding: 1.25rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

/* Bordure colorée à gauche selon le type */
.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.notification-item.info::before {
    background-color: #0d6efd;
}

.notification-item.warning::before {
    background-color: #ffc107;
}

.notification-item.critical::before {
    background-color: #dc3545;
}

/* ✅ Icône de notification */
.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 1rem;
    font-size: 1.25rem;
}

.notification-item.info .notification-icon {
    background-color: #e7f3ff;
    color: #0d6efd;
}

.notification-item.warning .notification-icon {
    background-color: #fff8e1;
    color: #f57c00;
}

.notification-item.critical .notification-icon {
    background-color: #ffebee;
    color: #dc3545;
}

/* ✅ Contenu de la notification */
.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Badge du type */
.notification-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.notification-type-badge.info {
    background-color: #e7f3ff;
    color: #0d6efd;
}

.notification-type-badge.warning {
    background-color: #fff8e1;
    color: #f57c00;
}

.notification-type-badge.critical {
    background-color: #ffebee;
    color: #dc3545;
}

/* Message */
.notification-message {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    white-space: pre-line; /* ✅ Préserve les sauts de lignes tout en wrappant le texte */
}

/* Lien */
.notification-link {
    margin-top: 0.75rem;
}

.notification-link .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Date */
.notification-date {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* ✅ Pied de la modale */
.global-notifications-dialog .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

/* ✅ Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -100px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

/* ✅ Scrollbar personnalisée */
.global-notifications-dialog .modal-body::-webkit-scrollbar {
    width: 8px;
}

.global-notifications-dialog .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.global-notifications-dialog .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.global-notifications-dialog .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ✅ État vide (au cas où) */
.global-notifications-dialog .text-muted.p-4 {
    padding: 3rem !important;
}

/* ✅ Responsive */
@media (max-width: 768px) {
    .global-notifications-dialog {
        width: 90%;
        min-width: 300px;
        margin: 1rem;
    }
    
    .notification-item {
        padding: 1rem;
    }
    
    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .notification-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ✅ Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .global-notifications-dialog .modal-content {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .global-notifications-dialog .modal-header,
    .global-notifications-dialog .modal-footer {
        background-color: #1a202c;
        border-color: #4a5568;
    }
    
    .global-notifications-dialog .modal-body {
        background-color: #2d3748;
    }
    
    .notification-item {
        border-color: #4a5568;
    }
    
    .notification-item:hover {
        background-color: #374151;
    }
    
    .notification-message {
        color: #cbd5e0;
        white-space: pre-line; /* ✅ Préserve les sauts de lignes en mode sombre */
    }
}

/* ✅ Focus et accessibilité */
.global-notifications-dialog .btn-close:focus,
.global-notifications-dialog .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ✅ Backdrop personnalisé */
.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.6);
}