/* ---- The bell in the topbar ---- */

.notification-bell {
    margin-left: auto;
}

/* The topbar puts the user menu on the right; the bell sits immediately to
   its left, so only the bell claims the free space. */
.admin-topbar .notification-bell + .dropdown,
.admin-topbar .notification-bell + .admin-user-menu {
    margin-left: 0;
}

.notification-bell-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #334155;
    font-size: 1.15rem;
    transition: background-color .15s ease, color .15s ease;
}

.notification-bell-button:hover,
.notification-bell-button[aria-expanded="true"] {
    background: #e2e8f0;
    color: #0f172a;
}

.notification-bell-button::after {
    display: none;
}

.notification-badge {
    position: absolute;
    top: .15rem;
    right: .05rem;
    min-width: 1.15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
}

/* ---- The dropdown ---- */

.notification-dropdown {
    width: min(23rem, calc(100vw - 2rem));
    padding: 0;
    overflow: hidden;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .7rem .9rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}

.notification-mark-all {
    border: 0;
    background: none;
    padding: 0;
    font-size: .72rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #2563eb;
}

.notification-mark-all:hover {
    text-decoration: underline;
}

.notification-dropdown-body {
    max-height: 22rem;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: .65rem;
    padding: .7rem .9rem;
    border-bottom: 1px solid #f1f5f9;
    color: inherit;
    text-decoration: none;
}

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

/* Unread is highlighted; read is muted. */
.notification-item.is-unread {
    background: #eff6ff;
}

.notification-item.is-unread:hover {
    background: #dbeafe;
}

.notification-item:not(.is-unread) {
    opacity: .72;
}

.notification-item-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
}

.notification-item.is-unread .notification-item-icon {
    background: #bfdbfe;
    color: #1d4ed8;
}

.notification-item-body {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.notification-item-title {
    font-size: .87rem;
    font-weight: 600;
    color: #0f172a;
}

.notification-item-message {
    font-size: .8rem;
    color: #475569;
}

.notification-item-time {
    font-size: .72rem;
    color: #94a3b8;
}

.notification-empty {
    padding: 1.4rem .9rem;
    text-align: center;
    font-size: .85rem;
    color: #94a3b8;
}

.notification-dropdown-footer {
    display: block;
    padding: .65rem .9rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.notification-dropdown-footer:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

/* ---- The Notification Center page ---- */

.notification-center-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    white-space: nowrap;
}

.notification-center-table tbody tr.is-unread {
    background: #eff6ff;
}

/* The whole row opens the notification, so it has to look like it does. */
.notification-center-row {
    cursor: pointer;
}

.notification-center-table tbody tr.notification-center-row:hover {
    background: #e8f0fe;
}

/* The title is a real link, but inside a row that is already clickable it
   should read as text rather than as a second, competing target. */
.notification-center-link,
.notification-center-link:hover,
.notification-center-link:focus {
    display: block;
    text-decoration: none;
    color: inherit;
}

.notification-center-link:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

.notification-center-title {
    font-weight: 600;
    color: #0f172a;
}

.notification-center-row:hover .notification-center-title {
    color: #1d4ed8;
}

.notification-center-message {
    font-size: .84rem;
    color: #475569;
}

.notification-center-dates {
    white-space: nowrap;
}

.notification-empty-state {
    border: 1px dashed #d1d5db;
    border-radius: .55rem;
    padding: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: .85rem;
}

/* ---- The Notification Center dialog ---- */

.notification-modal-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.notification-modal-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem .85rem;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    background: #fff;
}

.notification-modal-item.is-unread {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.notification-modal-item:not(.is-unread) {
    opacity: .8;
}

.notification-modal-item .notification-item-icon {
    margin-top: .1rem;
}

.notification-modal-item.is-unread .notification-item-icon {
    background: #bfdbfe;
    color: #1d4ed8;
}

.notification-modal-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.notification-modal-item-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 600;
    color: #0f172a;
}

/* The unread indicator: a dot rather than a word, so a long title still
   fits on a phone. */
.notification-modal-dot {
    flex: 0 0 auto;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #2563eb;
}

.notification-modal-item-message {
    margin: .15rem 0 .3rem;
    font-size: .84rem;
    color: #475569;
    overflow-wrap: anywhere;
}

.notification-modal-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    font-size: .74rem;
    color: #94a3b8;
}

.notification-modal-item-actions {
    flex: 0 0 auto;
    display: flex;
    gap: .25rem;
}

@media (max-width: 575.98px) {
    .notification-modal-item {
        flex-wrap: wrap;
    }

    .notification-modal-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
