/**
 * Centralized application configuration
 */

// API Endpoints
export const API = {
    AUTH: {
        LOGIN: '/api/auth/login',
        LOGOUT: '/api/auth/logout',
        REGISTER: '/api/auth/register',
        GITHUB: '/api/auth/github'
    },
    AVATAR: {
        GET: '/api/avatar/me',
        UPLOAD: '/api/avatar/upload',
        DELETE: '/api/avatar/delete'
    },
    FRIENDS: {
        LIST: '/api/friends',
        REQUESTS: '/api/friends/requests',
        SEARCH: '/api/friends/search',
        REQUEST: '/api/friends/request',
        ACCEPT: '/api/friends/accept',
        DECLINE: '/api/friends/decline'
    },
    ROOMS: {
        LIST: '/api/rooms',
        PLAYING: '/api/rooms/playing',
        CREATE: '/api/rooms',
        GET: (id) => `/api/rooms/${id}`,
        PLAYERS: (id) => `/api/rooms/${id}/players`,
        JOIN: (id) => `/api/rooms/${id}/join`,
        LEAVE: (id) => `/api/rooms/${id}/leave`,
        SPECTATE: (id) => `/api/rooms/${id}/spectate`,
        LEAVE_SPECTATE: (id) => `/api/rooms/${id}/leave-spectate`,
        CURRENT: '/api/rooms/current'
    },
    STATS: {
        ME: '/api/stats/me',
        USER: (username) => `/api/stats/user/${username}`,
        LEADERBOARD: '/api/stats/leaderboard',
        TETRIS_SCORE: '/api/stats/tetris/score',
        TETRIS_LEADERBOARD_SCORE: '/api/stats/tetris/leaderboard/score',
        TETRIS_LEADERBOARD_WINS: '/api/stats/tetris/leaderboard/wins'
    }
};

// localStorage keys
export const STORAGE_KEYS = {
    AUTH_TOKEN: 'auth_token'
};

// Window configuration
export const WINDOW_CONFIG = {
    DEFAULT_WIDTH: 320,
    DEFAULT_HEIGHT: 220,
    Z_INDEX_BASE: 100
};

// CSS classes (BEM convention)
export const CSS = {
    // Menu
    MENU: 'menu',
    MENU_ITEM: 'menu__item',
    MENU_ITEM_ACTIVE: 'menu__item--active',

    // Windows
    WINDOW: 'window',
    WINDOW_VISIBLE: 'window--visible',
    WINDOW_HEADER: 'window__header',
    WINDOW_TITLE: 'window__title',
    WINDOW_CLOSE: 'window__close',
    WINDOW_BODY: 'window__body',

    // Buttons
    BTN: 'btn',
    BTN_PRIMARY: 'btn--primary',
    BTN_SECONDARY: 'btn--secondary',
    BTN_SUCCESS: 'btn--success',
    BTN_DANGER: 'btn--danger',
    BTN_GITHUB: 'btn--github',

    // Forms
    INPUT: 'input',
    INPUT_GROUP: 'input-group',

    // Messages
    MESSAGE: 'message',
    MESSAGE_SUCCESS: 'message--success',
    MESSAGE_ERROR: 'message--error',
    MESSAGE_INFO: 'message--info',

    // Chat
    CHAT: 'chat',
    CHAT_OUTPUT: 'chat__output',
    CHAT_INPUT: 'chat__input',
    CHAT_CONTROLS: 'chat__controls',
    CHAT_MESSAGE: 'chat__message',
    CHAT_SYSTEM: 'chat__system',

    // Avatar
    AVATAR: 'avatar',
    AVATAR_PREVIEW: 'avatar__preview',
    AVATAR_CONTROLS: 'avatar__controls',
    AVATAR_USERNAME: 'avatar__username',

    // Friends
    FRIENDS: 'friends',
    FRIENDS_TABS: 'friends__tabs',
    FRIENDS_TAB: 'friends__tab',
    FRIENDS_TAB_ACTIVE: 'friends__tab--active',
    FRIENDS_CONTENT: 'friends__content',
    FRIENDS_LIST: 'friends__list',
    FRIENDS_ITEM: 'friends__item',
    FRIENDS_AVATAR: 'friends__avatar',
    FRIENDS_NAME: 'friends__name',
    FRIENDS_ACTIONS: 'friends__actions',
    FRIENDS_SEARCH: 'friends__search',
    FRIENDS_EMPTY: 'friends__empty',

    // Game Rooms
    GAMEROOM: 'gameroom',
    GAMEROOM_TABS: 'gameroom__tabs',
    GAMEROOM_TAB: 'gameroom__tab',
    GAMEROOM_TAB_ACTIVE: 'gameroom__tab--active',
    GAMEROOM_CONTENT: 'gameroom__content',
    GAMEROOM_LIST: 'gameroom__list',
    GAMEROOM_ITEM: 'gameroom__item',
    GAMEROOM_NAME: 'gameroom__name',
    GAMEROOM_PLAYERS: 'gameroom__players',
    GAMEROOM_ACTIONS: 'gameroom__actions',
    GAMEROOM_CREATE: 'gameroom__create',
    GAMEROOM_LOBBY: 'gameroom__lobby',
    GAMEROOM_PLAYER_LIST: 'gameroom__player-list',
    GAMEROOM_PLAYER: 'gameroom__player',
    GAMEROOM_PLAYER_AVATAR: 'gameroom__player-avatar',
    GAMEROOM_PLAYER_NAME: 'gameroom__player-name',
    GAMEROOM_PLAYER_SCORE: 'gameroom__player-score'
};

// Colors (for reference, mainly used in CSS)
export const COLORS = {
    PRIMARY: '#0066cc',
    SUCCESS: '#3cff01',
    ERROR: '#ff4d4d',
    GITHUB: '#24292e',
    BACKGROUND: '#000',
    SURFACE: '#222',
    TEXT: '#fff'
};
