/* --- Cài đặt chung --- */
:root {
    --bg-color: #f0f2f5;
    --card-bg-color: #ffffff;
    --text-color: #1c1e21;
    --border-color: #dddfe2;
    --primary-color: #1877f2;
    --icon-display-size: 48px; 
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    margin: 0;
    background-image: url('images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative; 
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 15, 20, 0.7); 
    z-index: -1; 
}

/* --- MÀN HÌNH ĐĂNG NHẬP --- */
#login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

#login-container h1 {
    font-size: 64px;
    color: #c89b3c; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); 
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

#login-register-forms { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; background-color: rgba(10, 20, 30, 0.75); padding: 30px; border: 1px solid rgba(200, 155, 60, 0.3); border-radius: 8px; }
#login-register-forms form { min-width: 280px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
#login-register-forms h3 { margin: 0 0 10px 0; text-align: center; color: #f0e6d2; font-size: 20px; }
#login-register-forms input, #login-register-forms button { padding: 12px; font-size: 14px; border-radius: 5px; border: 1px solid #4f545c; background-color: #1a262b; color: #f0e6d2; }
#login-register-forms input::placeholder { color: #a09b8c; }
#login-register-forms button { background-color: var(--primary-color); color: white; cursor: pointer; border: none; font-weight: bold; }

/* --- MÀN HÌNH ỨNG DỤNG CHÍNH --- */
#app {
    max-width: 1200px;
    margin: 20px auto;
    background-color: rgba(10, 20, 30, 0.75); 
    border: 1px solid #c89b3c;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#app header {
    padding: 20px;
    border-bottom: 1px solid #c89b3c;
}

#app h1 {
    text-align: center;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 48px;
    color: #c89b3c; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); 
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

main { padding: 20px; }
.controls { padding-bottom: 20px; }
#search-input { width: 100%; padding: 12px 20px; font-size: 16px; border-radius: 6px; border: 1px solid #4f545c; background-color: #1a262b; color: #f0e6d2; box-sizing: border-box;}
#search-input::placeholder { color: #a09b8c; }

/* === PHẦN THÊM MỚI: CSS CHO BỘ LỌC ICON === */
#role-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #c89b3c;
    background-color: transparent;
    color: #c89b3c;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.filter-btn img {
    width: 24px;
    height: 24px;
    filter: grayscale(1) brightness(1.5);
    transition: filter 0.2s ease;
}

.filter-btn:hover {
    background-color: rgba(200, 155, 60, 0.2);
}

.filter-btn.active {
    background-color: #c89b3c;
    color: #111;
}

.filter-btn.active img,
.filter-btn:hover img {
    filter: none;
}
/* === KẾT THÚC PHẦN THÊM MỚI === */


#champion-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); gap: 15px; justify-content: center; }
.champion-item { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; width: 70px; margin: 0 auto; }
.champion-icon { width: var(--icon-display-size); height: var(--icon-display-size); background-repeat: no-repeat; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.2); position: relative; background-color: #0a1018; }
.champion-name { font-size: 11px; color: #a09b8c; text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.champion-item:hover .champion-icon { filter: brightness(1.1); }
.champion-icon::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(14, 113, 56, 0.75); opacity: 0; transition: opacity 0.3s ease; z-index: 2; }
.champion-icon::before { content: '✔'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: calc(var(--icon-display-size) * 0.6); text-shadow: 0 0 5px black; opacity: 0; transition: opacity 0.3s ease; z-index: 3; }
.completed .champion-icon::after, .completed .champion-icon::before { opacity: 1; }

/* --- CÁC THÀNH PHẦN Ở GÓC MÀN HÌNH --- */
#left-sidebar, #right-sidebar {
    position: fixed;
    top: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#left-sidebar {
    left: 20px;
}

#right-sidebar {
    right: 20px;
    align-items: flex-end;
}

#user-menu-container, #trophy-menu-container {
    position: relative;
    z-index: 101;
}

#trophy-menu-container {
    z-index: 100;
}

