/**
 * Notifications Center — CSS
 * BookConnect / LivreConnect
 */

/* ===== Layout ===== */
.notifications-page {
    padding-top: 60px;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.notifications-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ===== Header ===== */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.notifications-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.notifications-header h1 i {
    margin-right: 0.5rem;
    color: #6c63ff;
}

.btn-mark-all-read {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ===== Filter tabs ===== */
.notifications-filters {
    margin-bottom: 1.25rem;
}

.notifications-filters .nav-link {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    transition: color 0.2s, border-color 0.2s;
}

.notifications-filters .nav-link:hover {
    color: #495057;
    border-bottom-color: #dee2e6;
}

.notifications-filters .nav-link.active {
    color: #6c63ff;
    border-bottom-color: #6c63ff;
    background: transparent;
}

.filter-badge {
    font-size: 0.7rem;
    padding: 0.15em 0.5em;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* ===== Notification card ===== */
.notification-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.notification-card:hover {
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: inherit;
    text-decoration: none;
}

.notification-card.unread {
    border-left-color: #6c63ff;
    background: #fafaff;
}

.notification-card.unread .notification-title {
    font-weight: 600;
}

/* Icon */
.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
}

.notification-icon.type-message       { background: #0d6efd; }
.notification-icon.type-connection    { background: #198754; }
.notification-icon.type-publication   { background: #dc3545; }
.notification-icon.type-badge         { background: #ffc107; color: #333; }
.notification-icon.type-forum         { background: #0dcaf0; }
.notification-icon.type-plumes        { background: #6f42c1; }
.notification-icon.type-formation     { background: #fd7e14; }
.notification-icon.type-manuscript    { background: #20c997; }
.notification-icon.type-moderation    { background: #6c757d; }
.notification-icon.type-system        { background: #343a40; }
.notification-icon.type-event         { background: #e91e8e; }
.notification-icon.type-review        { background: #e6a800; }
.notification-icon.type-default       { background: #adb5bd; }

/* Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.925rem;
    font-weight: 400;
    color: #1a1a2e;
    margin-bottom: 0.15rem;
    line-height: 1.35;
}

.notification-body {
    font-size: 0.825rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #adb5bd;
}

.notification-actor {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.notification-actor img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* Actions */
.notification-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notification-actions .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.notification-card:hover .notification-actions .btn {
    opacity: 1;
}

/* Unread dot */
.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c63ff;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

/* ===== Empty state ===== */
.notifications-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #adb5bd;
}

.notifications-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.notifications-empty p {
    font-size: 1rem;
    margin: 0;
}

/* ===== Pagination ===== */
.notifications-pagination {
    margin-top: 1.5rem;
}

/* ===== Dropdown (navbar) ===== */
.notification-dropdown-menu {
    width: 360px;
    max-height: 440px;
    overflow-y: auto;
    padding: 0;
    border: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    z-index: 1050 !important;
}

/* Forcer le dropdown à ne pas hériter du position:static responsive */
#notification-dropdown-container {
    position: relative !important;
}

#notification-dropdown-container .dropdown-menu {
    position: absolute !important;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 0.95rem;
}

.notification-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.notification-dropdown-item:hover {
    background: #f8f9fa;
    color: inherit;
    text-decoration: none;
}

.notification-dropdown-item.unread {
    background: #fafaff;
}

.notification-dropdown-item .dd-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #fff;
}

.notification-dropdown-item .dd-content {
    flex: 1;
    min-width: 0;
}

.notification-dropdown-item .dd-title {
    font-size: 0.825rem;
    line-height: 1.3;
    margin-bottom: 0.1rem;
}

.notification-dropdown-item.unread .dd-title {
    font-weight: 600;
}

.notification-dropdown-item .dd-time {
    font-size: 0.7rem;
    color: #adb5bd;
}

.notification-dropdown-footer {
    text-align: center;
    padding: 0.625rem;
    border-top: 1px solid #eee;
}

.notification-dropdown-footer a {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c63ff;
    text-decoration: none;
}

.notification-dropdown-footer a:hover {
    text-decoration: underline;
}

.notification-dropdown-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* ===== Bell badge in navbar ===== */
.notification-bell {
    position: relative;
}

.notification-bell .badge-count {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    border: 2px solid var(--navbar-color, #363636);
}

.notification-bell .badge-count:empty,
.notification-bell .badge-count[data-count="0"] {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .notifications-container {
        padding: 1rem 0.5rem;
    }

    .notifications-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .notification-card {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .notification-dropdown-menu {
        width: 300px;
    }

    .notifications-filters .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}
