/* =============================================
   SIDEBAR / NAV MENU STYLES
   ============================================= */

.sidebar-container {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* Subtle branch aura at sidebar bottom */
.sidebar-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: radial-gradient(ellipse at bottom, rgba(220, 38, 38, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-container.hajipur-nav::after {
    background: radial-gradient(ellipse at bottom, rgba(4, 5, 171, 0.04) 0%, transparent 70%);
}

body.sidebar-collapsed .sidebar-container {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    transform: none;
}

/* ---- Logo (Concept 4: Prestige Fusion Animation) ---- */

.logo-area {
    width: 260px;
    height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-bottom: 1px solid #f1f5f9;
    padding: 10px;
    position: relative;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Continuous breathing backlight aura — Rakanpur (Ruby) */
.logo-area::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.02) 45%, transparent 70%);
    pointer-events: none;
    animation: logoAuraBreath 5s ease-in-out infinite alternate;
}

/* Continuous breathing backlight aura — Hajipur (Sapphire) */
.hajipur-nav .logo-area::before {
    background: radial-gradient(ellipse at center, rgba(4, 5, 171, 0.08) 0%, rgba(4, 5, 171, 0.02) 45%, transparent 70%);
    animation: logoAuraBreath 5s ease-in-out infinite alternate;
}

@keyframes logoAuraBreath {
    0% {
        opacity: 0.45;
        transform: scale(0.92);
    }
    100% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.logo-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover: Micro-Elevation & Soft Branch Aura Glow */
.logo-area:hover .logo-wrapper {
    transform: translateY(-2px) scale(1.025);
    filter: drop-shadow(0 6px 14px rgba(220, 38, 38, 0.22));
}

.hajipur-nav .logo-area:hover .logo-wrapper {
    filter: drop-shadow(0 6px 14px rgba(4, 5, 171, 0.22));
}

/* Specular Light Sheen overlay */
.logo-sheen {
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0) 70%,
        transparent 100%
    );
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 2;
    animation: logoSheenPeriodic 9s ease-in-out infinite;
}

@keyframes logoSheenPeriodic {
    0%, 82% {
        left: -120%;
    }
    92%, 100% {
        left: 200%;
    }
}

.logo-area:hover .logo-sheen {
    animation: logoSheenSweep 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logoSheenSweep {
    0% {
        left: -120%;
    }
    100% {
        left: 200%;
    }
}

.logo-img {
    object-fit: contain;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-img.logo-full {
    display: block;
    width: 136px;
    height: 100px;
}

.logo-img.logo-mini {
    display: none;
}

body.sidebar-collapsed .logo-area {
    width: 70px;
    height: 70px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.sidebar-collapsed .logo-wrapper {
    max-width: 54px;
    max-height: 54px;
    padding: 2px;
}

body.sidebar-collapsed .logo-img.logo-full {
    display: none !important;
}

body.sidebar-collapsed .logo-img.logo-mini {
    display: block !important;
    max-width: 46px;
    max-height: 46px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* ---- Menu wrapper ---- */

.menu-items-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .menu-items-wrapper {
    padding: 16px 8px;
    gap: 8px;
    align-items: center;
}

body.sidebar-collapsed .nav-item {
    width: 100%;
    display: flex;
    justify-content: center;
}

.menu-items-wrapper::-webkit-scrollbar { width: 4px; }
.menu-items-wrapper::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 2px;
}

/* =============================================
   MAIN NAV ITEM (shared base for <a> and <button>)
   ============================================= */

.menu-item-link {
    display: flex;
    align-items: center;
    padding: 0 14px 0 10px;
    color: #475569;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    border-radius: 9px;
    border: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 40px;
    height: 42px;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

body.sidebar-collapsed .menu-item-link {
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 9px;
    margin: 0 auto;
}

/* Remove active indicator dot in collapsed mode so it does not overlap the icon */
body.sidebar-collapsed .menu-item-link::after,
body.sidebar-collapsed .menu-item-link.nav-active::after {
    display: none !important;
}

/* Hover: Velvet smooth elevation with inner border light */
.menu-item-link:hover:not(.nav-active) {
    background-color: #F8FAFC;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.85), 0 2px 6px rgba(0, 0, 0, 0.02);
    color: #0F172A;
    transform: translateX(2px);
}

body.sidebar-collapsed .menu-item-link:hover:not(.nav-active) {
    transform: none;
}

/* ==========================================================================
   ACTIVE STATE — Santej / Rakanpur (Ruby Satin Glass Depth)
   Dual-tone bevel icon tile + floating jewel bar + specular top light
   ========================================================================== */

.menu-item-link.nav-active {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.09) 0%, rgba(220, 38, 38, 0.03) 100%) !important;
    color: #DC2626 !important;
    border-radius: 9px !important;
    font-weight: 600 !important;
    position: relative;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.9), 
        inset 0 0 0 1px rgba(220, 38, 38, 0.14), 
        0 2px 8px rgba(220, 38, 38, 0.08) !important;
}

/* Floating jewel bar on left */
.menu-item-link.nav-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3.5px;
    background: linear-gradient(180deg, #DC2626 0%, #B91C1C 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.45);
}

/* Right-side active jewel accent dot (non-collapse items) */
.menu-item-link.nav-active:not(.menu-collapse-btn)::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #DC2626;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.5);
}