#user-icon, #trophy-icon { width: 36px; height: 36px; padding: 8px; background-color: rgba(10, 20, 30, 0.75); border: 1px solid rgba(200, 155, 60, 0.5); border-radius: 50%; cursor: pointer; color: #c89b3c; transition: background-color 0.2s ease; }
#user-icon:hover, #trophy-icon:hover { background-color: rgba(30, 40, 50, 0.9); }

#user-info-dropdown, #progress-tracker.challenge-card {
    display: none; 
    position: absolute; 
    top: 110%; 
    left: 0; 
    background-color: #1a262b; 
    border: 1px solid #c89b3c; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#user-menu-container:hover #user-info-dropdown,
#trophy-menu-container:hover #progress-tracker.challenge-card {
    display: flex;
}

#user-info-dropdown { padding: 15px; width: 250px; }
#user-info { display: block; }
#user-info p { margin: 0 0 15px 0; font-size: 16px; color: #f0e6d2; border-bottom: 1px solid #31271e; padding-bottom: 10px; }
#user-info #logout-button { width: 100%; padding: 8px 15px; font-size: 14px; border-radius: 5px; border: 1px solid #c89b3c; background-color: transparent; color: #c89b3c; cursor: pointer; transition: all 0.2s ease; }
#user-info #logout-button:hover { background-color: #c89b3c; color: #111; }

#progress-tracker.challenge-card {
    width: 300px; 
    padding: 10px; 
    color: #a09b8c; 
    flex-direction: column; 
    gap: 10px;
}
.challenge-body { display: flex; align-items: center; gap: 15px; }
#progress-tier-icon { width: 64px; height: 64px; flex-shrink: 0; }
.challenge-info { display: flex; flex-direction: column; }
.challenge-title { font-size: 18px; font-weight: bold; color: #f0e6d2; margin: 0; line-height: 1.2; }
.tier-name { font-size: 14px; font-weight: bold; text-transform: uppercase; margin: 2px 0; }
.tier-iron { color: #6b6460; } .tier-bronze { color: #a46628; } .tier-silver { color: #a0b5b8; } .tier-gold { color: #c89b3c; } .tier-platinum { color: #4e9996; } .tier-diamond { color: #576bce; } .tier-master { color: #9a4eb5; }
.challenge-description { font-size: 12px; margin: 4px 0 0 0; }
.challenge-progress { position: relative; width: 100%; margin-top: 10px; }
#progress-bar-container { width: 100%; height: 18px; background-color: #111; border: 1px solid #463714; border-radius: 2px; overflow: hidden; }
#progress-bar { width: 0%; height: 100%; background-color: #00a8b5; transition: width 0.5s ease; border-radius: 2px; }
#progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 12px; font-weight: bold; text-shadow: 1px 1px 2px black; width: 100%; text-align: center; }

/* --- CSS CHO LIVE CHAT --- */
#live-chat {
    width: 300px;
    height: 400px;
    background-color: #1a262b;
    border: 1px solid #c89b3c;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}
.chat-title { padding: 10px; text-align: center; font-family: 'Rajdhani', sans-serif; font-weight: bold; color: #f0e6d2; border-bottom: 1px solid rgba(200, 155, 60, 0.3); flex-shrink: 0; }
#chat-messages { flex-grow: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 8px 12px; border-radius: 15px; max-width: 80%; }
.message .sender { font-size: 12px; font-weight: bold; color: #c89b3c; margin-bottom: 4px; }
.message .text { font-size: 14px; color: #f0e6d2; word-wrap: break-word; }
.message.theirs { background-color: #2c2f33; align-self: flex-start; }
.message.mine { background-color: #004886; align-self: flex-end; }
#chat-form { display: flex; padding: 10px; border-top: 1px solid rgba(200, 155, 60, 0.3); flex-shrink: 0; }
#chat-input { flex-grow: 1; padding: 10px; border-radius: 5px; border: 1px solid #4f545c; background-color: #0a1018; color: #f0e6d2; }
#chat-form button { padding: 10px 15px; margin-left: 10px; border: none; border-radius: 5px; background-color: var(--primary-color); color: white; cursor: pointer; font-weight: bold; }