/**
 * User Notification – badge, dropdown, overlay, list items.
 * Used by script/user-notification.js.
 */

/* Notification Badge – on top of header-menu-btn (top-right corner). Fade in/out via .notification-badge--visible. */
.notification-badge {
    position: absolute;
    top: 0;
    left: -10px;
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.notification-badge.notification-badge--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Notification badge inside notifications-menu-item: inline next to text. Hidden when 0 unread. */
.notification-badge-menu-item {
    position: static;
    top: auto;
    right: auto;
    margin-left: 0.5rem;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 1;
    visibility: visible;
}

/* Notification Overlay – above top-header, top-nav, bottom-nav */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
    pointer-events: none;
}

.notification-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Notification Dropdown Box – appended to body so z-index is above notification-overlay */
.notification-dropdown {
    position: fixed;
    top: auto;
    right: 0;
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
    width: 700px;
    max-width: calc(100vw - 2rem);
    max-height: 500px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 1101;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    will-change: opacity, transform;
}

#notification-dropdown-content{
    background: #e8e8e8 !important;
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown-header {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-dropdown-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: #333;
    margin: 0;
}

.notification-dropdown-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease;
}

.notification-dropdown-close:hover {
    color: #333;
}

.notification-dropdown-close .close-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}

/* Read notifications: gray background */
.notification-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: #e8e8e8;
}

.notification-item:hover {
    background-color: var(--bg-hover);
}

/* Unread notifications: white background for easier spotting */
.notification-item-unread {
    background-color: #fff;
}

.notification-item-unread:hover {
    background-color: #f5f5f5;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-message {
    font-size: var(--font-size-base);
    color: #333;
    line-height: 1.5;
}

.notification-date {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}