/* ── Notification Bell Wrapper ── */
#notif-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ── Bell Button ── */
#notif-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    color: #444;
    padding: 0;
}

#notif-btn:hover {
    background: rgba(106, 73, 242, 0.1);
    color: #6a49f2;
}

#notif-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* ── Badge ── */
#notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #e53e3e;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    font-family: 'Kanit', sans-serif;
    border: 2px solid #fff;
    pointer-events: none;
}

/* ── Dropdown Panel ── */
#notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    overflow: hidden;
    border: 1px solid #ece8fd;
    animation: notifFadeIn 0.18s ease;
}

#notif-dropdown.open {
    display: block;
}

@keyframes notifFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Dropdown Header ── */
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px 11px;
    border-bottom: 1px solid #f0eeff;
    background: #faf8ff;
}

.notif-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    font-family: 'Kanit', sans-serif;
}

.notif-read-all {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: #6a49f2;
    font-family: 'Kanit', sans-serif;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.notif-read-all:hover {
    background: #ece8fd;
}

/* ── Notification List ── */
#notif-list {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d8d0f8 transparent;
}

#notif-list::-webkit-scrollbar { width: 4px; }
#notif-list::-webkit-scrollbar-track { background: transparent; }
#notif-list::-webkit-scrollbar-thumb { background: #d8d0f8; border-radius: 4px; }

/* ── Notification Item ── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f7f5ff;
}

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

.notif-item:hover {
    background: #f4f0ff;
}

.notif-item.unread {
    background: #faf7ff;
}

/* ── Dot indicator ── */
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    margin-top: 4px;
    transition: background 0.2s;
}

.notif-dot.active {
    background: #6a49f2;
}

/* ── Item Body ── */
.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Kanit', sans-serif;
}

.notif-msg {
    font-size: 12px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.notif-time {
    font-size: 10px;
    color: #b0a8d0;
    margin-top: 4px;
}

/* ── Empty State ── */
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: #b0a8d0;
    font-size: 13px;
    font-family: 'Kanit', sans-serif;
}

.notif-empty::before {
    content: '🔔';
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* ── Push Permission Banner ── */
#notif-permission-bar {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 999999;
    font-size: 13px;
    font-family: 'Kanit', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 90vw;
}

#notif-permission-bar button {
    background: #6a49f2;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 12px;
    white-space: nowrap;
}

#notif-permission-bar .notif-perm-dismiss {
    background: transparent;
    color: #aaa;
    padding: 4px 8px;
    font-size: 18px;
    line-height: 1;
}
