/* ═══════════════════════════════════════════════════════════
   LISTE DES NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */

.notification-non-lue {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
    font-weight: 500;
}

.notification-lue {
    opacity: 0.7;
    background-color: #ffffff;
    border-left: 4px solid transparent;
}

/* ✅ Empêcher le fond noir Bootstrap sur :active */
.list-group-item-action:active,
.list-group-item-action:focus {
    background-color: #f8f9fa !important;
    color: inherit !important;
}

.notification-non-lue:active {
    background-color: #d0e7ff !important;
}

.notification-lue:active {
    background-color: #f5f5f5 !important;
}

.list-group-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.list-group-item:hover {
    background-color: #f8f9fa !important;
    transform: translateX(2px);
}

.badge-non-lu {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════
   MODAL SLIDE-UP (bottom sheet style)
   ═══════════════════════════════════════════════════════ */

/* Position du modal en bas de l'écran */
.modal-slide-up .modal-dialog {
    position: fixed;
    bottom: 25px;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    transition: none;
}

/* Coins arrondis en haut */
.modal-slide-up .modal-content {
    border-radius: 20px 20px 0 0;
    border: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow-y: auto;
}

/* Animation slide up */
.modal-slide-up.show .modal-dialog {
    animation: slideUpAnimation 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* État initial (caché) */
.modal-slide-up:not(.show) .modal-dialog {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Backdrop avec animation */
.modal-slide-up .modal-backdrop {
    transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════
   CONTENU DU MODAL
   ═══════════════════════════════════════════════════════ */

/* Header */
.modal-slide-up .modal-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-slide-up .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.modal-slide-up .btn-close {
    padding: 1rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Body */
.modal-slide-up .modal-body {
    padding: 1.5rem;
}

.notification-modal-message {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1e2125;
    white-space: pre-line;
    margin-top: 1rem;
}

/* Badge type */
.type-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.modal-slide-up .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
}

.modal-slide-up .modal-footer .btn {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* Desktop : modal centré avec largeur max */
@media (min-width: 576px) {
    .modal-slide-up .modal-dialog {
        max-width: 500px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .modal-slide-up.show .modal-dialog {
        animation: slideUpAnimationDesktop 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

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

    .modal-slide-up:not(.show) .modal-dialog {
        transform: translateX(-50%) translateY(100%);
    }
}

/* Mobile : liste scrollable */
@media (max-width: 575.98px) {
    .notification-item {
        padding: 0.75rem;
    }

    .notification-item h6 {
        font-size: 0.9rem;
    }

    .notification-item p {
        font-size: 0.85rem;
    }

    .badge-non-lu {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .modal-slide-up .modal-content {
        border-radius: 16px 16px 0 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS & TRANSITIONS
   ═══════════════════════════════════════════════════════ */

/* Smooth scroll dans le modal */
.modal-slide-up .modal-content {
    scroll-behavior: smooth;
}

/* Transition du backdrop */
.modal.fade .modal-backdrop {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal.show .modal-backdrop {
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════
   UTILITAIRES
   ═══════════════════════════════════════════════════════ */

.notification-time {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.fsize-13 {
    font-size: 0.8125rem;
}

/* Accessibilité */
.notification-item:focus,
.btn-marquer-toutes:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Print */
@media print {
    .modal-slide-up,
    .notification-item,
    [data-controller="notification-badge"],
    [data-controller="notification-list"] {
        display: none !important;
    }
}

/* Badge du header */
@keyframes pulse-badge {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.position-relative [data-notification-badge-target="count"] {
    animation: pulse-badge 2s ease-in-out infinite;
}

/* Transition douce sur tous les éléments */
* {
    -webkit-tap-highlight-color: transparent;
}
