/* Notification Badge */
.notif-badge {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    padding: 0 4px;
    pointer-events: none;
}

.notif-badge.visible {
    display: block;
}

/* Notification Panel */
.notif-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 420px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 2500;
    margin-top: 8px;
    overflow: hidden;
}

.notif-panel.open {
    display: block;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.notif-panel-header strong {
    font-size: 0.92rem;
    color: #333;
}

.notif-mark-all {
    border: none;
    background: none;
    color: var(--brand-primary, #4CAF50);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 0;
    font-weight: 500;
}

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

.notif-panel-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: default;
    transition: background 0.15s;
}

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

.notif-item.unread {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 5%, white);
    cursor: pointer;
}

.notif-item.unread:hover {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 10%, white);
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    margin-top: 5px;
}

.notif-item.unread .notif-item-dot {
    background: var(--brand-primary, #4CAF50);
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.notif-item-body {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-item-time {
    font-size: 0.72rem;
    color: #aaa;
}

.notif-empty,
.notif-loading {
    padding: 30px 16px;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

/* Panel Footer */
.notif-panel-footer {
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: center;
}

.notif-view-all {
    color: var(--brand-primary, #4CAF50);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.notif-view-all:hover {
    text-decoration: underline;
}

/* Dark Mode */
body.dark-mode .notif-panel {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .notif-panel-header {
    border-bottom-color: #333;
}

body.dark-mode .notif-panel-header strong {
    color: #f0f0f0;
}

body.dark-mode .notif-item {
    border-bottom-color: #2d2d2d;
}

body.dark-mode .notif-item.unread {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 8%, #1e1e1e);
}

body.dark-mode .notif-item.unread:hover {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 14%, #1e1e1e);
}

body.dark-mode .notif-item-title { color: #f0f0f0; }
body.dark-mode .notif-item-body { color: #aaa; }
body.dark-mode .notif-item-time { color: #777; }
body.dark-mode .notif-empty,
body.dark-mode .notif-loading { color: #777; }
body.dark-mode .notif-panel-footer { border-top-color: #333; }

/* Forest Theme */
body.theme-forest .notif-panel { background: #1a2418; border-color: #3d5235; }
body.theme-forest .notif-panel-header { border-bottom-color: #3d5235; }
body.theme-forest .notif-panel-footer { border-top-color: #3d5235; }
body.theme-forest .notif-panel-header strong { color: #b8d4a8; }
body.theme-forest .notif-item { border-bottom-color: #2a3a22; }
body.theme-forest .notif-item.unread { background: rgba(90, 158, 75, 0.08); }
body.theme-forest .notif-item-title { color: #b8d4a8; }
body.theme-forest .notif-item-body { color: #8aaa78; }
body.theme-forest .notif-item-time { color: #5a7a4a; }

/* Ocean Theme */
body.theme-ocean .notif-panel { background: #141e2e; border-color: #2e4460; }
body.theme-ocean .notif-panel-header { border-bottom-color: #2e4460; }
body.theme-ocean .notif-panel-footer { border-top-color: #2e4460; }
body.theme-ocean .notif-panel-header strong { color: #a0c4e8; }
body.theme-ocean .notif-item { border-bottom-color: #1c2a3e; }
body.theme-ocean .notif-item.unread { background: rgba(59, 130, 196, 0.08); }
body.theme-ocean .notif-item-title { color: #a0c4e8; }
body.theme-ocean .notif-item-body { color: #7a9ab8; }
body.theme-ocean .notif-item-time { color: #4a6a88; }

/* Slate Theme */
body.theme-slate .notif-panel { background: #f5f0e8; border-color: #c8bfb0; }
body.theme-slate .notif-panel-header { border-bottom-color: #c8bfb0; }
body.theme-slate .notif-panel-footer { border-top-color: #c8bfb0; }
body.theme-slate .notif-panel-header strong { color: #504840; }
body.theme-slate .notif-item { border-bottom-color: #ddd6ca; }
body.theme-slate .notif-item.unread { background: rgba(139, 125, 107, 0.06); }
body.theme-slate .notif-item-title { color: #504840; }
body.theme-slate .notif-item-body { color: #8b7d6b; }
body.theme-slate .notif-item-time { color: #a09888; }

/* Sunset Theme */
body.theme-sunset .notif-panel { background: #fff5f0; border-color: #e0bfb0; }
body.theme-sunset .notif-panel-header { border-bottom-color: #e0bfb0; }
body.theme-sunset .notif-panel-footer { border-top-color: #e0bfb0; }
body.theme-sunset .notif-panel-header strong { color: #6b3f35; }
body.theme-sunset .notif-item { border-bottom-color: #f0ddd4; }
body.theme-sunset .notif-item.unread { background: rgba(212, 130, 106, 0.06); }
body.theme-sunset .notif-item-title { color: #6b3f35; }
body.theme-sunset .notif-item-body { color: #a06858; }
body.theme-sunset .notif-item-time { color: #c09888; }

/* Responsive */
@media (max-width: 480px) {
    .notif-panel {
        width: 300px;
        right: -40px;
    }
}
