/* Estilos globales para header y body */

html, body {
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #1a0033 0%, #4b0082 50%, #00ddeb 100%) !important;
    min-height: 100vh !important;
}

.header-nav {
    background-color: #1e3a8a;
    background-image: 
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 4px),
        radial-gradient(circle, #1e3a8a 0%, #1e3a8a 100%),
        url('https://www.transparenttextures.com/patterns/felt.png');
    background-blend-mode: multiply;
    padding: 15px 30px;
    border-radius: 10px;
    margin: 20px;
    margin-bottom: 30px;
    box-shadow: 
        inset 0 0 8px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #334155;
    position: relative;
    overflow: visible !important;
    z-index: 1001;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    overflow: visible;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f97316;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-brand img {
    height: 70px;
    width: auto;
    transition: all 0.3s;
}

.nav-brand:hover img {
    filter: brightness(1.1);
}

.nav-right {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 240px;
    height: 100dvh;
    background: linear-gradient(180deg, #090e1a 0%, #000000 100%);
    flex-direction: column;
    align-items: flex-start !important;
    padding: 20px 0 40px 0;
    z-index: 1050;
    gap: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    transform: translateX(101%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.4s;
    display: flex !important;
}

.nav-right::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.nav-right.mobile-active {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
    box-shadow: -15px 0 60px rgba(0,0,0,0.95);
}

/* Desktop: navbar horizontal */
@media (min-width: 992px) {
    .nav-right {
        position: relative;
        top: auto;
        bottom: auto;
        right: auto;
        width: auto;
        height: auto;
        background: none;
        flex-direction: row;
        align-items: center !important;
        padding: 0 !important;
        z-index: auto;
        gap: 1rem !important;
        border-left: none;
        overflow: visible !important;
        transform: none;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        margin-left: auto;
        display: flex !important;
    }
    
    /* When mobile-active in desktop: show as sidebar */
    .nav-right.mobile-active {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        width: 240px;
        height: 100dvh;
        background: linear-gradient(180deg, #090e1a 0%, #000000 100%);
        flex-direction: column;
        align-items: flex-start !important;
        padding: 20px 0 40px 0;
        z-index: 1050;
        gap: 0 !important;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        min-height: 0;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
        overscroll-behavior: contain;
        touch-action: pan-y;
        margin-left: auto;
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
}

.nav-link {
    width: 100%;
    padding: 15px 25px !important;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: all 0.25s ease;
    position: relative;
    box-sizing: border-box;
}

.nav-link-profile {
    gap: 12px;
}

.mobile-notifications-trigger {
    border: none;
    background: transparent;
    text-align: left;
    justify-content: space-between;
    cursor: pointer;
    font-family: inherit;
}

.mobile-notification-count {
    display: none;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 5px;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.85), 0 0 10px rgba(239, 68, 68, 0.65);
}

.mobile-notification-count.visible {
    display: inline-flex;
}

.profile-notification-dot {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9), 0 0 10px rgba(239, 68, 68, 0.8);
    display: none;
    pointer-events: none;
}

.profile-notification-dot.visible {
    display: block;
    animation: pulse-red 2s infinite;
}

.nav-profile-avatar-wrap {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    position: relative;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 2px;
    isolation: isolate;
    background: #000;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.nav-profile-avatar {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

.nav-link-label {
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    line-height: 1.05;
}

.nav-link-sublabel {
    margin-top: 2px;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--profile-team-color, #9aa4b2);
    opacity: 0.95;
    letter-spacing: 0.01em;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link:hover, 
.nav-link.active,
.nav-link.parent-active {
    background: rgba(249, 115, 22, 0.12) !important;
    color: #f97316 !important;
    padding-left: 30px !important;
}

/* Desktop: navbar style */
@media (min-width: 992px) {
    .nav-link {
        width: auto;
        padding: 0.5rem 1rem !important;
        border-bottom: none;
        color: white !important;
        font-size: 1rem;
        border-radius: 5px;
        overflow: visible !important;
    }

    .nav-link-profile {
        padding-right: 1.1rem !important;
        gap: 12px;
    }

    .profile-notification-dot {
        top: 5px;
        right: 6px;
    }

    .nav-profile-avatar-wrap {
        width: 24px;
        height: 24px;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 10px rgba(0, 0, 0, 0.22);
        transform: scale(1.9);
        transform-origin: center;
        margin-right: 10px;
    }
    
    .nav-link:hover,
    .nav-link.active,
    .nav-link.parent-active {
        background: rgba(249, 115, 22, 0.2);
        color: #f97316 !important;
        padding-left: 1rem !important;
    }
    
    /* When sidebar is active, restore sidebar styles for links */
    .nav-right.mobile-active .nav-link {
        width: 100%;
        padding: 15px 25px !important;
        border-bottom: 1px solid rgba(255,255,255,0.03);
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 1.05rem;
        border-radius: 0;
    }

    .nav-right.mobile-active .nav-link-profile {
        gap: 12px;
    }

    .nav-right.mobile-active .nav-link-sublabel {
        max-width: 190px;
    }

    .nav-right.mobile-active .profile-notification-dot {
        top: 14px;
        right: 18px;
    }

    .nav-right.mobile-active .nav-profile-avatar-wrap {
        width: 28px;
        height: 28px;
    }

    .nav-right.mobile-active .nav-link:hover, 
    .nav-right.mobile-active .nav-link.active,
    .nav-right.mobile-active .nav-link.parent-active {
        background: rgba(249, 115, 22, 0.12) !important;
        color: #f97316 !important;
        padding-left: 30px !important;
    }

    .nav-right.mobile-active .nav-link.active::after,
    .nav-right.mobile-active .nav-link.parent-active::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background-color: #f97316;
        box-shadow: 2px 0 10px rgba(249, 115, 22, 0.3);
    }

    /* Sidebar sub-items styling in desktop */
    .nav-right.mobile-active .mobile-sub-item {
        width: 100% !important;
        padding: 12px 25px 12px 45px !important;
        font-size: 0.95rem !important;
        color: rgba(255, 255, 255, 0.5) !important;
        background: rgba(255, 255, 255, 0.01) !important;
        border-bottom: 1px solid rgba(255,255,255,0.02) !important;
    }

    .nav-right.mobile-active .mobile-sub-item:hover,
    .nav-right.mobile-active .mobile-sub-item.active {
        background: rgba(255, 255, 255, 0.03) !important;
        color: #fb923c !important;
        padding-left: 50px !important;
    }

    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-aether:hover,
    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-aether.active {
        color: #9370db !important;
    }

    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-air:hover,
    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-air.active {
        color: #87ceeb !important;
    }

    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-earth:hover,
    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-earth.active {
        color: #228b22 !important;
    }

    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-fire:hover,
    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-fire.active {
        color: #ff6347 !important;
    }

    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-water:hover,
    .nav-right.mobile-active .mobile-sub-item.tribe-menu-item.tribe-water.active {
        color: #4169e1 !important;
    }

    .nav-right.mobile-active .show-on-mobile {
        display: flex !important;
    }
}

.show-on-mobile {
    display: none !important;
}

/* --- Mobile Menu & global UI elements --- */

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    position: relative;
}

.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #f97316;
    margin: 2px 0;
    transition: 0.4s;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.mobile-edge-tab {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.8);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: 999px;
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
    font-weight: 800;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2002;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.mobile-edge-tab span {
    display: block;
    line-height: 1;
}

.mobile-notifications-sheet {
    position: fixed;
    inset: 0;
    z-index: 2200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.mobile-notifications-sheet.open {
    pointer-events: auto;
    opacity: 1;
}

.mobile-notifications-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(3px);
}

.mobile-notifications-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(76vh, 640px);
    border-radius: 18px 18px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: none;
    background: linear-gradient(180deg, rgba(9, 14, 26, 0.98), rgba(2, 6, 23, 0.98));
    box-shadow: 0 -20px 38px rgba(0, 0, 0, 0.45);
    padding: 10px 12px 14px;
    transform: translateY(104%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    will-change: transform;
    touch-action: pan-y;
    overflow: hidden;
}

.mobile-notifications-sheet.open .mobile-notifications-sheet-panel {
    transform: translateY(0);
}

.mobile-notifications-sheet-panel.is-dragging {
    transition: none;
}

.mobile-notifications-sheet-handle {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.26);
    margin: 2px auto 0;
}

.mobile-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 2px 0;
}

.mobile-notifications-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 800;
}

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

