/* Mobile Bottom Tab Bar */
.mobile-bottom-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    display: none;
    background: white;
    border-top: 1px solid #E5E7EB;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Show only on mobile screens AND when running as standalone app (added to home screen) */
/* TEMPORARY: Showing on all mobile for testing - restore media query for production */
@media (max-width: 991.98px) {
    .mobile-bottom-tabbar {
        display: flex;
    }
    
    /* Add padding to content to prevent overlap with bottom tab bar */
    #content {
        padding-bottom: calc(65px + env(safe-area-inset-bottom));
    }
    
    /* Hide sidebar on mobile when tab bar is shown */
    #sidebar {
        display: none !important;
    }
    
    /* Hide sidebar toggle button */
    #mobileSidebarToggle {
        display: none !important;
    }
    
    /* Expand content to full width */
    #content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Hide desktop user dropdown */
    .user-dropdown {
        display: none !important;
    }
    
    /* Make search container full width on mobile */
    #searchContainer {
        display: block !important;
        flex: 1 !important;
        max-width: none !important;
    }
    
    /* Show shortcuts next to search */
    #mobileShortcutsToggle {
        display: block !important;
    }
}

/* Original production CSS - uncomment for production, comment out above media query */
/* @media (max-width: 991.98px) and (display-mode: standalone) {
    .mobile-bottom-tabbar {
        display: flex;
    }
    
    #content {
        padding-bottom: calc(65px + env(safe-area-inset-bottom));
    }
    
    #sidebar {
        display: none !important;
    }
    
    #mobileSidebarToggle {
        display: none !important;
    }
    
    #content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .user-dropdown {
        display: none !important;
    }
    
    #searchContainer {
        display: block !important;
        flex: 1 !important;
        max-width: none !important;
    }
    
    #mobileShortcutsToggle {
        display: block !important;
    }
} */

/* iOS-specific standalone mode detection */
@media (max-width: 991.98px) {
    @supports (-webkit-touch-callout: none) {
        .mobile-bottom-tabbar.ios-standalone {
            display: flex;
        }
        
        body.ios-standalone #content {
            padding-bottom: calc(65px + env(safe-area-inset-bottom));
        }
        
        body.ios-standalone #sidebar {
            display: none !important;
        }
        
        body.ios-standalone #mobileSidebarToggle {
            display: none !important;
        }
        
        body.ios-standalone #content {
            margin-left: 0 !important;
            width: 100% !important;
        }
        
        body.ios-standalone .user-dropdown {
            display: none !important;
        }
        
        body.ios-standalone #searchContainer {
            display: block !important;
            flex: 1 !important;
            max-width: none !important;
        }
        
        body.ios-standalone #mobileShortcutsToggle {
            display: block !important;
        }
    }
}

/* Tab bar container */
.tabbar-container {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
    height: 56px;
}

/* Individual tab item */
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #6B7280 !important;
    transition: all 0.2s ease;
    position: relative;
    padding: 10px 4px;
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: none;
}

.tab-item:hover,
.tab-item:active,
.tab-item:visited,
.tab-item:focus,
.tab-item:link {
    text-decoration: none !important;
    background: none;
    color: #6B7280 !important;
    outline: none;
}

.tab-item i {
    font-size: 24px;
    transition: all 0.2s ease;
    color: #6B7280 !important;
}

/* Active tab state */
.tab-item.active {
    color: #6366F1 !important;
}

.tab-item.active i {
    transform: scale(1.1);
    color: #6366F1 !important;
}

/* Hover state for non-active tabs */
.tab-item:hover:not(.active) {
    color: #6B7280 !important;
}

.tab-item:hover:not(.active) i {
    color: #6B7280 !important;
}

/* Tap effect */
.tab-item:active {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Badge for notifications */
.tab-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 16px);
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* Ripple effect on tap */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.tab-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.tab-item:active::before {
    animation: ripple 0.6s ease-out;
}

/* Responsive adjustments */
@media (max-width: 374px) {
    .tab-item i {
        font-size: 22px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-tabbar {
        background: #1F2937;
        border-top-color: #374151;
    }
    
    .tab-item {
        color: #9CA3AF;
    }
    
    .tab-item.active {
        color: #818CF8;
    }
}
