/* Conteneur de la cloche */
#notifbell-container {
    position: relative;
    margin-right: 15px;
}

#notifbell-dropdown {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.4rem 0.6rem !important;
}

#notifbell-dropdown:hover {
    transform: scale(1.05);
}

/* Cloche */
#notifbell-dropdown i.fa-bell {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

#notifbell-dropdown:hover i.fa-bell {
    transform: rotate(20deg);
}

/* Badge */
#notifbell-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translate(25%, -25%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(25%, -25%) scale(1); }
    50% { transform: translate(25%, -25%) scale(1.1); }
}

/* Menu dropdown */
#notifbell-container .dropdown-menu {
    min-width: 380px !important;
    max-width: 400px !important;
    max-height: 500px !important;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0;
}

/* ========== HEADER AVEC BOUTON OPTIONS ========== */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.notif-header-left strong {
    font-size: 0.95rem;
    color: #495057;
}

.notif-header-right {
    display: flex;
    gap: 6px;
    align-items: center;
}

.notif-header-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.notif-header-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    text-decoration: none;
}

.notif-header-btn i {
    margin-right: 3px;
}

.notif-header-btn.mark-all-btn {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.notif-header-btn.mark-all-btn:hover {
    background: #0b5ed7;
    border-color: #0b5ed7;
}

.notif-header-btn.options-btn {
    padding: 5px 8px;
}

/* ========== MENU FILTRES (SOUS OPTIONS) ========== */
.notif-filters-menu {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.filters-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.filters-row:last-of-type {
    margin-bottom: 12px;
}

.filters-row label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    margin: 0;
}

.filter-select {
    padding: 5px 8px;
    font-size: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
}

.filter-select:hover {
    border-color: #0d6efd;
}

.filter-select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.1);
}

/* Actions dans le menu filtres */
.filters-actions {
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-action-btn {
    width: 100%;
    padding: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.filter-action-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    text-decoration: none;
}

.filter-action-btn.config-btn {
    border-color: #0d6efd;
    color: #0d6efd;
}

.filter-action-btn.config-btn:hover {
    background: #0d6efd;
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

/* ========== ITEM DE NOTIFICATION ========== */
.notif-item-wrapper {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.notif-item-wrapper:hover {
    background-color: #f8f9fa !important;
}

.notif-item-link {
    flex: 1;
    padding: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.notif-item-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Actions sur chaque notification */
.notif-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
}

.notif-action-icon {
    background: white;
    border: 1px solid #dee2e6;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: #6c757d;
}

.notif-action-icon:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    transform: scale(1.1);
}

.notif-action-icon.text-danger {
    color: #dc3545;
}

.notif-action-icon.text-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white !important;
}

/* Notification non lue */
.notif-unread {
    background-color: #e7f3ff !important;
    border-left: 4px solid #0d6efd;
}

.notif-unread .notif-item-link {
    padding-left: 8px;
}

.notif-unread:hover {
    background-color: #d0e7ff !important;
}

/* Icone */
.notif-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.notif-icon i {
    font-size: 1rem;
}

.notif-unread .notif-icon {
    background: #0d6efd;
}

.notif-unread .notif-icon i {
    color: white !important;
}

/* Badges */
.notif-item-wrapper .badge {
    font-size: 0.65rem;
    padding: 3px 7px;
    font-weight: 600;
    border-radius: 3px;
}

/* Info ticket */
.notif-ticket {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
}

/* Ligne auteur */
.notif-author-line {
    font-size: 0.65rem;
    color: #999;
    margin-top: 2px;
    margin-bottom: 4px;
}

/* Entité */
.notif-entity {
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 0;
}

.notif-entity i {
    font-size: 0.65rem;
    margin-right: 3px;
}

.notif-separator-text {
    font-size: 0.7rem;
    color: #ddd;
    margin: 2px 0;
    line-height: 1;
}

/* Contenu */
.notif-content {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Encart contenu avec fond gris */
.notif-content-box {
    font-size: 0.75rem;
    line-height: 1.3;
    color: #495057;
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 3px solid #dee2e6;
    margin: 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Horodatage */
.notif-time {
    font-size: 0.7rem;
    color: #999;
}

.notif-time i {
    font-size: 0.65rem;
}

/* Message vide */
#notifbell-list .text-muted.py-4 {
    padding: 40px 20px !important;
}

#notifbell-list .text-muted.py-4 i {
    opacity: 0.3;
    color: #999;
}

/* Scrollbar */
#notifbell-container .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

#notifbell-container .dropdown-menu::-webkit-scrollbar-track {
    background: #f8f9fa;
}

#notifbell-container .dropdown-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

#notifbell-container .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Divider */
.dropdown-divider {
    margin: 0;
    border-color: #e9ecef;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 576px) {
    #notifbell-container .dropdown-menu {
        min-width: 280px !important;
        max-width: calc(100vw - 30px) !important;
        max-height: 70vh !important;
        position: fixed !important;
        right: 15px !important;
        left: auto !important;
        top: 60px !important;
    }
    
    .notif-header {
        padding: 10px 12px;
    }
    
    .notif-header-left strong {
        font-size: 0.85rem;
    }
    
    .notif-header-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .notif-filters-menu {
        padding: 10px 12px;
    }
    
    .filters-row {
        grid-template-columns: 70px 1fr;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .filters-row label {
        font-size: 0.7rem;
    }
    
    .filter-select {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .notif-actions {
        padding: 6px;
        gap: 3px;
    }
    
    .notif-action-icon {
        padding: 5px 6px;
        font-size: 0.75rem;
    }
    
    .notif-item-link {
        padding: 10px;
    }
    
    .notif-icon {
        width: 32px;
        height: 32px;
    }
    
    .notif-icon i {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) and (min-width: 577px) {
    #notifbell-container .dropdown-menu {
        min-width: 340px !important;
        max-width: 360px !important;
    }
}

@media (max-width: 380px) {
    #notifbell-container .dropdown-menu {
        min-width: 260px !important;
        max-width: calc(100vw - 20px) !important;
        right: 10px !important;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .filters-row label {
        display: none;
    }
}