.mobile-notifications-close {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.mobile-notifications-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    padding-right: 2px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    overflow-y: auto;
}

@media (min-width: 992px) {
    .mobile-notifications-sheet {
        display: none !important;
    }

    .mobile-notifications-trigger {
        display: none !important;
    }
}

@media (max-width: 991px) and (orientation: portrait) {
    .mobile-notifications-sheet {
        font-size: 17px;
    }

    .mobile-notifications-sheet-panel {
        height: 50dvh;
        max-height: 50dvh;
        padding: 12px 13px 12px;
        gap: 13px;
    }

    .mobile-notifications-list {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none !important;
        padding-right: 4px;
    }

    .mobile-notifications-title {
        font-size: 1.18rem;
    }

    .mobile-notifications-head .profile-notifications-action {
        font-size: 0.93rem;
        padding: 8px 13px;
    }

    .mobile-notifications-sheet .mobile-notifications-close {
        width: 36px;
        height: 36px;
        font-size: 1.04rem;
    }

    .mobile-notifications-sheet .profile-notification-item {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        gap: 13px;
        padding: 13px 14px;
    }

    .mobile-notifications-sheet .profile-notification-avatar-column {
        width: 58px;
        gap: 7px;
    }

    .mobile-notifications-sheet .profile-notification-avatar-wrap {
        width: 45px;
        height: 45px;
    }

    .mobile-notifications-sheet .profile-notification-media-wrap {
        width: 64px;
        height: 64px;
    }

    .mobile-notifications-sheet .profile-notification-media-global-popover {
        width: 256px;
        height: 256px;
    }

    .mobile-notifications-sheet .profile-notification-interaction {
        min-width: 28px;
        height: 19px;
        padding: 0 9px;
        font-size: 0.8rem;
    }

    .mobile-notifications-sheet .profile-notification-meta {
        font-size: 0.96rem;
    }

    .mobile-notifications-sheet .profile-notification-title {
        font-size: 1.04rem;
    }

    .mobile-notifications-sheet .profile-notification-preview {
        font-size: 1.01rem;
        line-height: 1.48;
    }

    .mobile-notifications-sheet .profile-notification-time {
        font-size: 0.86rem;
    }
}

