/* ============================================================
   Notifications & User Menu — KajaCorée
   Placés dans #sns_navbar (barre au-dessus du menu)
   ============================================================ */

/* ----------------------------------------------------------
   Avatar + pseudo dans la top bar
   ---------------------------------------------------------- */
.notif-user-menu,
.notif-bell-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 20px;
}

.notif-bell-container {
    margin-left: 24px;
}

.notif-avatar-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    padding: 2px 0;
}

.notif-avatar-trigger:hover {
    text-decoration: none;
    color: #494ca2;
}

.notif-avatar-img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    transition: border-color 0.2s;
    vertical-align: middle;
}

.notif-avatar-trigger:hover .notif-avatar-img {
    border-color: #494ca2;
}

.notif-avatar-name {
    font-size: 12px;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-avatar-caret {
    font-size: 10px;
    color: #999;
}

/* ----------------------------------------------------------
   Bell icon
   ---------------------------------------------------------- */
.notif-bell-trigger {
    position: relative;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    padding: 2px 0;
    vertical-align: middle;
}

.notif-bell-trigger:hover {
    color: #494ca2;
    text-decoration: none;
}

.notif-bell-trigger .fa-bell {
    font-size: 16px;
    vertical-align: middle;
}

/* Badge (pastille) */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    border-radius: 50%;
    padding: 0 3px;
}

/* ----------------------------------------------------------
   Dropdowns (avatar & bell panel)
   ---------------------------------------------------------- */
.notif-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    margin-top: 6px;
}

.notif-dropdown.active {
    display: block;
}

.notif-dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.4;
    text-align: left;
}

.notif-dropdown-separator {
    border-top: 1px solid #f0f0f0;
    margin: 0;
}

.notif-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.notif-dropdown-menu li {
    line-height: 1.4;
}

.notif-dropdown-menu li a {
    display: block;
    padding: 8px 16px;
    color: #444;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    text-align: left;
    transition: background 0.15s;
}

.notif-dropdown-menu li a:hover {
    background: #f5f5ff;
    color: #494ca2;
}

.notif-dropdown-menu li a i {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #888;
    font-size: 14px;
}

.notif-dropdown-menu li a:hover i {
    color: #494ca2;
}

/* ----------------------------------------------------------
   Bell Panel (notification list)
   ---------------------------------------------------------- */
.notif-bell-panel {
    width: 360px;
    max-height: 480px;
    overflow: hidden;
}

.notif-bell-panel.active {
    display: flex;
    flex-direction: column;
}

.notif-mark-all-read {
    font-size: 12px;
    font-weight: 400;
    color: #494ca2;
    text-decoration: none;
}

.notif-mark-all-read:hover {
    text-decoration: underline;
}

.notif-list {
    overflow-y: auto;
    flex: 1;
    max-height: 380px;
}

.notif-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
    line-height: 1.4;
}

.notif-item:hover {
    background: #f9f9ff;
    text-decoration: none;
    color: inherit;
}

.notif-item.notif-unread {
    background: #f0f0ff;
}

.notif-item.notif-unread:hover {
    background: #e8e8ff;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #494ca2;
    flex-shrink: 0;
    margin-top: 6px;
    margin-right: 10px;
}

.notif-item:not(.notif-unread) .notif-item-dot {
    background: transparent;
}

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

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-message {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

.notif-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.notif-empty {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 13px;
}

.notif-load-more {
    text-align: center;
    padding: 10px;
    border-top: 1px solid #f0f0f0;
}

.notif-load-more a {
    color: #494ca2;
    font-size: 13px;
    text-decoration: none;
}

.notif-load-more a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   Banners (haut de page)
   ---------------------------------------------------------- */
#notif-banners-container {
    position: relative;
    z-index: 100;
}

.notif-banner {
    background: #494ca2;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    animation: notifSlideDown 0.3s ease;
}

.notif-banner-content {
    flex: 1;
    text-align: center;
    line-height: 1.5;
}

.notif-banner-message {
    opacity: 0.9;
}

.notif-banner-link {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
}

.notif-banner-link:hover {
    color: #fff;
}

.notif-banner-spacer,
.notif-banner-close {
    flex-shrink: 0;
    width: 30px;
}

.notif-banner-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 4px;
    line-height: 1;
    text-align: right;
}

.notif-banner-close:hover {
    opacity: 1;
}

/* ----------------------------------------------------------
   Toasts (coin bas droite)
   ---------------------------------------------------------- */
#notif-toasts-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 360px;
}

.notif-toast {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #494ca2;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 14px 40px 14px 16px;
    position: relative;
    animation: notifSlideIn 0.3s ease;
    cursor: pointer;
    max-width: 360px;
}

.notif-toast-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.notif-toast-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.notif-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

.notif-toast-close:hover {
    color: #333;
}

.notif-toast.notif-toast-hiding {
    animation: notifSlideOut 0.3s ease forwards;
}

/* ----------------------------------------------------------
   Animations
   ---------------------------------------------------------- */
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes notifSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@keyframes notifSlideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------
   Mobile badge (dans le menu hamburger)
   ---------------------------------------------------------- */
.notif-badge-xs {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    padding: 0 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ----------------------------------------------------------
   Mobile notification panel (fullscreen overlay)
   ---------------------------------------------------------- */
.notif-mobile-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: #fff;
    flex-direction: column;
}

.notif-mobile-panel.active {
    display: flex;
}

.notif-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #eee;
}

.notif-mobile-header a {
    font-size: 28px;
    color: #999;
    text-decoration: none;
    line-height: 1;
}

.notif-mobile-actions {
    padding: 8px 20px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

.notif-mobile-actions a {
    font-size: 13px;
    color: #494ca2;
    text-decoration: none;
}

.notif-mobile-panel .notif-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.notif-mobile-panel .notif-load-more {
    border-top: 1px solid #f0f0f0;
    padding: 14px;
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 991px) {
    .notif-user-menu,
    .notif-bell-container {
        display: none;
    }
}

@media (max-width: 767px) {
    #notif-toasts-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notif-toast {
        max-width: none;
    }
}
