/* Cloche de la navbar (components/_notification*.html.twig). Les annonces en direct
   passent par le toast SweetAlert2 des messages flash (contrôleur notification-toast). */

.swal2-container.swal2-top-end,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top {
    top: 4.5rem !important;
}

.nav-notif .count-notification {
    position: absolute;
    top: 15px;
    right: -5px;
    background: var(--marque);
    color: white;
    border-radius: 12px;
    padding: 3px 7px;
    font-size: 8px;
    font-weight: bold;
    min-width: 5px;
    height: 10px;
    line-height:0.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Compteur vide (aucune non lue) : masqué, sans JavaScript - les Turbo Streams se
   contentent d'en mettre à jour le texte. */
.nav-notif .count-notification:empty {
    display: none;
}

.dropdown-item.preview-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
    white-space: normal;
}

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

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

/* Notification lue : estompée, elle reste consultable jusqu'à sa suppression. */
.dropdown-item.preview-item.is-read {
    opacity: 0.6;
}

.preview-thumbnail {
    margin-right: 12px;
}

.preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.preview-icon svg,
.preview-icon i {
    width: 20px;
    height: 20px;
}

.preview-item-content {
    flex: 1;
    min-width: 0;
}

.preview-subject {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.preview-item-content p {
    font-size: 12px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Actions de l'item (ouvrir, marquer lue, supprimer) : formulaires POST répondus
   en Turbo Stream. */
.notification-item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 2px;
    margin-left: 8px;
}

.notification-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--bs-secondary-color);
}

.notification-action:hover {
    background: rgba(8, 101, 114, 0.1);
    color: var(--marque);
}

.notification-action-supprimer:hover {
    background: rgba(228, 46, 49, 0.1);
    color: var(--delete);
}

/* ---- Thème sombre ---- */

/* Toasts SweetAlert2 (messages flash et annonces) : leur fond suit `--swal2-background`,
   redéfini dans app.css ; on y ajoute une bordure et une ombre lisibles sur fond sombre. */
[data-bs-theme="dark"] .swal2-popup.swal2-toast {
    border: 1px solid var(--bs-border-color-translucent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .dropdown-item.preview-item {
    border-bottom-color: var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .dropdown-item.preview-item:hover {
    background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .preview-subject {
    color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .notification-action:hover {
    background: rgba(105, 199, 211, 0.12);
    color: var(--marque-claire);
}

[data-bs-theme="dark"] .notification-action-supprimer:hover {
    background: rgba(228, 46, 49, 0.15);
    color: #f17c7e;
}