/* Precision Dual-Tone Active Icon Tile */
.menu-item-link.nav-active .menu-icon {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%) !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(220, 38, 38, 0.22),
        0 2px 6px rgba(220, 38, 38, 0.16) !important;
}

.menu-item-link.nav-active .menu-icon svg {
    stroke: #DC2626 !important;
    fill: none;
}

.menu-item-link.nav-active .menu-icon svg.fill-icon {
    fill: #DC2626 !important;
    stroke: none;
}

/* Santej active icon — turn red */
.menu-item-link.nav-active .nav-icon {
    filter: invert(16%) sepia(94%) saturate(7440%) hue-rotate(357deg) brightness(98%) contrast(115%) !important;
}

.menu-item-link.nav-active .expand-icon {
    color: #DC2626 !important;
}

/* =============================================
   ICON TILES (Precision 30x30px Beveled Tiles)
   ============================================= */

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    margin-right: 11px;
    flex-shrink: 0;
    background-color: #F8FAFC;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-item-link:hover:not(.nav-active) .menu-icon {
    background-color: #FFFFFF;
    box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.9), 0 2px 5px rgba(0, 0, 0, 0.04);
}

.menu-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #64748B;
    stroke-width: 1.8;
    transition: stroke 0.2s ease;
}

.menu-item-link:hover:not(.nav-active) .menu-icon svg {
    stroke: #0F172A;
}

.menu-icon svg.fill-icon {
    fill: #64748B;
    stroke: none;
}

/* SVG img icon */
.nav-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
    filter: none;
    transition: all 0.2s ease;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    max-width: 180px;
    transition: opacity 0.2s ease, max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   EXPAND CHEVRON  (Reports collapse)
   ============================================= */

.expand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: auto;
    flex-shrink: 0;
    color: #777777;
}

.expand-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    transition: transform 0.2s ease;
}

/* chevron rotates up when open */
.expand-icon.expanded svg {
    transform: rotate(180deg);
}

/* =============================================
   SUB-MENU ITEMS
   ============================================= */

.menu-sub-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 0 6px 14px;
    margin-left: 23px;
    border-left: 1.5px solid #E2E8F0;
    position: relative;
}

body.sidebar-collapsed .menu-icon {
    margin-right: 0 !important;
    width: 28px;
    height: 28px;
}

body.sidebar-collapsed .nav-icon {
    width: 18px;
    height: 18px;
}

body.sidebar-collapsed .menu-text {
    opacity: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    pointer-events: none !important;
}

body.sidebar-collapsed .expand-icon {
    display: none !important;
}

body.sidebar-collapsed .menu-sub-items {
    display: none !important;
}

.menu-sub-link {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    color: #64748B;
    text-decoration: none !important;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 6px;
    line-height: 1.3;
    transition: all 0.18s ease;
}