/* Back to Top global style */
.back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    background: linear-gradient(135deg, #f97316 0%, #ff9d3f 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    transition: all 0.3s;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
}

.back-to-top.show {
    display: block;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .header-nav {
        margin: 10px !important;
        padding: 5px 15px !important;
        border-radius: 12px !important;
        width: auto !important;
        max-width: none !important;
        left: auto !important;
        top: auto !important;
        border: 2px solid #334155 !important;
        z-index: 1045;
        position: relative;
        overflow: visible !important;
    }

    .mobile-nav-toggle {
        display: none !important;
    }

    .mobile-edge-tab {
        display: flex;
    }
    
    /* Selection indicator line for mobile */
    .nav-link.active::after,
    .nav-link.parent-active::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background-color: #f97316;
        box-shadow: 2px 0 10px rgba(249, 115, 22, 0.3);
    }

    .show-on-mobile {
        display: flex !important;
    }

    /* Hierarchy for mobile links */
    .mobile-sub-item {
        width: 100% !important;
        padding: 12px 25px 12px 45px !important; /* Indented for sub-items */
        font-size: 0.95rem !important;
        color: rgba(255, 255, 255, 0.5) !important;
        background: rgba(255, 255, 255, 0.01) !important;
        border-bottom: 1px solid rgba(255,255,255,0.02) !important;
    }

    .mobile-sub-item:hover,
    .mobile-sub-item.active {
        background: rgba(255, 255, 255, 0.03) !important;
        color: #fb923c !important;
        padding-left: 50px !important;
    }

    .mobile-sub-item::before {
        content: none;
    }

    .nav-link-profile {
        gap: 12px;
    }
}

/* Footer Styles */

.footer {
    background-color: #1e3a8a;
    background-image: 
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 4px),
        radial-gradient(circle, #1e3a8a 0%, #1e3a8a 100%),
        url('https://www.transparenttextures.com/patterns/felt.png');
    background-blend-mode: multiply;
    padding: 2rem 30px;
    border-radius: 10px;
    margin: 30px 20px 20px 20px;
    box-shadow: 
        inset 0 0 8px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #334155;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 138, 0.3);
    z-index: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 500;
}

.footer-text strong {
    color: #f97316;
    font-weight: bold;
}

.nexus-status-banner {
    text-align: center;
    margin: 10px 20px 0 20px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid #22c55e;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 100;
}

@media (max-width: 768px) {
    .nexus-status-banner {
        margin: 10px 10px 0 10px;
        font-size: 0.85rem;
    }
}
/* ===== SIMPLE DESKTOP SUBMENU ===== */

