.neuralstack-sidebar {
    width: 300px;
    height: 100%;
    background: var(--io-surface-raised);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.neuralstack-sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(var(--io-border-accent-fade-base), 0.3) 15%,
        rgba(var(--io-border-accent-fade-base), 1.0) 50%,
        rgba(var(--io-border-accent-fade-base), 0.3) 85%,
        transparent 100%
    );
    pointer-events: none;
}

.neuralstack-sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: linear-gradient(180deg, var(--io-surface-overlay) 0%, transparent 100%);
}

.neuralstack-sidebar-username {
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    background: linear-gradient(90deg, var(--io-text-primary) 0%, var(--io-text-primary) 40%, var(--io-accent-bright) 50%, var(--io-text-primary) 60%, var(--io-text-primary) 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 3s linear infinite;
    text-align: center;
}

@keyframes text-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.neuralstack-sidebar-avatar {
    border-radius: var(--io-radius-full);
    background-color: var(--io-surface-sunken);
    background-size: cover;
    background-position: center;
    border: 2px solid var(--io-accent-subtle);
    box-shadow: 0 0 24px var(--io-accent-glow);
    transition: all var(--io-transition-base);
    cursor: pointer;
    flex-shrink: 0;
    transform: translate3d(0, 0, 0);
    will-change: transform;
    image-rendering: -webkit-optimize-contrast;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    
}

#neuralstack-avatar{
transition: all 0.3s linear;
}

.neuralstack-sidebar-avatar:hover {
    border-color: var(--io-accent);
    box-shadow: 0 0 32px var(--io-accent-glow);
    transform: scale(1.05) translate3d(0, 0, 0);
}

.neuralstack-sidebar-appname {
    color: var(--io-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.neuralstack-sidebar-divider {
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--io-border) 50%, transparent 100%);
}

.neuralstack-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.neuralstack-sidebar-item {
    display: flex;
    align-items: center;
    color: var(--io-text-secondary);
    cursor: pointer;
    transition: all var(--io-transition-base);
    position: relative;
    overflow: hidden;
}

.neuralstack-sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--io-accent);
    transform: scaleY(0);
    transition: transform var(--io-transition-base);
}

.neuralstack-sidebar-item:hover {
    background: var(--io-surface-hover);
    color: var(--io-text-primary);
}

.neuralstack-sidebar-item:hover i {
    transform: scale(1.1);
}

.neuralstack-sidebar-item.active {
    background: var(--io-accent-subtle);
    color: var(--io-accent-bright);
}

.neuralstack-sidebar-item.active::before {
    transform: scaleY(1);
}

.neuralstack-sidebar-item i {
    text-align: center;
    transition: transform var(--io-transition-base);
    flex-shrink: 0;
}

.neuralstack-sidebar-item-label {
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.neuralstack-sidebar-toggle {
    display: flex;
    align-items: center;
    color: var(--io-text-tertiary);
    cursor: pointer;
    transition: all var(--io-transition-base);
    border-top: 1px solid var(--io-border-subtle);
    background: linear-gradient(0deg, var(--io-surface-overlay) 0%, transparent 100%);
}

.neuralstack-sidebar-toggle:hover {
    color: var(--io-accent);
    background: var(--io-surface-hover);
}

.neuralstack-sidebar-toggle i {
    transition: transform var(--io-transition-base);
}

.neuralstack-sidebar-toggle:hover i {
    transform: translateX(-4px);
}

.neuralstack-sidebar-toggle-label {
    font-weight: 500;
    white-space: nowrap;
}

.neuralstack-sidebar-collapse-compact {
    display: none;
}

.neuralstack-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.neuralstack-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.neuralstack-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--io-accent-subtle);
    border-radius: var(--io-radius-sm);
}

.neuralstack-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--io-accent);
}

.neuralstack-sidebar-avatar img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Sidebar transitions - SMOOTH ANIMATIONS */
.neuralstack-sidebar {
    transition: 
        width 300ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
}

/* Prevent layout shift during transitions */
.neuralstack-sidebar * {
    transition: 
        opacity 200ms ease,
        max-height 200ms ease,
        width 200ms ease,
        padding 200ms ease,
        gap 200ms ease,
        font-size 200ms ease;
}

/* Ensure sidebar is always visible during transitions */
.neuralstack-sidebar::after {
    transition: opacity 300ms ease;
}

/* Performance optimization */
.neuralstack-sidebar,
.neuralstack-sidebar * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
    user-select: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #neuralstack-body.sidebar-mini .neuralstack-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    }
}


/* Base username - allow 2-line wrap */
.neuralstack-sidebar-username {
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    max-width: 100%;
}

/* FULL STATE - 2 lines allowed */
.neuralstack-sidebar:not(.mini):not(.compact) .neuralstack-sidebar-username {
    font-size: var(--io-text-lg);
    max-height: 52px; /* ~2 lines at 1.3 line-height */
    opacity: 1;
}

/* COMPACT STATE - smaller font, 2 lines */
.neuralstack-sidebar.compact .neuralstack-sidebar-username {
    font-size: var(--io-text-sm);
    max-height: 38px; /* 2 lines */
}