.menu-sub-link:hover:not(.menu-sub-active) {
    color: #0F172A;
    transform: translateX(2px);
    background-color: #F8FAFC;
}

/* Selected sub-item — branch color text */
.menu-sub-link.menu-sub-active {
    color: #DC2626 !important;
    font-weight: 700;
    background-color: #FEF2F2 !important;
}

.hajipur-nav .menu-sub-link.menu-sub-active {
    color: #0405AB !important;
    font-weight: 700;
    background-color: #EEF2FF !important;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .sidebar-container {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .logo-area { margin: 0 auto; }
    .menu-items-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px;
        gap: 6px;
    }
    .menu-item-link {
        height: auto;
        padding: 6px 12px;
        line-height: 1.5;
    }
}

/* ==========================================================================
   ACTIVE STATE — HAJIPUR (Sapphire Satin Glass Depth)
   Dual-tone bevel icon tile + floating jewel bar + specular top light
   ========================================================================== */

.hajipur-nav .menu-item-link.nav-active {
    background: linear-gradient(135deg, rgba(4, 5, 171, 0.09) 0%, rgba(4, 5, 171, 0.03) 100%) !important;
    color: #0405AB !important;
    border-radius: 9px !important;
    font-weight: 600 !important;
    position: relative;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.9), 
        inset 0 0 0 1px rgba(4, 5, 171, 0.14), 
        0 2px 8px rgba(4, 5, 171, 0.08) !important;
}

/* Floating sapphire jewel bar on left */
.hajipur-nav .menu-item-link.nav-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3.5px;
    background: linear-gradient(180deg, #0405AB 0%, #1A2DB5 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(4, 5, 171, 0.45);
}

/* Right-side active sapphire accent dot (non-collapse items) */
.hajipur-nav .menu-item-link.nav-active:not(.menu-collapse-btn)::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #0405AB;
    box-shadow: 0 0 6px rgba(4, 5, 171, 0.5);
}

/* Precision Dual-Tone Active Icon Tile for Hajipur */
.hajipur-nav .menu-item-link.nav-active .menu-icon {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%) !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(4, 5, 171, 0.22),
        0 2px 6px rgba(4, 5, 171, 0.16) !important;
}

.hajipur-nav .menu-item-link.nav-active .menu-icon svg {
    stroke: #0405AB !important;
    fill: none !important;
}

.hajipur-nav .menu-item-link.nav-active .menu-icon svg.fill-icon {
    fill: #0405AB !important;
    stroke: none !important;
}

.hajipur-nav .menu-item-link.nav-active .expand-icon {
    color: #0405AB !important;
}

/* Hajipur active icon — turn purple/dark-blue */
.hajipur-nav .menu-item-link.nav-active .nav-icon {
    filter: invert(12%) sepia(97%) saturate(5412%) hue-rotate(242deg) brightness(85%) contrast(125%) !important;
}

.hajipur-nav .menu-item-link:hover:not(.nav-active) {
    background-color: #F8FAFC;
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.85), 0 2px 6px rgba(0, 0, 0, 0.02);
    color: #0F172A;
    transform: translateX(2px);
}

body.sidebar-collapsed .menu-item-link:hover:not(.nav-active) {
    transform: none;
}

/* ==========================================================================
   COLLAPSED NAVMENU ACCENT DOT REMOVAL (BOTH BRANCHES)
   Ensure the right-side active accent dot is NEVER rendered in collapsed mode
   ========================================================================== */
body.sidebar-collapsed .menu-item-link::after,
body.sidebar-collapsed .menu-item-link.nav-active::after,
body.sidebar-collapsed .hajipur-nav .menu-item-link::after,
body.sidebar-collapsed .hajipur-nav .menu-item-link.nav-active::after,
.sidebar-container.collapsed .menu-item-link::after,
.sidebar-container.collapsed .menu-item-link.nav-active::after,
.sidebar-collapsed .menu-item-link::after,
.sidebar-collapsed .menu-item-link.nav-active::after {
    display: none !important;
    content: none !important;
}


