﻿.NM-sidebar {
    width: 80px; /* Fixed width for collapsed state */
    height: 100vh;
    position: fixed; /* Change to fixed instead of sticky */
    top: 0;
    left: 0;
    background-color: #f8f9fa;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: width 0.3s ease-in-out;
    overflow-x: hidden;
    z-index: 1050; /* Higher than topbar */
}

    .NM-sidebar.NM-expanded {
        width: 250px; /* Fixed width for expanded state */
    }

    /* Text positioning fix */
    .NM-sidebar .NM-nav-text {
        display: inline-block;
        margin-left: 12px;
        font-weight: 500;
        transition: opacity 0.2s ease-out;
        opacity: 0;
        position: static; /* Keep in normal flow */
        color: #0275d8; /* Match link color */
    }

    .NM-sidebar.NM-expanded .NM-nav-text {
        opacity: 1;
    }

.NM-top-row {
    min-height: 3.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
}

.NM-navbar-brand {
    font-size: 1.1rem;
    color: #333;
    transition: opacity 0.3s ease-in-out;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    text-decoration: none; /* Remove underline */
}

.NM-sidebar.NM-expanded .NM-navbar-brand {
    opacity: 1;
}

.NM-nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.8rem; /* Increased spacing between nav items */
    white-space: nowrap;
    position: relative;
}

    .NM-nav-item:first-of-type {
        padding-top: 1.2rem; /* Increased top padding */
    }

    .NM-nav-item:last-of-type {
        padding-bottom: 1.2rem; /* Increased bottom padding */
    }

/* Remove all link underlines */
.NM-nav-link {
    color: #0275d8;
    background: none;
    border: none;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    width: 100%;
    transition: all 0.3s ease-in-out;
    text-decoration: none !important; /* Force no underline */
    padding: 0 0.75rem;
    position: relative; /* For the active indicator */
    border-left: 0 solid transparent; /* Start with 0 width border */
    transition: border-left-width 0.3s ease, border-left-color 0.3s ease, background-color 0.3s ease;
}

    /* Ensure standard hover state */
    .NM-nav-link:hover {
        background-color: #e9ecef;
        color: #0275d8;
        text-decoration: none !important;
    }

    /* Active state animations */
    .NM-nav-link.active {
        border-left: 3px solid #0275d8;
        background-color: #e9ecef;
        padding-left: calc(0.75rem - 3px); /* Compensate for border */
    }

        .NM-nav-link.active i {
            color: #0275d8;
        }

    /* Font Awesome icons styling */
    .NM-nav-link i.fa-solid {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 1.5rem;
        height: 1.5rem;
        font-size: 1.2rem;
        color: #495057;
        transition: all 0.3s ease;
    }

    .NM-nav-link:hover i.fa-solid {
        color: #0275d8;
        transform: scale(1.1);
    }

/* Fix for collapsed hover effect */
.NM-sidebar:not(.NM-expanded):hover .NM-nav-text {
    opacity: 0; /* Keep text hidden in collapsed state */
}

/* Active state for blazor NavLink - this targets the auto-generated active class */
::deep a.active {
    border-left: 3px solid #0275d8 !important;
    background-color: #e9ecef !important;
    padding-left: calc(0.75rem - 3px) !important; /* Compensate for border width */
    /* Animation using CSS transitions */
    transition: border-left-width 0.3s ease, border-left-color 0.3s ease, background-color 0.3s ease, padding-left 0.3s ease !important;
}

::deep a.NM-nav-link {
    border-left: 0 solid transparent !important;
    transition: border-left-width 0.3s ease, border-left-color 0.3s ease, background-color 0.3s ease, padding-left 0.3s ease !important;
}

::deep a.active i {
    color: #0275d8 !important;
    transition: color 0.3s ease !important;
}

.NM-nav-scrollable {
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .NM-sidebar {
        position: fixed;
        z-index: 1100; /* Higher z-index to appear above everything */
        width: 0; /* Start completely collapsed */
        transform: translateX(-100%);
    }

        .NM-sidebar.NM-expanded {
            width: 250px;
            transform: translateX(0);
        }

    /* Adjust main content for mobile */
    .MO-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Footer URL styling at bottom of sidebar */
.NM-sidebar .NM-footer-url {
    font-size: 0.75rem;
    color: #6c757d;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    display: block;
    padding: 0.5rem;
    text-align: center;
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.05);
    text-decoration: none;
}

/* Additional animation for hover and active states */
.NM-nav-link {
    overflow: hidden;
}

    .NM-nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background-color: #0275d8;
        transition: width 0.3s ease;
    }

    .NM-nav-link:hover::after {
        width: 100%;
    }

::deep a.active::after {
    width: 100%;
}

/* Fix conflicts with MO namespace */
.NM-sidebar {
    z-index: 1050 !important; /* Higher than topbar but lower than modals */
    position: fixed !important;
}
