<?php
/**
 * HuSNS - 一款免费开源的社交平台
 * 
 * @author  HYR
 * @QQ      281900864
 * @website https://huyourui.com
 * @license MIT
 * @声明    严禁用于违法违规用途
 */
$userId = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null;
if (!$userId) {
    // 使用弹窗登录，不跳转页面
    $this->assign('showLoginModal', true);
}

$currentPage = 'privacy';
$pageType = 'privacy';
$bodyClass = 'privacy-page';
$headerTitle = '隐私设置';
$userId = $_SESSION['user_id'];

// 页面特定CSS和JS文件
$pageCssFiles = [$this->themeUrl() . '/app/css/privacy.css'];
$pageJsFiles = [$this->themeUrl() . '/app/js/privacy.js'];

$this->assign('pageCssFiles', $pageCssFiles);
$this->assign('pageJsFiles', $pageJsFiles);

$this->setLayout('app');
?>

<div class="privacy-content">
    <!-- 提示信息 -->
    <div class="privacy-tip">
        <div class="privacy-tip-text">
            在这里你可以管理账号设置、隐私选项和应用偏好。
        </div>
    </div>
    
    <!-- 个人主页隐私 -->
    <div class="privacy-section">
        <div class="privacy-section-title">个人主页</div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">谁可以查看我的个人主页</div>
                <div class="privacy-item-description">控制谁可以访问你的个人主页</div>
            </div>
            <select class="privacy-select" id="profileVisibility">
                <option value="public">所有人</option>
                <option value="followers">仅关注者</option>
                <option value="private">仅自己</option>
            </select>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">显示我的在线状态</div>
                <div class="privacy-item-description">让其他用户知道你是否在线</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="showOnlineStatus" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">允许陌生人私信我</div>
                <div class="privacy-item-description">控制是否接受非关注者的私信</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="allowStrangerMessages" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
    </div>
    
    <!-- 内容隐私 -->
    <div class="privacy-section">
        <div class="privacy-section-title">内容隐私</div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">谁可以评论我的帖子</div>
                <div class="privacy-item-description">控制谁可以在你的帖子下评论</div>
            </div>
            <select class="privacy-select" id="commentVisibility">
                <option value="public">所有人</option>
                <option value="followers">仅关注者</option>
                <option value="none">禁止评论</option>
            </select>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">谁可以转发我的帖子</div>
                <div class="privacy-item-description">控制谁可以转发你的帖子</div>
            </div>
            <select class="privacy-select" id="repostVisibility">
                <option value="public">所有人</option>
                <option value="followers">仅关注者</option>
                <option value="none">禁止转发</option>
            </select>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">允许被搜索</div>
                <div class="privacy-item-description">控制是否允许其他用户通过搜索找到你</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="allowSearch" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
    </div>
    
    <!-- 通知隐私 -->
    <div class="privacy-section">
        <div class="privacy-section-title">通知隐私</div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">接收赞通知</div>
                <div class="privacy-item-description">当有人赞你的帖子时收到通知</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="notificationsLikes" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">接收评论通知</div>
                <div class="privacy-item-description">当有人评论你的帖子时收到通知</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="notificationsComments" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">接收关注通知</div>
                <div class="privacy-item-description">当有人关注你时收到通知</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="notificationsFollows" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
        
        <div class="privacy-item">
            <div>
                <div class="privacy-item-label">接收系统通知</div>
                <div class="privacy-item-description">接收平台的系统通知</div>
            </div>
            <label class="toggle-switch">
                <input type="checkbox" id="notificationsSystem" checked>
                <span class="toggle-slider"></span>
            </label>
        </div>
    </div>
    
    <!-- 高级隐私设置入口 -->
    <div class="privacy-section">
        <div class="privacy-section-title">更多设置</div>
        
        <div class="privacy-links">
            <a href="<?php echo $this->url('mobile/privacyBlacklist'); ?>" class="privacy-link-item">
                <span class="link-icon">🚫</span>
                <span class="link-text">黑名单管理</span>
                <span class="link-arrow">›</span>
            </a>
            <a href="<?php echo $this->url('mobile/privacySecurity'); ?>" class="privacy-link-item">
                <span class="link-icon">🔒</span>
                <span class="link-text">账号安全</span>
                <span class="link-arrow">›</span>
            </a>
            <a href="<?php echo $this->url('mobile/privacyData'); ?>" class="privacy-link-item">
                <span class="link-icon">📊</span>
                <span class="link-text">数据管理</span>
                <span class="link-arrow">›</span>
            </a>
        </div>
    </div>
    
    <!-- 保存按钮 -->
    <button class="save-button" id="savePrivacySettings">保存设置</button>
</div>