.desktop-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: auto;
    padding: 8px 30px;
    margin-top: -19px;
    background-color: #264681;
    background-image: 
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 4px),
        radial-gradient(circle, #264681 0%, #264681 100%),
        url('https://www.transparenttextures.com/patterns/felt.png');
    background-blend-mode: multiply;
    border: 2px solid #334155;
    border-radius: 10px;
    box-shadow: 
        inset 0 0 8px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    transform: translateX(-50%);
}

.desktop-submenu.visible {
    display: flex;
}

.submenu-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.submenu-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.submenu-group-profile {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    min-width: 360px;
}

.submenu-links-block {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.submenu-item {
    padding: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 400;
    background: transparent;
    border: none;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline;
    white-space: nowrap;
}

.desktop-submenu .submenu-item.tribe-menu-item {
    background: transparent !important;
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.submenu-item:hover {
    color: #fb923c;
}

.submenu-item.active {
    color: #fb923c;
    font-weight: bold;
    text-decoration: none;
}

.desktop-submenu .tribe-menu-item.tribe-aether:hover,
.desktop-submenu .tribe-menu-item.tribe-aether.active,
.tribe-menu-item.tribe-aether:hover,
.tribe-menu-item.tribe-aether.active {
    color: #9370db !important;
}

.desktop-submenu .tribe-menu-item.tribe-air:hover,
.desktop-submenu .tribe-menu-item.tribe-air.active,
.tribe-menu-item.tribe-air:hover,
.tribe-menu-item.tribe-air.active {
    color: #87ceeb !important;
}

.desktop-submenu .tribe-menu-item.tribe-earth:hover,
.desktop-submenu .tribe-menu-item.tribe-earth.active,
.tribe-menu-item.tribe-earth:hover,
.tribe-menu-item.tribe-earth.active {
    color: #228b22 !important;
}

.desktop-submenu .tribe-menu-item.tribe-fire:hover,
.desktop-submenu .tribe-menu-item.tribe-fire.active,
.tribe-menu-item.tribe-fire:hover,
.tribe-menu-item.tribe-fire.active {
    color: #ff6347 !important;
}

.desktop-submenu .tribe-menu-item.tribe-water:hover,
.desktop-submenu .tribe-menu-item.tribe-water.active,
.tribe-menu-item.tribe-water:hover,
.tribe-menu-item.tribe-water.active {
    color: #4169e1 !important;
}

.profile-notifications-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-notifications-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    font-weight: 700;
}

.profile-notifications-action {
    border: 1px solid rgba(249, 115, 22, 0.28);
    background: rgba(249, 115, 22, 0.08);
    color: #fb923c;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-notifications-action:hover:not(:disabled) {
    background: rgba(249, 115, 22, 0.18);
    border-color: rgba(249, 115, 22, 0.5);
}

.profile-notifications-action:disabled {
    opacity: 0.45;
    cursor: default;
}

.profile-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--xe-scrollbar-thumb-color) var(--xe-scrollbar-track-color);
}

.profile-notifications-list::-webkit-scrollbar {
    width: 8px;
}

.profile-notifications-list::-webkit-scrollbar-track {
    background: linear-gradient(180deg, var(--xe-scrollbar-track-color), var(--xe-scrollbar-track-color-strong));
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.profile-notifications-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--xe-scrollbar-thumb-color-strong), var(--xe-scrollbar-thumb-color));
    border-radius: 999px;
    border: 2px solid var(--xe-scrollbar-thumb-border);
    box-shadow: 0 0 10px var(--xe-scrollbar-glow);
}

.profile-notifications-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--xe-scrollbar-thumb-hover-color-strong), var(--xe-scrollbar-thumb-hover-color));
}

.profile-notifications-list::-webkit-scrollbar-corner {
    background: transparent;
}

.profile-notification-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-notification-section-title {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-notification-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.profile-notification-item:hover {
    transform: translateY(-1px);
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.08);
}

