/* ═══════════════════════════════════════════════════════════════
   Notification Bell
═══════════════════════════════════════════════════════════════ */

.notif-wrapper {
    position: relative;
}

/* Bell button */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.notif-bell:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}

.notif-bell--has-unread {
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    animation: bell-pulse 2.5s infinite;
}

@keyframes bell-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(99, 102, 241, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(99, 102, 241, 0);   }
}

/* Ring animation when new notification arrives */
.notif-bell--ring svg {
    animation: bell-ring 0.5s ease;
}

@keyframes bell-ring {
    0%   { transform: rotate(0deg); }
    20%  { transform: rotate(-20deg); }
    40%  { transform: rotate(20deg); }
    60%  { transform: rotate(-15deg); }
    80%  { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

/* Badge */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    border: 2px solid #0f1117;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ─── Dropdown ──────────────────────────────────────────────── */

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background: #161b2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.12);
    z-index: 1000;
    animation: notif-in 0.18s ease-out;
    overflow: hidden;
}

.notif-dropdown.show {
    display: block;
}

@keyframes notif-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Header bar */
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.notif-dropdown-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
}

.notif-header-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.notif-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.notif-action-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

.notif-action-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Scrollable list */
.notif-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.4rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

/* Empty state */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
}

.notif-empty span { font-size: 1.8rem; }

/* Notification item */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: default;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
    position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item--clickable {
    cursor: pointer;
}

.notif-item--clickable:hover {
    background: rgba(99, 102, 241, 0.05);
}

.notif-item--unread {
    background: rgba(99, 102, 241, 0.07);
}

.notif-item--unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 0 2px 2px 0;
}

.notif-item-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-body-text {
    font-size: 0.77rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.27);
    margin-top: 0.3rem;
    display: block;
}

/* Mark-as-read button (inline) */
.notif-read-btn {
    flex-shrink: 0;
    align-self: center;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 6px;
    color: #818cf8;
    font-size: 0.72rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.notif-item:hover .notif-read-btn {
    opacity: 1;
}

.notif-read-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}
