/* ==================== NOTIFICATION BELL ==================== */

#notif-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-actions-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.notif-bell {
    background: none;
    border: none;
    color: var(--text-secondary, #8a93a6);
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    min-height: 44px;
    min-width: 44px;
}

.updates-feed-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
    border-radius: 10px;
    border: none;
    background: none;
    color: var(--text-secondary, #8a93a6);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.updates-feed-btn:hover {
    color: var(--primary-color, #00b2f2);
    background: rgba(0, 178, 242, 0.08);
}

.updates-feed-btn svg {
    display: block;
}

.updates-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px var(--bg-primary, #0a1628);
}

.updates-badge.hidden {
    display: none;
}


.notif-bell:hover {
    color: var(--primary-color, #00b2f2);
    background: rgba(0, 178, 242, 0.08);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-primary, #0a1628);
    animation: notifPulse 2s ease infinite;
}

.notif-badge.hidden {
    display: none;
}

@keyframes notifPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* ==================== DROPDOWN ==================== */

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, calc(100vw - 1rem));
    max-height: min(560px, 80vh);
    background: rgba(9, 16, 31, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 200, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 10000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notif-dropdown.hidden {
    display: none;
}

#notifCenterModal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 8, 20, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100001;
}

#notifCenterModal.hidden {
    display: none !important;
}

.notif-center-backdrop {
    position: absolute;
    inset: 0;
}

#notifCenterCard {
    position: relative;
    width: min(92vw, 460px);
    height: min(78vh, 720px);
    max-height: min(78vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(10, 23, 46, 0.98), rgba(6, 14, 28, 0.98));
    border: 1px solid rgba(0, 200, 255, 0.18);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.38);
}

#notifCenterCard .notif-list {
    flex: 1;
    min-height: 0;
    max-height: none;
}

@media (min-width: 992px) {
    body.app-shell:not(.admin-page) [data-desktop-utility-dock] #notif-bell-wrapper {
        order: 2;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: auto;
        z-index: 1;
    }

    body.app-shell:not(.admin-page) [data-desktop-utility-dock] .notif-bell {
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
        justify-content: center;
        border: 1px solid rgba(110, 232, 255, 0.28);
        border-radius: 18px;
        background: linear-gradient(155deg, rgba(10, 22, 45, 0.76), rgba(8, 16, 31, 0.5));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    body.app-shell:not(.admin-page) [data-desktop-utility-dock] .updates-feed-btn {
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
        justify-content: center;
        border: 1px solid rgba(110, 232, 255, 0.18);
        border-radius: 18px;
        background: linear-gradient(155deg, rgba(10, 22, 45, 0.76), rgba(8, 16, 31, 0.5));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    body.app-shell:not(.admin-page) [data-desktop-utility-dock] .notif-dropdown {
        position: absolute;
        top: calc(100% + 0.65rem);
        left: 0;
        right: auto;
        bottom: auto;
        transform: none;
        width: min(420px, calc(100vw - var(--app-side-header-width, 300px) - 5rem));
        max-height: min(560px, 78vh);
    }
}

@media (max-width: 768px) {
    body.user-authenticated:not(.admin-page) .header-content > #notif-bell-wrapper {
        position: absolute;
        top: 50%;
        right: 0.12rem;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        z-index: 4;
    }

    body.user-authenticated:not(.admin-page) .header-content > #notif-bell-wrapper .notif-bell {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border: 1px solid rgba(110, 232, 255, 0.24);
        border-radius: 14px;
        background: linear-gradient(155deg, rgba(10, 22, 45, 0.84), rgba(8, 16, 31, 0.72));
        color: #dff7ff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    body.user-authenticated:not(.admin-page) .header-content > #notif-bell-wrapper .updates-feed-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border: 1px solid rgba(110, 232, 255, 0.18);
        border-radius: 14px;
        background: linear-gradient(155deg, rgba(10, 22, 45, 0.84), rgba(8, 16, 31, 0.72));
        color: #dff7ff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    body.user-authenticated:not(.admin-page) .header-content > #notif-bell-wrapper .notif-badge {
        top: -2px;
        right: -2px;
        box-shadow: 0 0 0 2px rgba(6, 16, 34, 0.95);
    }

    html[dir="ltr"] body.user-authenticated:not(.admin-page) .header-content > #notif-bell-wrapper {
        right: auto;
        left: 0.12rem;
    }

    #notifCenterModal {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    #notifCenterCard {
        width: min(100%, 420px);
        height: min(76vh, 680px);
        max-height: min(76vh, 680px);
        border-radius: 22px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    body.user-authenticated:not(.admin-page) .header-content > #notif-bell-wrapper .notif-bell {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #e8edf5);
    flex-shrink: 0;
}

