/**
 * Notifications section styling.
 *
 * Covers two contexts:
 *   1) Notification dropdown in the navbar (compact items, hover preview)
 *   2) Notification center page `/notifications/` (full list with actions)
 *
 * All colors are brand-aware via --do-* and --brand-* CSS variables defined
 * in mifid/_tenant_brand.html. NO hardcoded brand-conflicting hues (e.g. the
 * previous unread highlight used #fff3cd which collided with Omney yellow).
 */

/* ========================================
   NOTIFICATION CENTER PAGE — HEADER
======================================== */

.notif-header {
    margin-bottom: 1.5rem;
}

.notif-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--do-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.notif-header h1 i {
    color: var(--brand-on-light);
}

.notif-header p {
    color: var(--do-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* ========================================
   STATS / COUNTER BADGES
======================================== */

.notif-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.notif-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--do-progress-track-bg);
    color: var(--do-text);
    border: 1px solid var(--border-primary, #e5e7eb);
}

.notif-stat.notif-stat-unread {
    background: rgba(var(--brand-primary-rgb), 0.08);
    color: var(--brand-on-light);
    border-color: rgba(var(--brand-primary-rgb), 0.25);
}

.notif-stat i {
    font-size: 0.9rem;
}

/* ========================================
   TOOLBAR (search + filters + bulk action)
======================================== */

.notif-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary, #e5e7eb);
    background: var(--do-card-bg);
}

.notif-search {
    flex: 1 1 260px;
    min-width: 200px;
    position: relative;
}

.notif-search input {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.3rem;
    border-radius: 8px;
    border: 1px solid var(--border-primary, #e5e7eb);
    background: var(--do-card-bg);
    color: var(--do-text);
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notif-search input::placeholder {
    color: var(--do-text-muted);
}

.notif-search input:focus {
    outline: none;
    border-color: var(--contract-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.12);
}

.notif-search i.bi-search {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--do-text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

/* Filter chips */
.notif-filters {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.notif-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-primary, #e5e7eb);
    background: var(--do-card-bg);
    color: var(--do-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.notif-filter-btn:hover {
    background: var(--do-progress-track-bg);
    border-color: var(--do-text-muted);
}

.notif-filter-btn.active {
    background: var(--do-text);
    border-color: var(--do-text);
    color: var(--do-card-bg);
}

.notif-filter-btn.active:hover {
    background: var(--do-text);
}

/* Mark-all-read trigger */
.notif-mark-all-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: transparent;
    color: var(--do-text);
    border: 1px solid var(--border-primary, #e5e7eb);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notif-mark-all-btn:hover {
    background: var(--do-progress-track-bg);
}

.notif-mark-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   NOTIFICATION LIST (page)
======================================== */

.notif-list {
    display: flex;
    flex-direction: column;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary, #e5e7eb);
    background: var(--do-card-bg);
    transition: background 0.15s ease;
}

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

.notif-item:hover {
    background: var(--do-progress-track-bg);
}

/* Unread accent: subtle brand-tinted left border, NO yellow background.
   The brand-tinted bg is very light (8% opacity) so it stays readable on
   any brand including Omney yellow. */
.notif-item.is-unread {
    background: rgba(var(--brand-primary-rgb), 0.05);
    border-left: 3px solid var(--contract-primary-dark);
    padding-left: calc(1.25rem - 3px);
}

.notif-item.is-unread:hover {
    background: rgba(var(--brand-primary-rgb), 0.09);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    background: var(--do-progress-track-bg);
    color: var(--do-text-muted);
}

.notif-item.is-unread .notif-icon {
    background: rgba(var(--brand-primary-rgb), 0.12);
    color: var(--brand-on-light);
}

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

.notif-title {
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--do-text);
    margin: 0 0 0.2rem 0;
}

.notif-title strong {
    color: var(--do-text);
    font-weight: 600;
}

.notif-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--do-text-muted);
}

.notif-meta .notif-meta-sep {
    opacity: 0.5;
}

.notif-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.notif-action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--do-text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
}

.notif-action-btn:hover {
    background: var(--do-progress-track-bg);
    color: var(--do-text);
    border-color: var(--border-primary, #e5e7eb);
}

.notif-action-btn.notif-action-read:hover {
    color: #10b981;
    border-color: #10b981;
}

.notif-action-btn.notif-action-archive:hover {
    color: #dc2626;
    border-color: #fca5a5;
}

/* Empty state */
.notif-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--do-text-muted);
}

.notif-empty i {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.5;
}

.notif-empty h5 {
    font-size: 1.05rem;
    color: var(--do-text);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.notif-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   PAGINATION (riusa Bootstrap, brand-aware tweak)
======================================== */

.notif-pagination {
    display: flex;
    justify-content: center;
    padding: 1.25rem;
}

.notif-pagination .pagination {
    margin: 0;
    gap: 0.25rem;
}

.notif-pagination .page-link {
    color: var(--do-text);
    border-color: var(--border-primary, #e5e7eb);
    border-radius: 8px !important;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.notif-pagination .page-link:hover {
    background: var(--do-progress-track-bg);
    color: var(--do-text);
    border-color: var(--do-text-muted);
}

.notif-pagination .page-item.active .page-link {
    background: var(--do-text);
    border-color: var(--do-text);
    color: var(--do-card-bg);
}

/* ========================================
   NAVBAR DROPDOWN — notification items
   (apply on top of .app-dropdown shared)
======================================== */

.notif-dd-item {
    padding: 0.7rem 1rem !important;
    border-bottom: 1px solid var(--border-primary, #e5e7eb);
    align-items: flex-start !important;
}

.notif-dd-item:last-of-type {
    border-bottom: none;
}

.notif-dd-item.is-unread {
    background: rgba(var(--brand-primary-rgb), 0.05);
}

.notif-dd-item .notif-dd-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: var(--do-progress-track-bg);
    color: var(--do-text-muted);
    flex-shrink: 0;
}

.notif-dd-item.is-unread .notif-dd-icon {
    background: rgba(var(--brand-primary-rgb), 0.15);
    color: var(--brand-on-light);
}

.notif-dd-text {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.notif-dd-text strong {
    font-weight: 600;
    color: var(--do-text);
    font-size: 0.9rem;
}

.notif-dd-text .notif-dd-verb {
    display: block;
    font-size: 0.85rem;
    color: var(--do-text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-dd-text .notif-dd-time {
    display: block;
    font-size: 0.75rem;
    color: var(--do-text-muted);
    margin-top: 2px;
}

.notif-dd-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.notif-dd-actions .notif-action-btn {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
}

/* Empty state inside dropdown */
.notif-dd-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--do-text-muted);
}

.notif-dd-empty i {
    font-size: 2rem;
    opacity: 0.4;
    display: block;
    margin-bottom: 0.5rem;
}

.notif-dd-empty p {
    font-size: 0.85rem;
    margin: 0;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .notif-toolbar {
        padding: 0.85rem 1rem;
    }
    .notif-mark-all-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .notif-item {
        padding: 0.85rem 1rem;
        gap: 0.65rem;
    }
    .notif-item.is-unread {
        padding-left: calc(1rem - 3px);
    }
    .notif-actions {
        flex-direction: column;
    }
}
