/* ===== CHUÔNG THÔNG BÁO ===== */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-bell-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    position: relative;
    text-decoration: none;
}
.notif-bell-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: scale(1.08);
    color: #fff;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #1e3a8a;
    animation: badgePop 0.3s cubic-bezier(.36,.07,.19,.97);
    line-height: 1;
}
@keyframes badgePop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* Bell rung khi có thông báo mới */
.notif-bell-btn.has-new {
    animation: bellRing 0.6s ease 0s 3;
}
@keyframes bellRing {
    0%,100% { transform: rotate(0); }
    20%     { transform: rotate(-15deg); }
    40%     { transform: rotate(15deg); }
    60%     { transform: rotate(-10deg); }
    80%     { transform: rotate(10deg); }
}

/* ===== DROPDOWN THÔNG BÁO ===== */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    z-index: 9999;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    animation: dropdownIn 0.2s ease;
}
@media (max-width: 576px) {
    .notif-dropdown {
        position: fixed;
        top: 65px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.notif-dropdown.open {
    display: block;
}

.notif-dropdown-header {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: #fff;
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notif-dropdown-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.notif-mark-read-btn {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.notif-mark-read-btn:hover {
    background: rgba(255,255,255,0.35);
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    transition: background 0.15s;
    cursor: default;
}
.notif-item:hover { background: #f8fafc; }
.notif-item:last-child { border-bottom: none; }

.notif-item.unread {
    background: #eff6ff;
}
.notif-item.unread:hover { background: #dbeafe; }

.notif-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
    margin-top: 5px;
}
.notif-item.read .notif-dot {
    background: #cbd5e1;
}

.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-sender {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 2px;
}
.notif-sender strong { color: #1e40af; }
.notif-text {
    font-size: 0.85rem;
    color: #1e293b;
    word-break: break-word;
    line-height: 1.45;
}
.notif-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 3px;
}

.notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #94a3b8;
    font-size: 0.88rem;
}
.notif-empty .notif-empty-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }

.notif-dropdown-footer {
    padding: 0.6rem 1rem;
    background: #f8fafc;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

/* ===== CHAT MODAL ===== */
.chat-modal-content {
    border-radius: 1rem;
    border: none;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.chat-modal-header {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: white;
    border-bottom: none;
}
.chat-modal-body {
    background: #f1f5f9;
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}
.chat-bubble.me {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 0.3rem;
}
.chat-bubble.them {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 0.3rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.chat-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}
.chat-modal-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

/* ===== FACEBOOK OFF CANVAS MENU ===== */
.avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.avatar-btn:hover {
    border-color: #fff;
    transform: scale(1.05);
}
.fb-offcanvas {
    width: 340px !important;
    background-color: #f0f2f5; 
}
.fb-menu-profile {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 15px;
    margin: 10px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background 0.2s;
}
.fb-menu-profile:hover {
    background-color: #f7f8fa;
}
.fb-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #050505;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    transition: background 0.2s;
    margin: 0 15px 5px 15px;
}
.fb-menu-item:hover {
    background-color: #e4e6e9;
    color: #050505;
}
.fb-menu-icon {
    width: 36px;
    height: 36px;
    background-color: #e4e6e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1.1rem;
    color: #050505;
}
.fb-menu-item:hover .fb-menu-icon {
    background-color: #d8dadf;
}

/* ===== BOTTOM NAVIGATION BAR ===== */
.bottom-nav {
    display: none;
    height: 60px;
    background-color: #ffffff;
    border-top: 1px solid #ddd;
    z-index: 1030;
}
.bottom-nav-item {
    color: #65676b;
    flex-grow: 1;
    padding: 8px 0;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    margin: 0 4px;
    transition: background 0.2s;
}
.bottom-nav-item.active {
    color: #1877f2;
}
.bottom-nav-item:active {
    background-color: #f0f2f5;
}

@media (max-width: 767.98px) {
    .bottom-nav {
        display: flex !important;
    }
    body {
        padding-bottom: 60px !important;
    }
    .app-foot {
        padding-bottom: 70px !important; /* Đẩy footer lên trên thanh nav */
    }
}
