/* Notifications (Ported from index4.css overrides) */

.notifications-wrapper {
    position: static;
    display: inline-flex;
    align-items: center;
}

.notifications-trigger {
    position: relative;
    /* mk4-header__iconBtn handles the look, we just need positioning for badge */
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444; /* accent-error fallback */
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
}

.badge.hidden { display: none; }

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 17px);
    left: 0;
    width: 100%;
    background: rgb(20 20 22);
    border: 1px solid rgb(20 20 22);
    box-shadow: 0 24px 80px rgb(0 0 0 / 34%);
    border-radius: 28px;
    padding: 10px;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 160ms ease, transform 160ms ease;
}

.notifications-dropdown.hidden {
    display: flex; /* Override display: none */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.mk4-header.is-bottom .notifications-dropdown {
    top: auto;
    bottom: calc(100% + 17px);
    transform: translateY(0);
}

.mk4-header.is-bottom .notifications-dropdown.hidden {
    transform: translateY(6px);
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.notifications-actions {
    display: flex;
    gap: 8px;
}

.notifications-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-text svg {
    stroke-width: 2;
}

#clear-notifications:hover {
    color: #ef4444; /* Red for delete action */
    background: rgba(239, 68, 68, 0.1);
}

.notifications-list::-webkit-scrollbar { width: 4px; }
.notifications-list::-webkit-scrollbar-track { background: transparent; }
.notifications-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }

.notification-item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 12px;
    margin-bottom: 2px;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateY(-1px);
    border-color: transparent;
}

.notification-item.unread {
    background: rgba(255, 106, 43, 0.1); /* accent-primary fallback */
    border-color: transparent;
}

.notification-item:last-child { border-bottom: none; margin-bottom: 0; }

.btn-text {
    background: none;
    border: none;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.btn-text:hover { text-decoration: underline; }

.loading-muted {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Elements generated by script.js (App Pages) */
.notification-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #333;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    
    /* For fallback initials */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.notification-text {
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text-secondary);
}

.notification-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.notification-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.notification-item:hover .notification-text {
    color: var(--text-primary);
}
