/* Sidebar Styles
-------------------------------------------------- */

/* Base sidebar container - using stronger selector */
body .sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 1rem 0;
    overflow-y: auto;
    position: fixed;
    top: 60px;
    bottom: 0;
    z-index: 10;
}

/* Sidebar header section */
body .sidebar .sidebar-header {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

body .sidebar .sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

/* Section list that contains menu items */
body .sidebar .section-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Individual menu items - using higher specificity */
body .sidebar .section-list .section-item {
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
    display: block;
    position: relative;
    border-left: none;
    background: none;
}

/* Menu item header containing icon and title */
body .sidebar .section-list .section-item .section-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    height: auto;
    width: 100%;
}

/* Hover effect for menu items */
body .sidebar .section-list .section-item .section-header:hover {
    background-color: #f1f5f9;
}

/* Active indicator using pseudo-element to avoid layout shifts */
body .sidebar .section-list .section-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #3b82f6;
    z-index: 2;
}

/* Active state styling */
body .sidebar .section-list .section-item.active .section-header {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: none; /* Ensure no border is causing layout shifts */
}

body .sidebar .section-list .section-item.active .section-header:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Menu item title container */
.section-item-title {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Icons in menu items */
.section-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #e0f2fe;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Links within menu items */
.section-item-title a {
    color: #1e293b;
    text-decoration: none;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
}

/* Active state text color */
.section-item.active .section-item-title a {
    font-weight: 500;
    color: #3b82f6;
}

/* Project name text */
.section-item-title .project-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}