.notif-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--primary-color, #00b2f2);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.notif-mark-all:hover {
    background: rgba(0, 178, 242, 0.1);
}

.notif-close-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #e8edf5);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.notif-close-btn:hover {
    background: rgba(0, 178, 242, 0.12);
}

/* ==================== LIST ==================== */

.notif-list {
    overflow-y: auto;
    max-height: min(470px, 68vh);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(0, 178, 242, 0.04);
}

.notif-unread {
    background: rgba(0, 178, 242, 0.06);
    border-right: 3px solid var(--primary-color, #00b2f2);
}

.notif-read {
    opacity: 0.7;
}

.notif-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #e8edf5);
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    word-break: break-word;
}

.notif-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    vertical-align: middle;
    white-space: nowrap;
}

.notif-source-admin {
    color: #dff7ff;
    background: linear-gradient(135deg, rgba(0, 178, 242, 0.22), rgba(0, 200, 255, 0.12));
    border: 1px solid rgba(0, 200, 255, 0.26);
}

.notif-body {
    font-size: 0.82rem;
    color: var(--text-secondary, #8a93a6);
    margin-top: 4px;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    word-break: break-word;
    line-height: 1.7;
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-secondary, #8a93a6);
    margin-top: 4px;
    opacity: 0.7;
}

.notif-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary, #8a93a6);
    font-size: 0.85rem;
}

/* ==================== DETAILS MODAL ==================== */

.notif-details-modal {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.notif-details-modal.active {
    display: flex;
}

.notif-details-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 9, 20, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.notif-details-card {
    position: relative;
    width: min(720px, calc(100vw - 2rem));
    max-height: min(80vh, 760px);
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(0, 200, 255, 0.16);
    background: rgba(9, 16, 31, 0.97);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    padding: 1.25rem 1.25rem 1rem;
}

.notif-details-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #e8edf5);
    cursor: pointer;
    font-size: 1.2rem;
}

.notif-details-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #e8edf5);
    padding-left: 3rem;
    line-height: 1.6;
}

.notif-details-time {
    color: var(--text-secondary, #8a93a6);
    font-size: 0.82rem;
    margin-top: 0.35rem;
    padding-left: 3rem;
}

.notif-details-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.55rem 0 0.15rem;
    padding-left: 3rem;
}

.notif-details-body {
    margin-top: 1rem;
    color: var(--text-primary, #e8edf5);
    font-size: 0.95rem;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}

.notif-details-meta {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.notif-details-meta-title {
    color: var(--text-secondary, #8a93a6);
    font-size: 0.82rem;
    font-weight: 700;
}

.notif-details-grid {
    display: grid;
    gap: 0.65rem;
}

.notif-details-row {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-details-label {
    color: var(--text-secondary, #8a93a6);
    font-size: 0.84rem;
}

.notif-details-value {
    color: var(--text-primary, #e8edf5);
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .notif-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        border-radius: 20px 20px 0 0;
        max-height: 60vh;
        z-index: 20000;
        animation: notifSlideUp 0.3s ease forwards;
    }

    .notif-details-modal {
        align-items: flex-end;
        padding: 0;
    }

    .notif-details-card {
        width: 100%;
        max-height: 82vh;
        border-radius: 20px 20px 0 0;
        padding: 1.1rem 1rem 1rem;
    }

    .notif-details-title,
    .notif-details-time {
        padding-left: 2.7rem;
    }

    .notif-details-row {
        grid-template-columns: 1fr;
    }

    @keyframes notifSlideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

@media (max-width: 768px) {
    .notif-badge,
    .notif-dropdown,
    .notif-details-card {
        animation: none !important;
    }

    .notif-dropdown,
    .notif-details-backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .notif-dropdown {
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
    }

    .notif-details-card {
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
    }
}
