/* public/css/notifications.css */

/* Panel powiadomień jako elegancki szklany popover */
.notification-panel {
    position: absolute;
    top: 55px;
    right: 0.75rem;
    width: 290px;
    max-height: 380px;
    z-index: var(--z-toast);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 242, 254, 0.15);
    background-color: var(--secondary-bg);
    overflow: hidden;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.notification-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: 0.3px;
}

.clear-notifications-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    padding: 0.3rem 0.6rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.clear-notifications-btn:hover {
    background-color: rgba(167, 139, 250, 0.15);
    text-decoration: none;
}

#notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.45;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

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

.notification-item.type-success {
    color: var(--green-online);
}

.notification-item.type-warning {
    color: var(--warning-color);
}

.notification-item.no-notifications {
    text-align: center;
    font-style: italic;
    color: var(--secondary-text);
    padding: 1.5rem 1rem;
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-secondary);
    border: 2px solid var(--nav-rail-bg);
    box-shadow: 0 0 8px var(--accent-secondary);
}

#mobile-notification-badge {
    border-color: var(--primary-bg);
}

/* Dwusekundowy podgląd wiadomości odebranej z innego czatu. */
.background-message-preview {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: min(390px, calc(100vw - 2rem));
    padding: 0.85rem 1rem;
    color: var(--text-color);
    background: var(--secondary-bg);
    background: color-mix(in srgb, var(--secondary-bg) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-color) 45%, var(--border-color));
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 242, 254, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-14px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.background-message-preview.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.background-message-preview-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--accent-color);
    background: rgba(0, 242, 254, 0.12);
    border-radius: 12px;
}

.background-message-preview-body {
    min-width: 0;
}

.background-message-preview-title,
.background-message-preview-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.background-message-preview-title {
    margin-bottom: 0.2rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.background-message-preview-text {
    color: var(--secondary-text);
    font-size: 0.82rem;
}

@media (max-width: 767px) {
    .background-message-preview {
        top: max(0.75rem, env(safe-area-inset-top));
        right: 50%;
        width: calc(100vw - 1.5rem);
        transform: translate(50%, -14px) scale(0.98);
    }

    .background-message-preview.visible {
        transform: translate(50%, 0) scale(1);
    }
}
