/* =============================================
   NOTIFICATION SYSTEM — features.win
   ============================================= */

/* --- Bell Button (sidebar + welcome) --- */
.notif-bell {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    -webkit-tap-highlight-color: transparent;
}
.notif-bell:hover {
    background: rgba(164,157,198,0.12);
    color: #a49dc6;
    border-color: rgba(164,157,198,0.25);
}
.notif-bell.active {
    background: rgba(164,157,198,0.15);
    color: #a49dc6;
    border-color: rgba(164,157,198,0.3);
}

/* Badge */
.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(231,76,60,0.4);
    animation: notifBadgePop 0.3s ease-out;
    pointer-events: none;
}
.notif-badge:empty,
.notif-badge[data-count="0"] { display: none; }
@keyframes notifBadgePop {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Bell shake animation */
.notif-bell.shake i {
    animation: notifShake 0.6s ease-in-out;
}
@keyframes notifShake {
    0%   { transform: rotate(0); }
    15%  { transform: rotate(14deg); }
    30%  { transform: rotate(-14deg); }
    45%  { transform: rotate(10deg); }
    60%  { transform: rotate(-8deg); }
    75%  { transform: rotate(4deg); }
    100% { transform: rotate(0); }
}

/* --- Dropdown Panel --- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: rgba(18,20,28,0.97);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
    backdrop-filter: blur(16px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: notifDropIn 0.2s ease-out;
}
.notif-dropdown.open { display: flex; }

@keyframes notifDropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dropdown Header */
.notif-drop-header {
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.notif-drop-title {
    font-size: 0.9rem; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: 8px;
}
.notif-drop-title i { color: #a49dc6; font-size: 0.85rem; }
.notif-drop-count {
    background: rgba(231,76,60,0.15); color: #e74c3c;
    font-size: 0.68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
}
.notif-drop-count[data-count="0"] { display: none; }
.notif-mark-all {
    background: none; border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem; font-weight: 600;
    cursor: pointer; transition: color 0.2s;
    padding: 4px 8px; border-radius: 6px;
}
.notif-mark-all:hover { color: #a49dc6; background: rgba(164,157,198,0.1); }

/* Dropdown Body */
.notif-drop-body {
    overflow-y: auto;
    max-height: 360px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(164,157,198,0.2) transparent;
}
.notif-drop-body::-webkit-scrollbar { width: 4px; }
.notif-drop-body::-webkit-scrollbar-track { background: transparent; }
.notif-drop-body::-webkit-scrollbar-thumb { background: rgba(164,157,198,0.2); border-radius: 4px; }

/* Notification Item */
.notif-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    text-decoration: none;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(164,157,198,0.06); }
.notif-item.unread { background: rgba(164,157,198,0.04); }
.notif-item.unread::before {
    content: '';
    position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 50%;
    background: #a49dc6;
}

.notif-item-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0;
}

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 0.82rem; font-weight: 600; color: #fff;
    margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: 0.76rem; color: rgba(255,255,255,0.45);
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time {
    font-size: 0.65rem; color: rgba(255,255,255,0.3);
    margin-top: 3px;
    white-space: nowrap;
}

/* Empty State */
.notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
}
.notif-empty i {
    font-size: 2rem; display: block;
    margin-bottom: 10px; opacity: 0.3;
}

/* --- Toast Popup (top right) --- */
.notif-toast {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 99999;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: rgba(18,20,28,0.96);
    border: 1px solid rgba(164,157,198,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex; align-items: flex-start; gap: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    backdrop-filter: blur(16px);
    cursor: pointer;
    animation: notifToastIn 0.4s ease-out;
    transition: all 0.3s;
}
.notif-toast:hover {
    border-color: rgba(164,157,198,0.35);
    transform: translateX(-2px);
}
.notif-toast.hiding {
    animation: notifToastOut 0.3s ease-in forwards;
}
@keyframes notifToastIn {
    from { opacity: 0; transform: translateX(80px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes notifToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(80px); }
}

.notif-toast-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; flex-shrink: 0;
}
.notif-toast-body { flex: 1; min-width: 0; }
.notif-toast-title {
    font-size: 0.85rem; font-weight: 700; color: #fff;
    margin-bottom: 2px;
}
.notif-toast-msg {
    font-size: 0.78rem; color: rgba(255,255,255,0.5);
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-toast-close {
    background: none; border: none;
    color: rgba(255,255,255,0.3); font-size: 0.8rem;
    cursor: pointer; padding: 2px 4px; flex-shrink: 0;
    transition: color 0.2s;
}
.notif-toast-close:hover { color: #fff; }

/* Progress bar on toast */
.notif-toast-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(164,157,198,0.15);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}
.notif-toast-progress-bar {
    height: 100%;
    background: #a49dc6;
    border-radius: 0 0 12px 12px;
    animation: notifProgressShrink 5s linear forwards;
}
@keyframes notifProgressShrink {
    from { width: 100%; }
    to   { width: 0%; }
}

/* --- Sidebar Bell --- */
.sidebar .notif-bell-sidebar {
    position: relative;
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.85rem;
    transition: all 0.25s;
    flex-shrink: 0;
}
.sidebar .notif-bell-sidebar:hover {
    background: rgba(164,157,198,0.12);
    color: #a49dc6;
}
.sidebar .notif-bell-sidebar .notif-badge {
    top: -3px; right: -3px;
    min-width: 16px; height: 16px;
    font-size: 0.58rem;
}

/* Sidebar dropdown positioning */
.sidebar .notif-dropdown {
    position: fixed;
    top: auto; right: auto;
    left: var(--sb-width, 220px);
    margin-top: -20px;
}
.sidebar.collapsed .notif-dropdown {
    left: var(--sb-collapsed, 70px);
}

/* --- Welcome banner bell --- */
.au-welcome .notif-bell-wrap {
    position: relative;
    z-index: 10;
}



/* --- Responsive --- */
@media (max-width: 768px) {
    .notif-dropdown {
        position: fixed !important;
        top: 0 !important; left: 0 !important; right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0;
        animation: notifMobileIn 0.25s ease-out;
    }
    @keyframes notifMobileIn {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .notif-drop-body { max-height: calc(100vh - 60px); }
    .notif-drop-header {
        padding: 16px 18px;
        position: sticky; top: 0;
        background: rgba(18,20,28,0.98);
        z-index: 1;
    }
    .notif-toast { width: calc(100vw - 24px); right: 12px; top: 12px; }

    .sidebar .notif-dropdown {
        left: 0 !important;
        margin-top: 0;
    }
}
