/* 移动端导航适配样式 */

/* 底部导航栏样式 */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050; /* 提高z-index确保在最上层 */
    padding: 6px 0 8px 0; /* 调整内边距 */
    min-height: 65px; /* 设置最小高度 */
}

.mobile-bottom-nav .nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px; /* 添加左右内边距 */
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    padding: 2px 4px; /* 减小内边距 */
    max-width: 80px; /* 限制最大宽度 */
}

.mobile-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.65rem; /* 减小字体大小适应英文 */
    transition: all 0.2s ease;
    padding: 3px 2px; /* 减小内边距 */
    border-radius: 6px;
    line-height: 1.1; /* 调整行高 */
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden; /* 隐藏溢出内容 */
    text-overflow: ellipsis; /* 显示省略号 */
}

.mobile-bottom-nav .nav-link:hover,
.mobile-bottom-nav .nav-link.active {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.1rem; /* 减小图标大小 */
    margin-bottom: 1px; /* 减小图标与文字间距 */
}

.mobile-bottom-nav .nav-link span {
    font-size: 0.65rem; /* 确保文字大小一致 */
    max-width: 100%; /* 限制文字宽度 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 顶部导航移动端简化 */
@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* 为底部导航预留更多空间 */
    body {
        padding-bottom: 80px; /* 增加底部间距 */
    }
    
    /* 简化顶部导航 */
    .navbar .navbar-nav:not(#authNavItems) {
        display: none !important;
    }
    
    .navbar .navbar-toggler {
        display: none !important;
    }
    
    /* 确保认证导航在移动端始终显示 */
    .navbar #authNavItems {
        display: flex !important;
        margin-left: auto;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 只保留品牌和用户信息 */
    .navbar .container {
        justify-content: space-between;
        align-items: center;
        overflow: visible; /* 允许下拉菜单溢出容器 */
    }

    /* 确保导航栏在移动端有合适的高度 */
    .navbar {
        min-height: 56px; /* 减小导航栏高度 */
        padding-top: 6px;
        padding-bottom: 6px;
        overflow: visible; /* 允许下拉菜单溢出 */
    }

    .navbar-brand {
        font-size: 1rem; /* 减小品牌字体大小 */
        margin-right: 0;
    }

    .navbar-brand img {
        height: 32px; /* 减小logo高度 */
    }

    #authNavItems {
        display: flex !important;
        flex-direction: row;
        gap: 6px; /* 减小间距 */
        align-items: center;
        font-size: 0.85rem; /* 减小字体大小 */
    }
    
    /* 确保认证相关的导航项在移动端显示 */
    #authNavItems li {
        display: block !important;
    }

    /* 移动端优化语言切换 */
    #authNavItems .nav-item.dropdown {
        font-size: 0.8rem; /* 减小语言切换字体 */
    }

    #authNavItems .nav-link {
        padding: 4px 6px !important; /* 减小内边距 */
        font-size: 0.8rem !important; /* 减小字体大小 */
    }

    #authNavItems .google-translate-wrapper {
        display: none; /* 移动端隐藏翻译 */
    }

    /* 移动端隐藏登录/注册按钮 */
    #authNavItems #loginNavItem,
    #authNavItems #registerNavItem {
        display: none !important;
    }

    /* 移动端始终显示用户下拉菜单 */
    #authNavItems #userDropdown {
        display: flex !important;
        align-items: center;
        position: relative;
    }
    
    #authNavItems #userDropdown .nav-link {
        padding: 4px 8px;
        border-radius: 20px;
        text-decoration: none;
        transition: all 0.2s ease;
        font-size: 0.9rem;
    }

    #authNavItems #userDropdown .nav-link:hover {
        background-color: rgba(13, 110, 253, 0.1);
    }

    #authNavItems #userDropdown img {
        width: 28px;
        height: 28px;
        border: 2px solid #e9ecef;
    }

    #authNavItems #userDropdown .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        min-width: 200px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border: 1px solid #e9ecef;
        z-index: 1050;
        margin-top: 4px;
        transform: translateZ(0);
        will-change: transform;
    }

    #authNavItems #userDropdown .dropdown-item {
        padding: 8px 16px;
        font-size: 0.9rem;
        transition: all 0.2s ease;
    }

    #authNavItems #userDropdown .dropdown-item:hover {
        background-color: rgba(13, 110, 253, 0.1);
        color: #0d6efd;
    }

    #authNavItems #userDropdown .dropdown-item i {
        width: 16px;
        color: #6c757d;
    }
}

/* 移动端调整WhatsApp悬浮窗口位置 */
@media (max-width: 991.98px) {
    /* 调整WhatsApp悬浮窗口位置 */
    .wechat-qr-float {
        bottom: 80px !important;
        right: 20px !important;
        z-index: 998 !important;
    }
}

/* 大屏幕隐藏底部导航 */
@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}