/* wwwroot/css/notifications.css */

/* Notification Panel: Base styles */
#notificationPanel {
    position: fixed;
    top: 64px;
    right: 16px;
    width: 380px;
    max-height: 520px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    display: none; /* Hidden by default */
}

#notificationPanel:not([hidden]) {
    display: block;
}

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

.notif-header .notif-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* Action Buttons in Header */
.notif-actions {
    display: flex;
    gap: 8px;
}

#notifMarkAll {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

#notifMarkAll:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #a1a1aa;
}

#notifMarkAll:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.notif-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.notif-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Notification List */
#notificationList {
    padding: 8px 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

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

.notification-item:hover {
    background-color: #f9fafb;
}

/* Read State */
.notification-item.is-read {
    background-color: #f9fafb;
    color: #6b7280;
}

.notification-item.is-read .notif-title,
.notification-item.is-read .notif-titlelink {
    color: #6b7280;
}

/* Notification Type Indicators (colored border) */
.notification-item {
    border-left: 4px solid transparent; /* Default transparent */
}
.notification-item.info {
    border-left-color: #3b82f6;
}
.notification-item.success {
    border-left-color: #16a34a;
}
.notification-item.warning {
    border-left-color: #f59e0b;
}
.notification-item.error {
    border-left-color: #ef4444;
}

/* Text Content */
.notif-text {
    flex: 1;
    min-width: 0;
}

.notif-title,
.notif-titlelink {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
    text-decoration: none;
}

.notif-titlelink:hover {
    text-decoration: underline;
}

.notif-sub {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 2px;
}

.notif-meta {
    margin-bottom: 4px;
}

.notif-time {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Per-Item "Mark Read" Button */
.notif-item-close {
    flex-shrink: 0;
    align-self: center;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px; /* Pill shape */
    background: #fff;
    color: #3b82f6;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.notif-item-close:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #3b82f6;
}

.notif-item-close:disabled {
    color: #9ca3af;
    background: transparent;
    border-color: #e5e7eb;
    cursor: default;
}

/* Badge on Toggle Button */
#notificationToggle {
    position: relative;
}

#notificationToggle .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff; /* Match header background */
}

.hidden {
    display: none !important;
}