/*
 * Navbar notification inbox — minimal dropdown, aligned with profile menu.
 */

/* Unread bell dot (sibling of the button — buttons clip absolute children) */
.navbar-notif-wrap {
    position: relative;
    flex-shrink: 0;
    overflow: visible;
}

.navbar-notif-btn__badge {
    position: absolute;
    top: -3px;
    right: -3px;
    z-index: 2;
    width: 10px;
    height: 10px;
    min-width: 10px;
    padding: 0;
    border-radius: 9999px;
    background: #ef4444;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
    pointer-events: none;
}

.navbar-notif-btn__badge:not([hidden]),
.navbar-notif-btn__badge.is-on {
    display: block !important;
}

html[data-theme="dark"] .navbar-notif-btn__badge {
    border-color: #111827;
    background: #f87171;
}

.notif-popup {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    width: 320px;
    max-width: min(320px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 80px));
    padding: 0;
    background: #09090b;
    border: 1px solid #1f1f23;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    font-family: inherit;
    color: #ffffff;
    overflow: hidden;
}

html[data-theme="dark"] .notif-popup {
    background: #09090b;
    border-color: #1f1f23;
    color: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.notif-popup[hidden] {
    display: none;
}

.notif-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #1f1f23;
    flex-shrink: 0;
}

html[data-theme="dark"] .notif-popup__header {
    border-bottom-color: #1f1f23;
}

.notif-popup__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
}

.notif-popup__mark-all {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: #3b82f6;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.notif-popup__mark-all:hover {
    color: #60a5fa;
    text-decoration: underline;
}

html[data-theme="dark"] .notif-popup__mark-all {
    color: #3b82f6;
}

html[data-theme="dark"] .notif-popup__mark-all:hover {
    color: #60a5fa;
}

.notif-popup__body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 4px 0;
}

.notif-popup__body[aria-busy="true"] {
    opacity: 0.65;
}

.notif-popup__status {
    margin: 0;
    padding: 20px 12px;
    font-size: 12px;
    color: #a1a1aa;
    text-align: center;
}

.notif-popup__status:empty {
    display: none;
    padding: 0;
}

html[data-theme="dark"] .notif-popup__status {
    color: #a1a1aa;
}

.notif-popup__empty {
    padding: 28px 12px;
    text-align: center;
}

.notif-popup__empty p {
    margin: 0;
    font-size: 12px;
    color: #a1a1aa;
}

html[data-theme="dark"] .notif-popup__empty p {
    color: #a1a1aa;
}

.notif-item {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    transition: background-color 0.12s ease;
}

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

html[data-theme="dark"] .notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notif-item__dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-top: 5px;
    border-radius: 9999px;
    background: #3b82f6;
    opacity: 0;
}

.notif-item--unread .notif-item__dot {
    opacity: 1;
}

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

.notif-item__title {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    color: inherit;
}

.notif-item--unread .notif-item__title {
    font-weight: 600;
}

.notif-item__body {
    margin: 2px 0 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: #a1a1aa;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html[data-theme="dark"] .notif-item__body {
    color: #a1a1aa;
}

.notif-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.notif-item__time {
    font-size: 11px;
    color: #71717a;
}

html[data-theme="dark"] .notif-item__time {
    color: #71717a;
}

.notif-item__action {
    font-size: 11px;
    font-weight: 500;
    color: #60a5fa;
    text-decoration: none;
}

.notif-item__action:hover {
    text-decoration: underline;
}

html[data-theme="dark"] .notif-item__action {
    color: #60a5fa;
}

.notif-item__mark-read {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: #60a5fa;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}

.notif-item__mark-read:hover {
    text-decoration: underline;
}

html[data-theme="dark"] .notif-item__mark-read {
    color: #60a5fa;
}

.notif-item--dev-preview {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px dashed #27272a;
}

html[data-theme="dark"] .notif-item--dev-preview {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: #27272a;
}

.notif-item__dev-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #94a3b8;
    background: #27272a;
    border-radius: 3px;
    padding: 1px 4px;
    line-height: 1.3;
}

html[data-theme="dark"] .notif-item__dev-badge {
    color: #94a3b8;
    background: #27272a;
}

.notif-popup__load-more-wrap {
    padding: 6px 12px 10px;
    display: flex;
    justify-content: center;
}

.notif-popup__load-more {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: #a1a1aa;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
}

.notif-popup__load-more:hover {
    color: #f4f4f5;
    text-decoration: underline;
}

html[data-theme="dark"] .notif-popup__load-more:hover {
    color: #f4f4f5;
}

@media (max-width: 480px) {
    .notif-popup {
        width: min(300px, calc(100vw - 24px));
        right: -4px;
    }
}
