/* assets/css/notifications.css */

.notif-wrapper {
    position: relative;
    /* Key anchor point */
    display: inline-flex;
    align-items: center;
    margin-left: 0;
    margin-right: 25px;
    z-index: 1001;
}

.notif-toggle-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #e4e6eb;
    border-radius: 50%;
    color: #050505;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.notif-toggle-btn:hover {
    background-color: #d8dadf;
    color: #050505;
}

.notif-toggle-btn:active {
    background-color: #cdd0d5;
    transform: scale(0.96);
}

.notif-toggle-btn .material-symbols-outlined {
    font-size: 24px;
    user-select: none;
}

#notif-badge {
    display: none;
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #e41e3f;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    padding: 0 4px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.notif-dropdown-menu {
    display: none;
    position: absolute;
    /* Position directly below the bell */
    top: 120%;
    /* Align to the right edge of the bell container */
    left: -120px;
    width: 360px;
    max-width: 90vw;
    background-color: #ffffff;
    border-radius: 8px;
    z-index: 999999;
    box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

.notif-dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.notif-header {
    padding: 16px;
    font-size: 20px;
    font-weight: 700;
    color: #050505;
    border-bottom: 1px solid #eee;
}

.notif-list {
    max-height: 450px;
    overflow-y: auto;
    padding: 8px;
}

.notif-list::-webkit-scrollbar {
    width: 8px;
}

.notif-list::-webkit-scrollbar-thumb {
    background: #bcc0c4;
    border-radius: 4px;
}

.notif-list::-webkit-scrollbar-track {
    background: transparent;
}

.notif-item {
    display: block;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    background-color: #fff;
}

.notif-item:hover {
    background-color: #f2f2f2;
}

.notif-item.unread {
    background-color: #e7f3ff;
}

.notif-item.unread::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #1877f2;
    border-radius: 50%;
}

.notif-title {
    font-size: 15px;
    font-weight: 600;
    color: #050505;
    margin-bottom: 2px;
}

.notif-message {
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

.notif-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 12px;
    color: #65676b;
}

.notif-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid #eee;
}

.notif-footer a {
    color: #1877f2;
    font-weight: 600;
    text-decoration: none;
}

.notif-footer a:hover {
    text-decoration: underline;
}

.mark-read-text {
    background: none;
    border: none;
    color: #1877f2;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.mark-read-text:hover {
    text-decoration: underline;
}

.no-notifs {
    padding: 40px;
    text-align: center;
    color: #65676b;
    font-weight: 600;
}

/* Responsive Design Media Queries */

@media screen and (max-width: 768px) {
    .notif-dropdown-menu {
        right: -50px;
        /* Shift slightly left on tablets if needed */
    }
}

@media screen and (max-width: 425px) {
    .notif-dropdown-menu {
        position: fixed;
        /* Fix to screen on mobile */
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 94%;
        margin-right: 0;
    }
}