/* ===== SIDEBAR COMPONENT STYLES ===== */

/* Coming Soon Badge Styles */
.coming-soon {
    position: relative;
    opacity: 0.7;
    cursor: pointer;
}

.coming-soon-badge {
    position: absolute;
    top: -2px;
    right: 8px;
    background: var(--warning-color);
    color: white;
    font-size: 8px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coming-soon:hover {
    opacity: 0.9;
}

.coming-soon .nav-text {
    position: relative;
}

.sidebar-component {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: visible;
    width: var(--sidebar-width);
    z-index: 1001;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.1);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* CSMS */
    font-size: 14px; /* CSMS */
    font-weight: 200; /* CSMS */
}

.sidebar-component:hover {
    width: var(--sidebar-expanded-width);
}

/* Auto-collapse categories when sidebar is not hovered */
.sidebar-component:not(:hover) .nav-category-items {
    max-height: 0 !important;
    opacity: 0 !important;
    display: none !important;
    transition: max-height 0.2s ease, opacity 0.2s ease !important;
}

.sidebar-component:not(:hover) .nav-category-header {
    /* Reset any expanded states when sidebar collapses */
}

.sidebar-component:not(:hover) .nav-category-header .nav-chevron {
    transform: rotate(180deg) !important;
    transition: transform 0.2s ease !important;
}

/* Ensure smooth transitions when hovering back */
.sidebar-component:hover .nav-category-items {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.sidebar-component:hover .nav-category-header .nav-chevron {
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand {
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand .brand-logo {
    width: 120px;
    height: auto;
    max-height: 40px;
}

/* Logo switching based on sidebar state */
.brand-logo-collapsed {
    display: block;
    width: 24px;
    height: 24px;
}

.brand-logo-full {
    display: none;
}

.sidebar-component:hover .brand-logo-collapsed {
    display: none;
}

.sidebar-component:hover .brand-logo-full {
    display: block;
}

.sidebar-component:hover .sidebar-brand {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem; /* CSMS spacing */
    margin: 0;
    border-radius: 0;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    min-height: 48px; /* CSMS height */
    height: 48px; /* CSMS height */
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.sidebar-component:hover .nav-item {
    justify-content: flex-start;
    padding: 0.875rem 0.75rem;
    width: 100%;
    min-width: 200px;
}

.nav-item:hover {
    background: rgba(107, 114, 128, 0.2); /* CSMS hover */
    color: #ffffff;
    text-decoration: none;
}

.nav-item.active {
    background: #4d1bb84d; /* CSMS active bg */
    color: #ffffff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 100%; /* full height marker like CSMS */
    background: #4d1bb8; /* CSMS primary */
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 1.1rem; /* CSMS */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff; /* CSMS */
}

/* Ensure FA icons inside links are white like CSMS */
.nav-item .fas,
.nav-item .nav-icon {
    color: #ffffff;
    width: 20px; /* CSMS */
    height: 20px; /* CSMS */
}

.nav-text {
    margin-left: 0.75rem;
    font-weight: 200; /* CSMS light */
    font-size: 0.875rem;
    color: #ffffff; /* CSMS */
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: var(--transition);
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    white-space: nowrap;
}

.sidebar-component:hover .nav-text {
    opacity: 1;
    width: auto;
}

/* ===== NAVIGATION CATEGORIES ===== */
.nav-category {
    margin: 0;
    border: none;
}

.nav-category-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    margin: 0;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    min-height: 48px;
    height: 48px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    background: transparent;
    border: none;
}

.sidebar-component:hover .nav-category-header {
    justify-content: flex-start;
    padding: 0.875rem 0.75rem;
    width: 100%;
    min-width: 200px;
}

.nav-category-header:hover {
    background: rgba(107, 114, 128, 0.2);
    color: #ffffff;
}

.nav-category-header.active {
    background: #4d1bb84d;
    color: #ffffff;
}

.nav-category-header.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 100%;
    background: #4d1bb8;
    border-radius: 0 2px 2px 0;
}

.nav-category-header .nav-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-component:hover .nav-category-header .nav-chevron {
    opacity: 1;
    width: auto;
}

/* Show chevron when category is expanded even in collapsed sidebar */
.nav-category-header:not(.collapsed) .nav-chevron {
    opacity: 1;
    width: auto;
}

.nav-category-header.collapsed .nav-chevron {
    transform: rotate(180deg);
}

/* ===== NAVIGATION SUB-ITEMS ===== */
.nav-category-items {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.nav-category-items.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Ensure sub-items are hidden when collapsed, even in collapsed sidebar */
.sidebar-component .nav-category-items.collapsed {
    max-height: 0;
    opacity: 0;
    display: none;
}

.sidebar-component:hover .nav-category-items.collapsed {
    display: block;
    max-height: 0;
    opacity: 0;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem 0.5rem 2rem;
    margin: 0;
    border-radius: 0;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    min-height: 40px;
    height: 40px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    font-size: 0.8rem;
    border-left: 2px solid transparent;
}

.sidebar-component:hover .nav-sub-item {
    justify-content: flex-start;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    width: 100%;
    min-width: 200px;
}

.nav-sub-item:hover {
    background: rgba(107, 114, 128, 0.15);
    color: #ffffff;
    border-left-color: rgba(77, 27, 184, 0.5);
}

.nav-sub-item.active {
    background: rgba(77, 27, 184, 0.2);
    color: #ffffff;
    border-left-color: #4d1bb8;
}

.nav-sub-item .nav-text {
    margin-left: 0.5rem;
    font-weight: 200;
    font-size: 0.8rem;
    color: inherit;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: var(--transition);
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    white-space: nowrap;
}

.sidebar-component:hover .nav-sub-item .nav-text {
    opacity: 1;
    width: auto;
}

.sidebar-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-version {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: var(--transition);
}

.sidebar-component:hover .sidebar-version {
    opacity: 1;
}

/* Mobile sidebar */
@media (max-width: 768px) {
    .sidebar-component {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar-component.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-component:hover {
        width: var(--sidebar-width);
    }
    
    .sidebar-component.mobile-open:hover {
        width: var(--sidebar-expanded-width);
    }
}
