/* ============================================
   NEXUS SIDEBAR - Futuristic Side Navigation
   ============================================ */

.nexus-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--nexus-bg-secondary);
    border-right: 1px solid var(--nexus-glass-border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--nexus-transition-base);
}

.nexus-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(99, 102, 241, 0.1) 0%,
        transparent 50%,
        rgba(236, 72, 153, 0.05) 100%
    );
    pointer-events: none;
}

/* Logo Section */
.nexus-sidebar-logo {
    padding: var(--nexus-space-xl) var(--nexus-space-lg);
    border-bottom: 1px solid var(--nexus-glass-border);
    position: relative;
    z-index: 1;
}

.nexus-logo-container {
    display: flex;
    align-items: center;
    gap: var(--nexus-space-md);
    text-decoration: none;
    transition: all var(--nexus-transition-base);
}

.nexus-logo-icon {
    width: auto;
    height: auto;
    background: none;
    border: none;
    border-radius: var(--nexus-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: none;
    animation: float 3s ease-in-out infinite;
}

.nexus-logo-icon img {
    width: 64px;
    height: 64px;
    border-radius: var(--nexus-radius-md);
    border: 2px solid #94a3b8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.nexus-logo-text {
    display: flex;
    flex-direction: column;
}

.nexus-logo-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--nexus-text-primary);
    background: linear-gradient(135deg, #ffffff, var(--nexus-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nexus-logo-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--nexus-text-tertiary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Navigation */
.nexus-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--nexus-space-lg) 0;
    position: relative;
    z-index: 1;
}

.nexus-nav-section {
    margin-bottom: var(--nexus-space-xl);
}

.nexus-nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--nexus-text-muted);
    padding: 0 var(--nexus-space-lg) var(--nexus-space-sm);
    display: flex;
    align-items: center;
    gap: var(--nexus-space-sm);
}

.nexus-nav-section-icon {
    width: 4px;
    height: 4px;
    background: var(--nexus-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--nexus-primary);
}

.nexus-nav-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nexus-nav-item {
    margin-bottom: var(--nexus-space-xs);
}

.nexus-nav-link {
    display: flex !important;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--nexus-space-md);
    padding: var(--nexus-space-md) var(--nexus-space-lg);
    margin: 0 var(--nexus-space-sm);
    color: var(--nexus-text-secondary);
    text-decoration: none;
    border-radius: var(--nexus-radius-md);
    transition: all var(--nexus-transition-base);
    position: relative;
    overflow: hidden;
}

.nexus-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--nexus-primary);
    transform: scaleY(0);
    transition: transform var(--nexus-transition-base);
}

.nexus-nav-link:hover {
    background: var(--nexus-glass-hover);
    color: var(--nexus-text-primary);
    transform: translateX(4px);
}

.nexus-nav-link.active {
    background: var(--nexus-glass);
    color: var(--nexus-text-primary);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.nexus-nav-link.active::before {
    transform: scaleY(1);
}

.nexus-nav-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all var(--nexus-transition-base);
}

.nexus-nav-link:hover .nexus-nav-icon {
    transform: scale(1.1);
}

.nexus-nav-link.active .nexus-nav-icon {
    color: var(--nexus-primary);
}

.nexus-nav-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex: 1;
    display: inline-block;
}

.nexus-nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--nexus-glass);
    border-radius: var(--nexus-radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--nexus-primary);
}

/* Collapse/Expand Icons */
.nexus-nav-collapse-icon {
    margin-left: auto;
    transition: transform var(--nexus-transition-base);
    font-size: 12px;
}

.nexus-nav-link.expanded .nexus-nav-collapse-icon {
    transform: rotate(180deg);
}

/* Sub-menu */
.nexus-nav-submenu {
    list-style: none;
    padding-left: calc(var(--nexus-space-lg) + 36px);
    margin: var(--nexus-space-xs) 0 var(--nexus-space-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--nexus-transition-base);
}

.nexus-nav-submenu.show {
    max-height: 500px;
}

.nexus-nav-submenu-item {
    margin-bottom: var(--nexus-space-xs);
}

