/**
 * Enhanced Context-Aware Mobile Navigation Styles
 * Three-tier expandable navigation with visual hierarchy
 */

/* Context-aware navigation container */
.context-aware-nav {
    padding: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.context-aware-nav::-webkit-scrollbar {
    width: 4px;
}

.context-aware-nav::-webkit-scrollbar-track {
    background: transparent;
}

.context-aware-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.context-aware-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Navigation header with current section indicator */
.nav-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.current-section-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

.current-section-indicator i {
    font-size: 18px;
    color: #ffd700;
}

/* Platform sections */
.nav-section {
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-section.current-section {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.4);
}

/* Section headers */
.section-header {
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.section-title {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.section-title:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.section-title i:first-child {
    font-size: 16px;
    flex-shrink: 0;
}

.section-title span {
    flex-grow: 1;
}

.section-title .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

/* Expanded state */
.nav-section.expanded .toggle-icon {
    transform: rotate(180deg);
}

.nav-section.collapsed .section-content {
    display: none;
}

/* Section content */
.section-content {
    padding: 0 10px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 8px 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation items - Tier 2 (Section items) */
.nav-item.tier-2 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #e0e6ed;
    text-decoration: none;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.2s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid transparent;
}

.nav-item.tier-2:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(4px);
    border-left-color: #667eea;
}

.nav-item.tier-2.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    color: #ffffff;
    border-left-color: #ffd700;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-item.tier-2 i {
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Account submenu */
.account-submenu {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu-header {
    color: #b0b7c3;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 16px 8px;
    margin-bottom: 4px;
}

/* Navigation items - Tier 3 (Account items) */
.nav-item.tier-3 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #c0c7d0;
    text-decoration: none;
    border-radius: 4px;
    margin: 1px 0;
    transition: all 0.2s ease;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid transparent;
}

.nav-item.tier-3:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(3px);
    border-left-color: #a0a7b5;
}

.nav-item.tier-3 i {
    font-size: 13px;
    width: 14px;
    text-align: center;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Mobile nav content integration */
.mobile-nav-content {
    background: #1a1f36;
    min-height: 100%;
}

.mobile-nav-content .context-aware-nav {
    background: transparent;
}

/* Touch gesture support */
.nav-section {
    touch-action: manipulation;
    user-select: none;
}

.section-header {
    -webkit-tap-highlight-color: transparent;
}

/* Loading state */
.context-aware-nav.loading {
    position: relative;
}

.context-aware-nav.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive adjustments */
@media (max-height: 600px) {
    .nav-header {
        padding: 10px 20px;
    }
    
    .section-title {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .nav-item.tier-2 {
        padding: 10px 16px;
    }
    
    .nav-item.tier-3 {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-height: 500px) {
    .current-section-indicator {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 13px;
    }
    
    .submenu-header {
        font-size: 11px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .nav-header {
        background: linear-gradient(135deg, #0f1419 0%, #1a1f36 100%);
    }
    
    .mobile-nav-content {
        background: #0f1419;
    }
}

/* Accessibility improvements */
.nav-item:focus,
.section-header:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.nav-item[aria-current="page"] {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    border-left-color: #ffd700;
}

/* Animation preferences */
@media (prefers-reduced-motion: reduce) {
    .nav-section,
    .section-title,
    .nav-item,
    .toggle-icon {
        transition: none;
    }
    
    .section-content {
        animation: none;
    }
    
    .context-aware-nav.loading::before {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .nav-item.tier-2,
    .nav-item.tier-3 {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .nav-item.tier-2:hover,
    .nav-item.tier-3:hover {
        border-color: #ffffff;
    }
    
    .nav-item.tier-2.active {
        border-color: #ffd700;
        background: rgba(255, 215, 0, 0.2);
    }
}