/* Enhanced Navigation Styles */

/* Sidebar States - Collapsed shows 60px icon strip, expanded shows full 260px */

/* When collapsed, hide labels and show only icon strip */
.tabs.collapsed .tab-label,
.tabs.collapsed .sidebar-user-info span,
.tabs.collapsed .sidebar-user-arrow {
    display: none;
}

.tabs.collapsed .sidebar-header {
    overflow: visible;
}

.tabs.collapsed #app-title {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    text-align: center;
    overflow: visible;
    max-width: none;
}

.tabs.collapsed .sidebar-collapse-btn {
    width: 100%;
    text-align: center;
    padding: 0.75rem;
}

.tabs.collapsed .sidebar-user-info {
    /* Maintain fixed position from top */
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    justify-content: center;
    padding: 0.5rem;
    width: auto;
    margin: 0;
}

.tabs.collapsed .tab {
    justify-content: center;
    padding: 0.75rem;
}

.tabs.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* Sidebar Header Enhancements */
.sidebar-header {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 140px; /* Fixed height to prevent content shift */
}

#app-title {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-user-info {
    position: absolute;
    top: 85px; /* Fixed distance from top - moved down for larger logo */
    left: 1rem;
    right: 1rem;
}

.sidebar-collapse-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-collapse-btn svg {
    transition: transform 0.3s ease;
}

/* Logo visibility based on sidebar state */
.tabs #sidebar-logo-expanded {
    display: block;
    height: 50px;
    width: auto;
}

.tabs #sidebar-logo-collapsed {
    display: none;
}

.tabs.collapsed #sidebar-logo-expanded {
    display: none;
}

.tabs.collapsed #sidebar-logo-collapsed {
    display: block;
    margin: 0 auto;
    height: 50px;
    width: auto;
    max-width: none;
}



/* Navigation Bottom */
.nav-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tab Enhancements */
.tab {
    position: relative;
}

.tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.tab.active::before {
    opacity: 1;
}

/* Badge/Count indicators for future use */
.nav-badge {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.tabs.collapsed .nav-badge {
    top: 0.5rem;
    right: 0.5rem;
    transform: none;
}

/* Desktop Styles */
@media (min-width: 769px) {
    /* Adjust main content when sidebar is collapsed */
    .tabs.collapsed ~ .main-content {
        margin-left: 60px;
    }
    
    /* Smoother transitions on desktop */
    .tabs,
    .main-content {
        transition: all 0.3s ease;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Nav section styles for mobile (if sections exist) */
    .nav-section-content {
        max-height: none;
    }
    
    .nav-section.collapsed .nav-section-content {
        max-height: none;
    }
    
    .nav-section-header {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
        pointer-events: none;
    }
    
    .nav-section-icon {
        display: none;
    }
    
    .nav-section-content .tab {
        padding-left: 1.5rem;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    /* No sidebar width changes - keep consistent */
}

/* Animation for section expand/collapse */
@keyframes expandSection {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

@keyframes collapseSection {
    from {
        max-height: 500px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

/* Hover effects for better UX */
.nav-section-header:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: -2px;
}

.tab:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: -2px;
}

/* Improved active state for nested tabs */
.nav-section-content .tab.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Scrollbar styling for long navigation */
.tabs {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.tabs::-webkit-scrollbar {
    width: 6px;
}

.tabs::-webkit-scrollbar-track {
    background: transparent;
}

.tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .tabs,
    .nav-section-content,
    .nav-section-icon,
    .sidebar-collapse-btn svg {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-section-header {
        border: 1px solid currentColor;
    }
    
    .tab.active {
        border: 2px solid currentColor;
    }
}
