/**
 * 移动端自定义语言下拉框样式
 * 支持国旗图标显示的美观下拉框
 * 作者：AI助手
 * 创建时间：2025-10-11
 */

/* ========== 移动端自定义语言下拉框样式 ========== */
@media (max-width: 768px) {
    
    /* 语言选择区域容器 */
    .new-mobile-lang-section {
        margin-top: 20px !important;
        padding: 20px !important;
        border-top: 1px solid #e5e7eb !important;
        background: #f8f9fa !important;
    }
    
    /* 语言选择标题 */
    .new-mobile-lang-title {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #6b7280 !important;
        margin-bottom: 12px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        text-align: center !important;
    }
    
    /* ========== 自定义下拉框容器 ========== */
    .custom-lang-dropdown {
        position: relative !important;
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
        user-select: none !important;
    }
    
    /* ========== 当前选中的语言显示框 ========== */
    .custom-lang-selected {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 12px 16px !important;
        background: white !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        box-sizing: border-box !important;
        min-height: 48px !important;
    }
    
    /* 选中框hover状态 */
    .custom-lang-selected:hover {
        border-color: #09a2e6 !important;
        background-color: #fafafa !important;
    }
    
    /* 下拉框打开时的选中框样式 */
    .custom-lang-dropdown.active .custom-lang-selected {
        border-color: #09a2e6 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        box-shadow: 0 0 0 3px rgba(9, 162, 230, 0.1) !important;
    }
    
    /* 国旗图标 */
    .custom-lang-selected .lang-flag {
        width: 24px !important;
        height: 18px !important;
        object-fit: cover !important;
        border-radius: 2px !important;
        flex-shrink: 0 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* 语言文字 */
    .custom-lang-selected .lang-text {
        flex: 1 !important;
        color: #374151 !important;
        font-size: 16px !important;
        font-weight: 500 !important;
    }
    
    /* 下拉箭头 */
    .custom-lang-selected .dropdown-arrow {
        flex-shrink: 0 !important;
        color: #6b7280 !important;
        transition: transform 0.3s ease !important;
    }
    
    /* 下拉框打开时箭头旋转 */
    .custom-lang-dropdown.active .dropdown-arrow {
        transform: rotate(180deg) !important;
    }
    
    /* ========== 下拉选项列表 ========== */
    .custom-lang-options {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        border: 2px solid #09a2e6 !important;
        border-top: none !important;
        border-radius: 0 0 8px 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        transition: all 0.3s ease !important;
        z-index: 1000 !important;
        box-sizing: border-box !important;
    }
    
    /* 下拉框打开时的选项列表 */
    .custom-lang-dropdown.active .custom-lang-options {
        max-height: 300px !important;
        overflow-y: auto !important;
        opacity: 1 !important;
    }
    
    /* ========== 单个语言选项 ========== */
    .custom-lang-option {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px 16px !important;
        color: #374151 !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
        border-bottom: 1px solid #f3f4f6 !important;
        box-sizing: border-box !important;
    }
    
    /* 最后一个选项不需要底部边框 */
    .custom-lang-option:last-child {
        border-bottom: none !important;
    }
    
    /* 选项hover状态 */
    .custom-lang-option:hover {
        background: #e6f3ff !important;
        color: #09a2e6 !important;
    }
    
    /* 选项中的国旗图标 */
    .custom-lang-option .lang-flag {
        width: 24px !important;
        height: 18px !important;
        object-fit: cover !important;
        border-radius: 2px !important;
        flex-shrink: 0 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* 选项中的语言文字 */
    .custom-lang-option .lang-text {
        flex: 1 !important;
        font-size: 16px !important;
        font-weight: 400 !important;
    }
    
    /* 选项hover时的文字样式 */
    .custom-lang-option:hover .lang-text {
        font-weight: 500 !important;
    }
    
    /* 移除旧的样式 */
    .new-mobile-lang-grid,
    .mobile-lang-select,
    .new-mobile-lang-dropdown {
        display: none !important;
    }
}

/* ========== 超小屏幕优化 ========== */
@media (max-width: 480px) {
    
    .new-mobile-lang-dropdown {
        max-width: 100% !important;
        padding: 0 16px !important;
    }
    
    .mobile-lang-select {
        font-size: 14px !important;
        padding: 12px 36px 12px 14px !important;
        min-height: 44px !important;
    }
}

/* ========== 桌面端不显示（确保只在移动端生效） ========== */
@media (min-width: 769px) {
    .mobile-lang-select {
        display: none !important;
    }
}
