/* ===================================
   Navigation Styles
   =================================== */

/* Sidebar Navigation */
.sidebar-nav {
    background-color: var(--bs-dark);
    min-height: 100vh;
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform var(--transition-speed);
    border-right: 1px solid var(--bs-border-color);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-light);
    text-decoration: none;
    display: block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar-brand:hover {
    color: var(--bs-light);
    text-decoration: none;
}

.sidebar-menu {
    padding: 1rem 0;
    padding-bottom: 80px;
    /* Prevent overlap with footer */
    overflow-y: auto;
    height: calc(100vh - 80px);
    /* Account for header height */
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--bs-gray-300);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.nav-link-custom:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bs-light);
    border-left-color: var(--bs-primary);
}

.nav-link-custom.active {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
    font-weight: 500;
}

.nav-link-custom:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bs-light);
    border-left-color: var(--bs-primary);
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background-color: var(--bs-primary);
    border: none;
    border-radius: 0.375rem;
    padding: 0.6rem 1rem;
    color: white;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .sidebar-nav {
        transform: translateX(-100%);
    }

    .sidebar-nav.show {
        transform: translateX(0);
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .main-content-wrapper {
        margin-left: 0 !important;
    }
}

@media (min-width: 769px) {
    .main-content-wrapper {
        margin-left: var(--sidebar-width);
    }
}

/* Category Styling */
.category-item {
    margin-bottom: 0.5rem;
}

.category-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--bs-gray-400);
    text-align: left;
    transition: all var(--transition-speed);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-header:hover {
    color: var(--bs-light);
}

.category-header:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
    color: var(--bs-light);
}

.category-arrow {
    transition: transform var(--transition-speed);
}

.category-header.expanded .category-arrow {
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease-out;
}

.category-content.show {
    max-height: 800px;
    /* Increased from 500px to accommodate growing categories (e.g., "Configurations and manual inputs" has 5 items).
       Provides headroom for future additions and ensures smoother animation timing. */
    transition: max-height var(--transition-speed) ease-in;
}

.sub-item .nav-link-custom {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background-color: var(--bs-dark);
    border-top: 1px solid var(--bs-border-color);
}

.close-menu-btn {
    width: 100%;
}