﻿/* Modern Sidebar Styles */
@keyframes sidebar-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.modern-sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    width: 72px;
}

    .modern-sidebar.collapsed,
    .modern-sidebar.expanded {
        width: 72px;
    }

/* Sidebar Header - Hide since not needed */
.sidebar-header {
    display: none;
}

.sidebar-toggle-btn {
    display: none;
}

/* Menu Container */
.sidebar-menu-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
}

    .sidebar-menu-container::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-menu-container::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-menu-container::-webkit-scrollbar-thumb {
        background: #BFD9F9;
        border-radius: 2px;
    }

        .sidebar-menu-container::-webkit-scrollbar-thumb:hover {
            background: #9ca3af;
        }

/* Root Menu Items */
.root-menu-item {
    margin-bottom: 6px;
    position: relative;
}

.root-menu-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: transparent;
    border-radius: 14px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: visible;
    margin: 0 auto;
}

    .root-menu-btn:hover {
        background: #f3f4f6;
        color: #111827;
        transform: translateY(-2px);
    }

.root-menu-item.active .root-menu-btn {
    background: #3F9AE0;
    color: #374151;
    box-shadow: 0 4px 12px rgba(63, 154, 224, 0.4);
}

.root-menu-item.active .root-menu-icon {
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.root-menu-item.active .root-menu-icon .menu-icon-svg {
    filter: none;
}

.root-menu-item.active .root-menu-icon i {
    color: #374151;
}

.root-menu-item.expanded .root-menu-btn {
    background: #e8f2fc;
    color: #3F9AE0;
}

.root-menu-item.active.expanded .root-menu-btn {
    background: #3F9AE0;
    color: #374151;
    box-shadow: 0 4px 12px rgba(63, 154, 224, 0.4);
}

/* ============================================
   MENU ICON - ENHANCED VERSION
   ============================================ */
.root-menu-icon {
    width: 24px;
    height: 24px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    position: relative;
}

    .root-menu-icon i {
        display: block !important;
        font-size: 20px;
        line-height: 1;
        font-family: "Font Awesome 6 Free" !important;
        font-weight: 900 !important;
    }

        .root-menu-icon i:before {
            font-family: "Font Awesome 6 Free" !important;
            font-weight: 900;
            display: inline-block;
        }

.menu-icon-svg {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Menu Text - ALWAYS HIDDEN in icon-only mode */
.root-menu-text {
    display: none !important;
}

/* Badge */
.root-menu-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.root-menu-item.active .root-menu-badge {
    background: #ffffff;
    color: #3F9AE0;
}

/* Submenu Panel */
.submenu-panel {
    position: fixed;
    left: 72px;
    top: 64px;
    width: 280px;
    height: calc(100vh - 64px);
    background: #ffffff;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
}

    .submenu-panel.show {
        transform: translateX(0);
        opacity: 1;
    }

.submenu-panel-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafbfc;
}

    .submenu-panel-header h3 {
        font-size: 16px;
        font-weight: 600;
        color: #111827;
        margin: 0;
    }

.submenu-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .submenu-close-btn:hover {
        background: #f3f4f6;
        color: #111827;
    }

    .submenu-close-btn i {
        display: block !important;
    }

/* Submenu Search */
.submenu-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    background: #fafbfc;
}

.submenu-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
}

    .submenu-search-icon i {
        display: block !important;
    }

.submenu-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    transition: all 0.2s;
    background: #ffffff;
}

    .submenu-search-input:focus {
        outline: none;
        border-color: #3F9AE0;
        box-shadow: 0 0 0 3px rgba(63, 154, 224, 0.1);
    }

    .submenu-search-input::placeholder {
        color: #9ca3af;
    }

/* Submenu Content */
.submenu-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

    .submenu-content::-webkit-scrollbar {
        width: 4px;
    }

    .submenu-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .submenu-content::-webkit-scrollbar-thumb {
        background: #BFD9F9;
        border-radius: 2px;
    }

/* Submenu Items */
.submenu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.submenu-item {
    margin-bottom: 0;
}

.submenu-item-btn {
    width: 100%;
    min-height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    font-family: inherit;
}

    .submenu-item-btn:hover {
        background: #f3f4f6;
        color: #111827;
    }

.submenu-item.active > .submenu-item-btn {
    background: #3F9AE0;
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
}

.submenu-item-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

    .submenu-item-icon i {
        display: block !important;
    }

.submenu-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.submenu-item-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.submenu-item-chevron {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-size: 11px;
    flex-shrink: 0;
}

    .submenu-item-chevron i {
        display: block !important;
    }

.submenu-item.expanded .submenu-item-chevron {
    transform: rotate(180deg);
}

/* Submenu Children */
.submenu-children {
    padding-left: 16px;
    margin-top: 2px;
}

    .submenu-children .submenu-children {
        padding-left: 0;
    }

    .submenu-children .submenu-item-btn {
        min-height: 36px;
        font-size: 12px;
    }

/* Overlay */
.submenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 998;
    backdrop-filter: none;
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .modern-sidebar {
        transform: translateX(-100%);
    }

        .modern-sidebar.expanded {
            transform: translateX(0);
            width: 72px;
        }

    .submenu-panel {
        left: 72px;
        width: calc(100vw - 72px);
        max-width: 320px;
    }
}
