<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Профиль - Minecraft Launcher</title>
    <link rel="stylesheet" href="/static/css/minecraft-webfont.css">
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <div class="launcher-header">
        <div class="launcher-logo">MINECRAFT LAUNCHER</div>
    </div>
    
    <div class="container">
        <div class="minecraft-panel">
            <div class="launcher-panel">
                <div class="profile-header">
                    <div class="profile-title">Редактор профиля</div>
                    <button onclick="handleLogout()" class="btn btn-logout" style="padding: 8px 16px; font-size: 12px;">Выйти</button>
                </div>
                
                <div class="profile-layout">
                    <div class="profile-left">
                        <div class="profile-section">
                            <div class="profile-field">
                                <label>Имя профиля</label>
                                <div class="value">{{.Username}}</div>
                            </div>
                            
                            <div class="profile-field">
                                <label>Email адрес</label>
                                <div class="value" id="email-value">{{.Email}}</div>
                            </div>
                            
                            <div class="profile-field">
                                <label>Роль пользователя</label>
                                <div class="value" id="role-value">{{.Role}}</div>
                            </div>
                        </div>
                        
                        <div class="profile-section">
                            <h3 style="color: #fff; font-size: 16px; margin: 0 0 20px 0;">Изменить профиль</h3>
                            <div class="form-group">
                                <label for="new-nickname">Имя профиля</label>
                                <input type="text" id="new-nickname" class="input-field" placeholder="{{.Username}}" value="{{.Username}}">
                            </div>
                            <div class="form-group">
                                <label for="new-email">Email адрес</label>
                                <input type="email" id="new-email" class="input-field" placeholder="example@minecraft.net">
                            </div>
                            
                            <div class="profile-actions">
                                <button onclick="updateProfile()" class="btn btn-primary" style="flex: 1;">Сохранить изменения</button>
                                <a href="/admin" class="btn btn-secondary" style="flex: 1;">Админ-панель</a>
                            </div>
                        </div>
                    </div>
                    
                    <div class="profile-right">
                        <div class="skin-selector-section">
                            <h3 style="color: #fff; font-size: 16px; margin: 0 0 15px 0; text-align: center;">Скин персонажа</h3>
                            
                            <div class="skin-preview-3d">
                                <canvas id="skin_container" data-current-skin="{{.CurrentSkin}}" data-skin-history='{{.SkinHistory}}'></canvas>
                            </div>
                            
                            <h4 style="color: #fff; font-size: 14px; margin: 15px 0 10px 0;">Стандартные скины</h4>
                            <div class="skin-gallery" id="skin-gallery">
                            </div>
                            
                            <h4 style="color: #fff; font-size: 14px; margin: 15px 0 10px 0;">История скинов</h4>
                            <div class="skin-history" id="skin-history">
                                <p style="color: #999; font-size: 12px; text-align: center;">История пуста</p>
                            </div>
                            
                            <div style="margin-top: 15px;">
                                <input type="file" id="skin-upload" accept="image/png" style="display: none;">
                                <button onclick="document.getElementById('skin-upload').click()" class="btn btn-secondary" style="width: 100%; padding: 10px; font-size: 13px; margin-bottom: 8px;">Загрузить свой скин</button>
                                <button onclick="resetSkin()" class="btn" style="width: 100%; padding: 10px; font-size: 13px; background: #444; color: #fff; border: 2px solid #666;">Сбросить</button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div id="message-container"></div>
            </div>
        </div>
    </div>
    
    <script src="/static/js/skinview3d.bundle.js"></script>
    <script src="/static/js/profile.js"></script>
</body>
</html>