.profile-notification-item.is-unread {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.profile-notification-avatar-wrap {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.9), rgba(59, 130, 246, 0.85));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.profile-notification-avatar-column {
    width: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.profile-notification-interaction {
    position: relative;
    min-width: 24px;
    height: 16px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    border: 1px solid transparent;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.profile-notification-interaction::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translate(-4px, -50%);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    z-index: 12;
    font-size: calc(0.62rem + 1px);
    font-weight: 700;
    color: rgba(250, 252, 255, 0.96);
    background: linear-gradient(135deg, rgba(12, 18, 36, 0.96), rgba(18, 30, 58, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 8px;
    padding: 3px 7px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.profile-notification-interaction::before {
    content: '';
    position: absolute;
    left: calc(100% + 5px);
    top: 50%;
    width: 6px;
    height: 6px;
    background: rgba(18, 30, 58, 0.96);
    border-left: 1px solid rgba(148, 163, 184, 0.36);
    border-bottom: 1px solid rgba(148, 163, 184, 0.36);
    transform: translateY(-50%) rotate(45deg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.profile-notification-interaction:hover::after,
.profile-notification-interaction:hover::before {
    opacity: 1;
    visibility: visible;
}

.profile-notification-interaction:hover::after {
    transform: translate(0, -50%);
}

.profile-notification-interaction-like {
    color: #ffd8df;
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.6);
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.profile-notification-interaction-reply {
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(96, 165, 250, 0.55);
}

.profile-notification-interaction-mention {
    color: #cffafe;
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(34, 211, 238, 0.55);
}

.profile-notification-interaction-reply-mention {
    color: #f5eaff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(168, 85, 247, 0.24));
    border-color: rgba(167, 139, 250, 0.62);
}

.profile-notification-interaction-generic {
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.profile-notification-interaction-nexus {
    color: #ffe7cf;
    background: rgba(255, 140, 0, 0.22);
    border-color: rgba(255, 171, 64, 0.6);
    text-shadow: 0 0 7px rgba(255, 140, 0, 0.55);
}

.profile-notification-avatar,
.profile-notification-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    color: white;
    font-weight: 700;
}

.profile-notification-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-notification-meta,
.profile-notification-title,
.profile-notification-preview,
.profile-notification-time {
    display: block;
}

.profile-notification-meta {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.78);
}

.profile-notification-title {
    font-size: 0.78rem;
    color: #93c5fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-notification-preview {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.35;
}

.profile-notification-media-wrap {
    display: inline-flex;
    width: 56px;
    height: 56px;
    margin-top: 4px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.profile-notification-media-anchor {
    position: relative;
    display: inline-flex;
    width: max-content;
}

.profile-notification-media-global-popover {
    position: fixed;
    left: 0;
    top: 0;
    width: 224px;
    height: 224px;
    transform: scale(0.96);
    transform-origin: left center;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(8, 14, 28, 0.96);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1000000;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.profile-notification-media-global-popover::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    width: 10px;
    height: 10px;
    transform: translateY(-50%) rotate(45deg);
    background: rgba(8, 14, 28, 0.96);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.profile-notification-media-global-popover.popover-left {
    transform-origin: right center;
}

.profile-notification-media-global-popover.popover-left::before {
    left: auto;
    right: -6px;
    border-left: none;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.profile-notification-media-global-popover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-notification-media-global-popover.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.profile-notification-media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-notification-item.has-media .profile-notification-body {
    gap: 4px;
}

.profile-notification-time {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    padding-top: 2px;
}

.profile-notifications-empty {
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* DESKTOP ONLY */
@media (max-width: 991px) {
    .desktop-submenu {
        display: none !important;
    }
}

/* Hide submenu when mobile menu is open */
.nav-right.mobile-active ~ .desktop-submenu,
.nav-right.mobile-active + button + .desktop-submenu {
    display: none !important;
}

@media (min-width: 992px) {
    .header-nav {
        position: relative;
    }

    .desktop-submenu {
        max-height: calc(100dvh - 76px);
        overflow: hidden;
    }

    .submenu-content,
    .submenu-group-profile,
    .profile-notifications-panel {
        min-height: 0;
    }

    .submenu-content,
    .submenu-group-profile {
        max-height: 100%;
        align-items: stretch;
    }

    .profile-notifications-panel {
        flex: 1 1 auto;
    }

    .profile-notifications-list {
        max-height: calc(100dvh - 220px);
    }
}

/* NEXUS STATUS INDICATOR LIGHT */
.nexus-status-light {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    position: absolute;
    top: -1px;
    right: -2px;
}

.nexus-status-light.nexus-active {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse-green 2s infinite;
}

.nexus-status-light.nexus-closed {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.nexus-status-light.nexus-warning {
    background-color: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.nexus-status-light.nexus-prematch {
    background-color: #f97316;
    box-shadow: 0 0 10px #f97316;
    animation: pulse-orange 1.8s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75), 0 0 0 2px rgba(15, 23, 42, 0.9);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 0 0 2px rgba(15, 23, 42, 0.9);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 0 2px rgba(15, 23, 42, 0.9);
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.72);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}
