/* ============================================================
   WattFarmer Sidebar — Global Nav Item Styles (Light Theme)
   Loaded after Bootstrap so custom rules win by specificity.
   Zero !important.
   ============================================================ */

/* --- Design Tokens ------------------------------------------ */
:root {
    --sb-bg:            var(--wf-gray-50);
    --sb-text:          var(--wf-gray-700);
    --sb-text-hover:    var(--wf-gray-900);
    --sb-text-active:   var(--wf-blue-600);
    --sb-hover-bg:      var(--wf-gray-200);
    --sb-active-bg:      var(--wf-blue-100);
    --sb-active-bar:    var(--wf-blue-500);
    --sb-focus-ring:    var(--wf-blue-500);
    --sb-item-h:        2.25rem;
    --sb-item-radius:   6px;
    --sb-icon-size:     0.9375rem;
    --sb-icon-gap:      0.625rem;
    --sb-font-size:     0.875rem;
}

/* --- Container ---------------------------------------------- */
.nav-scrollable {
    background: var(--sb-bg);
}

/* --- Nav items wrapper -------------------------------------- */
.nav-scrollable nav {
    display: flex;
    flex-direction: column;
    padding: 0.125rem 0 0.5rem;
}

/* --- Individual items --------------------------------------- */
.nav-scrollable .nav-item {
    padding: 1px 0.5rem;
}

.nav-scrollable .nav-item .wf-nav-link {
    /* Layout */
    display: flex;
    align-items: center;
    gap: var(--sb-icon-gap);
    width: 100%;
    height: var(--sb-item-h);
    padding: 0 0.625rem;
    /* Typography */
    font-size: var(--sb-font-size);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
    /* Appearance */
    color: var(--sb-text);
    background: transparent;
    border: none;
    border-radius: var(--sb-item-radius);
    position: relative;
    /* Motion */
    transition: background 0.15s, color 0.15s;
}

.nav-scrollable .nav-item .wf-nav-link:hover {
    background: var(--sb-hover-bg);
    color: var(--sb-text-hover);
    text-decoration: none;
}

.nav-scrollable .nav-item .wf-nav-link:focus-visible {
    outline: 2px solid var(--sb-focus-ring);
    outline-offset: -2px;
    color: var(--sb-text-hover);
    text-decoration: none;
}

.nav-scrollable .nav-item .wf-nav-link.active {
    background: var(--sb-active-bg);
    color: var(--sb-text-active);
    font-weight: 600;
    text-decoration: none;
}

/* Active left bar indicator */
.nav-scrollable .nav-item .wf-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0.875rem;
    background: var(--sb-active-bar);
    border-radius: 0 2px 2px 0;
}

/* --- Icon --------------------------------------------------- */
/* Override Bootstrap's .bi rules that set width/margin/top */
.nav-scrollable .nav-item .wf-nav-link .bi {
    font-size: var(--sb-icon-size);
    flex-shrink: 0;
    display: inline-block;
    /* Reset Bootstrap defaults */
    width: auto;
    height: auto;
    margin: 0;
    position: static;
    top: auto;
    background-size: auto;
    opacity: 0.55;
}

.nav-scrollable .nav-item .wf-nav-link:hover .bi,
.nav-scrollable .nav-item .wf-nav-link.active .bi {
    opacity: 1;
}

/* --- Collapsed state ---------------------------------------- */
.nav-scrollable .nav-item .wf-nav-link.collapsed-item {
    justify-content: center;
    padding: 0;
    gap: 0;
    height: var(--sb-item-h);
}

.nav-scrollable .nav-item .wf-nav-link.collapsed-item .bi {
    font-size: 1.0625rem;
}

/* --- Mobile ------------------------------------------------- */
@media (max-width: 640px) {
    .nav-scrollable .nav-item .wf-nav-link {
        height: 2.5rem;
        font-size: 0.875rem;
    }
}

/* --- Reduced Motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .nav-scrollable .nav-item .wf-nav-link {
        transition: none;
    }
}