.nexus-nav-submenu-link {
    display: flex;
    align-items: center;
    gap: var(--nexus-space-sm);
    padding: var(--nexus-space-sm) var(--nexus-space-md);
    color: var(--nexus-text-tertiary);
    text-decoration: none;
    border-radius: var(--nexus-radius-sm);
    font-size: 13px;
    transition: all var(--nexus-transition-base);
}

.nexus-nav-submenu-link::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--nexus-text-muted);
    border-radius: 50%;
    transition: all var(--nexus-transition-base);
}

.nexus-nav-submenu-link:hover {
    color: var(--nexus-text-primary);
    background: var(--nexus-glass);
    transform: translateX(4px);
}

.nexus-nav-submenu-link:hover::before {
    background: var(--nexus-primary);
    box-shadow: 0 0 8px var(--nexus-primary);
}

.nexus-nav-submenu-link.active {
    color: var(--nexus-text-primary);
    background: var(--nexus-glass);
}

.nexus-nav-submenu-link.active::before {
    background: var(--nexus-primary);
    box-shadow: 0 0 8px var(--nexus-primary);
}

/* Footer Section */
.nexus-sidebar-footer {
    padding: var(--nexus-space-lg);
    border-top: 1px solid var(--nexus-glass-border);
    background: var(--nexus-glass);
    position: relative;
    z-index: 1;
}

.nexus-user-profile {
    display: flex;
    align-items: center;
    gap: var(--nexus-space-md);
    padding: var(--nexus-space-md);
    background: var(--nexus-glass);
    border-radius: var(--nexus-radius-md);
    cursor: pointer;
    transition: all var(--nexus-transition-base);
}

.nexus-user-profile:hover {
    background: var(--nexus-glass-hover);
    transform: scale(1.02);
}

.nexus-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--nexus-radius-full);
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    position: relative;
}

.nexus-user-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--nexus-success);
    border: 2px solid var(--nexus-bg-secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--nexus-success);
}

.nexus-user-info {
    flex: 1;
    overflow: hidden;
}

.nexus-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--nexus-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nexus-user-role {
    font-size: 12px;
    color: var(--nexus-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nexus-user-menu-icon {
    color: var(--nexus-text-tertiary);
    transition: transform var(--nexus-transition-base);
}

.nexus-user-profile:hover .nexus-user-menu-icon {
    transform: rotate(90deg);
}

/* Mobile Toggle */
.nexus-sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--nexus-space-lg);
    left: var(--nexus-space-lg);
    z-index: 101;
    width: 44px;
    height: 44px;
    background: var(--nexus-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--nexus-glass-border);
    border-radius: var(--nexus-radius-md);
    color: var(--nexus-text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--nexus-transition-base);
}

.nexus-sidebar-toggle:hover {
    background: var(--nexus-glass-hover);
    box-shadow: var(--nexus-glow-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .nexus-sidebar {
        transform: translateX(-100%);
    }
    
    .nexus-sidebar.open {
        transform: translateX(0);
    }
    
    .nexus-sidebar-toggle {
        display: flex;
    }
    
    .nexus-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--nexus-transition-base);
    }
    
    .nexus-sidebar-overlay.show {
        opacity: 1;
        pointer-events: all;
    }
}

/* Force flexbox layout even when JavaScript applies display: block */
.nexus-nav-link[style*="display: block"] {
    display: flex !important;
}

.nexus-nav-link[style*="display: block"] .nexus-nav-icon {
    display: flex !important;
}

.nexus-nav-link[style*="display: block"] .nexus-nav-text {
    display: inline-block !important;
}

/* Animation Delays for Nav Items */
.nexus-nav-item:nth-child(1) { animation-delay: 0.05s; }
.nexus-nav-item:nth-child(2) { animation-delay: 0.1s; }
.nexus-nav-item:nth-child(3) { animation-delay: 0.15s; }
.nexus-nav-item:nth-child(4) { animation-delay: 0.2s; }
.nexus-nav-item:nth-child(5) { animation-delay: 0.25s; }
.nexus-nav-item:nth-child(6) { animation-delay: 0.3s; }
.nexus-nav-item:nth-child(7) { animation-delay: 0.35s; }
.nexus-nav-item:nth-child(8) { animation-delay: 0.4s; }

