/* ============================================================================
 *  Notification bell — top-bar notification center (the dropdown + badge).
 *  Loaded globally from base.twig; markup lives in site/navigation.twig.
 * ========================================================================== */

.portal-notif {
    position: relative;
    flex-shrink: 0;
    /* On pages without the server-stats strip (non-admins), this pulls the bell
       and clock together against the right edge. With stats present, the stats
       strip already absorbs the free space, so this is a no-op. */
    margin-left: auto;
    display: inline-flex;
    align-items: center;
}

.portal-notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.portal-notif-btn:hover,
.portal-notif-btn:focus-visible,
.portal-notif-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

/* Unread count pill, top-right of the bell. */
.portal-notif-badge {
    position: absolute;
    top: -1px;
    right: -2px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--portal-notif-accent, #e5484d);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px var(--portal-topbar-bg, #16181d);
    pointer-events: none;
}

/* Dropdown panel. */
.portal-notif-menu {
    width: 340px;
    max-width: calc(100vw - 1.5rem);
    padding: 0;
    margin-top: 0.4rem;
    border-radius: 0.6rem;
    overflow: hidden;
}

.portal-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--portal-chrome-divider, rgba(255, 255, 255, 0.08));
}

.portal-notif-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.portal-notif-markall {
    border: 0;
    background: transparent;
    color: var(--portal-accent-teal, #00dad8);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
}

.portal-notif-markall:hover {
    text-decoration: underline;
}

.portal-notif-markall:disabled {
    opacity: 0.4;
    cursor: default;
    text-decoration: none;
}

/* Scrollable list. */
.portal-notif-list {
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.portal-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--portal-chrome-divider, rgba(255, 255, 255, 0.05));
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.portal-notif-item:last-child {
    border-bottom: 0;
}

.portal-notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.portal-notif-item.is-unread {
    background: rgba(0, 218, 216, 0.06);
}

.portal-notif-item.is-unread:hover {
    background: rgba(0, 218, 216, 0.1);
}

/* Round category icon. */
.portal-notif-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--portal-accent-teal, #00dad8);
    font-size: 0.75rem;
}

.portal-notif-body {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-notif-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
}

.portal-notif-item-text {
    font-size: 0.74rem;
    opacity: 0.8;
    line-height: 1.3;
    margin-top: 0.1rem;
    /* clamp to two lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-notif-item-time {
    font-size: 0.66rem;
    opacity: 0.55;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Unread dot on the right of an item. */
.portal-notif-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-top: 0.4rem;
    background: var(--portal-notif-accent, #e5484d);
}

.portal-notif-item:not(.is-unread) .portal-notif-dot {
    visibility: hidden;
}

.portal-notif-empty {
    padding: 1.5rem 0.85rem;
    text-align: center;
    font-size: 0.78rem;
}

.portal-notif-loading {
    padding: 1.25rem 0.85rem;
    text-align: center;
    font-size: 0.78rem;
    opacity: 0.7;
}

.portal-notif-foot {
    display: block;
    padding: 0.6rem 0.85rem;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--portal-accent-teal, #00dad8);
    border-top: 1px solid var(--portal-chrome-divider, rgba(255, 255, 255, 0.08));
}

.portal-notif-foot:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--portal-accent-teal, #00dad8);
}
