/**
 * Mobile Navigation Styles
 * Enhanced navigation and menu systems for mobile devices
 * Requirements: 2.1, 2.2, 2.3, 2.4
 */

/* Enhanced Menu Transitions and Animations */
.menu-overlay {
    transition: all 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.menu-item {
    transition: all 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.menu-item.mobile-active {
    transform: scale(0.98) !important;
    opacity: 0.8 !important;
    transition: transform 0.1s ease, opacity 0.1s ease !important;
}

/* Enhanced Menu Back Button */
.menu-back {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.menu-back:active {
    transform: scale(0.9) rotate(-10deg) !important;
}

/* Mobile-Optimized Tab Navigation */
.mobile-optimized-tabs {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.mobile-optimized-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.mobile-tab {
    transition: all 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.mobile-tab:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    z-index: 10;
}

.mobile-tab.touch-active {
    transform: scale(0.95);
    background-color: var(--accent);
    color: var(--primary);
}

/* Tab Scroll Indicators */
.tab-scroll-wrapper {
    position: relative;
    overflow: visible;
}

.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: bold;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.scroll-indicator.left {
    left: -16px;
}

.scroll-indicator.right {
    right: -16px;
}

.scroll-indicator:hover,
.scroll-indicator:focus {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.scroll-indicator:active {
    transform: translateY(-50%) scale(0.95);
}

/* Breadcrumb Navigation */
.breadcrumb-container {
    margin-top: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    background: rgba(26, 26, 26, 0.5);
    backdrop-filter: blur(10px);
}

.breadcrumb-nav {
    width: 100%;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    font-family: var(--font-primary);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.breadcrumb-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    font-size: inherit;
    font-family: inherit;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    min-height: 32px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus {
    background-color: var(--bg-card);
    outline: none;
    color: var(--secondary);
    transform: translateY(-1px);
}

.breadcrumb-link:active {
    transform: translateY(0);
    background-color: var(--accent);
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 1rem;
    opacity: 0.6;
}

.breadcrumb-item.current {
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* Enhanced Touch Feedback */
.touch-active {
    transform: scale(0.98) !important;
    opacity: 0.8 !important;
    transition: transform 0.1s ease, opacity 0.1s ease !important;
}

/* Keyboard Navigation Focus Styles */
.nav-tab:focus,
.menu-item:focus,
.breadcrumb-link:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    z-index: 10;
}

.menu-item:focus .menu-link {
    color: var(--accent);
}

/* Swipe Gesture Indicators */
.swipe-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.swipe-hint.show {
    opacity: 0.8;
}

/* Mobile-Specific Responsive Styles */
@media (max-width: 768px) {
    .breadcrumb-container {
        margin-top: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .breadcrumb-item {
        font-size: 0.75rem;
    }
    
    .breadcrumb-link {
        padding: 0.25rem 0.5rem;
        min-height: 36px;
        font-size: 0.75rem;
    }
    
    .breadcrumb-item.current {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .scroll-indicator {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .scroll-indicator.left {
        left: -14px;
    }
    
    .scroll-indicator.right {
        right: -14px;
    }
    
    /* Enhanced menu animations for mobile */
    .menu-item {
        min-height: 60px;
    }
    
    .menu-link {
        padding: 1rem;
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }
    
    /* Mobile tab improvements */
    .nav-tab {
        min-height: 48px;
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }
    
    .nav-tab:focus {
        outline-width: 3px;
        outline-offset: 3px;
    }
}

@media (max-width: 480px) {
    .breadcrumb-list {
        gap: 0.25rem;
    }
    
    .breadcrumb-item {
        font-size: 0.6875rem;
    }
    
    .breadcrumb-link {
        padding: 0.125rem 0.375rem;
        min-height: 32px;
        font-size: 0.6875rem;
    }
    
    .breadcrumb-item.current {
        padding: 0.125rem 0.375rem;
        font-size: 0.6875rem;
    }
    
    .breadcrumb-separator {
        font-size: 0.875rem;
    }
    
    .scroll-indicator {
        width: 24px;
        height: 24px;
        font-size: 0.875rem;
    }
    
    .scroll-indicator.left {
        left: -12px;
    }
    
    .scroll-indicator.right {
        right: -12px;
    }
    
    /* Smaller nav tabs for very small screens */
    .nav-tab {
        min-height: 44px;
        font-size: 0.6875rem;
        padding: 0.5rem 0.25rem;
    }
    
    /* Optimize breadcrumbs for small screens */
    .breadcrumb-container {
        padding: 0.25rem 0;
    }
    
    .breadcrumb-list {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0.25rem;
    }
    
    .breadcrumb-list::-webkit-scrollbar {
        display: none;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .breadcrumb-container {
        margin-top: 0.25rem;
        padding: 0.25rem 0;
    }
    
    .breadcrumb-item {
        font-size: 0.6875rem;
    }
    
    .breadcrumb-link {
        padding: 0.125rem 0.375rem;
        min-height: 28px;
    }
    
    .menu-item {
        min-height: 50px;
    }
    
    .menu-link {
        font-size: clamp(1rem, 4vh, 2rem);
        padding: 0.5rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .breadcrumb-link {
        border: 1px solid currentColor;
    }
    
    .breadcrumb-link:focus {
        outline-width: 3px;
    }
    
    .scroll-indicator {
        border-width: 2px;
    }
    
    .nav-tab:focus {
        outline-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .menu-overlay,
    .menu-item,
    .mobile-tab,
    .breadcrumb-link,
    .scroll-indicator {
        transition: none;
    }
    
    .menu-marquee .marquee-content {
        animation: none;
    }
    
    .mobile-optimized-tabs {
        scroll-behavior: auto;
    }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .breadcrumb-container {
        background: rgba(10, 10, 10, 0.8);
    }
    
    .scroll-indicator {
        background: var(--bg-secondary);
        border-color: var(--border);
    }
}

/* Print Styles */
@media print {
    .breadcrumb-container,
    .scroll-indicator,
    .swipe-hint {
        display: none;
    }
}