/* TrackMate Chat Sidebar — Discord-stílusú */
#chat-sidebar {
    position: fixed;
    top: 64px; /* navbar alatt */
    right: 0;
    width: 56px; /* collapsed: csak ikonok */
    height: calc(100vh - 64px - 60px); /* navbar + léna bar */
    background: #0d1117;
    border-left: 1px solid #1e293b;
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    overflow: hidden;
}
#chat-sidebar.expanded {
    width: 280px;
}
#chat-sidebar .chat-toggle {
    width: 100%;
    padding: 10px 0;
    text-align: center;
    cursor: pointer;
    color: #8b949e;
    font-size: 20px;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
    transition: color 0.2s;
}
#chat-sidebar .chat-toggle:hover { color: #f59e0b; }

/* User lista */
#chat-user-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #1e293b transparent;
}
#chat-user-list::-webkit-scrollbar { width: 4px; }
#chat-user-list::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    min-height: 44px;
}
.chat-user-item:hover { background: #161b22; }
.chat-user-item.active { background: #1c2333; border-left: 2px solid #f59e0b; }

/* Avatar + státusz pont */
.chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1e293b;
}
.chat-avatar-default {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #8b949e;
    border: 2px solid #1e293b;
}
.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #0d1117;
}
.chat-status-dot.online { background: #22c55e; }
.chat-status-dot.idle { background: #f59e0b; }
.chat-status-dot.away { background: #6b7280; }
.chat-status-dot.offline { background: #374151; }

/* User info (csak expanded) */
.chat-user-info {
    flex: 1;
    min-width: 0;
    display: none;
}
#chat-sidebar.expanded .chat-user-info { display: block; }
.chat-user-name {
    font-size: 12px;
    font-weight: 700;
    color: #e6edf3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-user-card {
    font-size: 10px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Olvasatlan badge */
.chat-unread-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === CHAT ABLAK (modal) === */
#chat-window {
    display: none;
    position: fixed;
    bottom: 70px;
    right: 66px;
    width: 66vw;
    height: 66vh;
    max-width: 700px;
    max-height: 600px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    z-index: 950;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#chat-window.open { display: flex; }

#chat-window-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
    background: #161b22;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}
#chat-window-header .chat-avatar-wrap { cursor: pointer; }

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: #1e293b transparent;
}
#chat-messages::-webkit-scrollbar { width: 5px; }
#chat-messages::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

.chat-msg {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.chat-msg.sent {
    align-self: flex-end;
    background: #1c3a5e;
    color: #e6edf3;
    border-bottom-right-radius: 4px;
}
.chat-msg.received {
    align-self: flex-start;
    background: #1e293b;
    color: #e6edf3;
    border-bottom-left-radius: 4px;
}
.chat-msg-time {
    font-size: 9px;
    color: #475569;
    margin-top: 2px;
}
.chat-msg-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 4px;
    text-decoration: none;
    color: #60a5fa;
    font-size: 11px;
    transition: border-color 0.2s;
}
.chat-msg-file:hover { border-color: #60a5fa; }

#chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #1e293b;
    background: #161b22;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}
#chat-input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 8px 12px;
    color: #e6edf3;
    font-size: 13px;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    outline: none;
}
#chat-input:focus { border-color: #f59e0b; }
#chat-input::placeholder { color: #484f58; }
#chat-send-btn {
    background: #f59e0b;
    color: #0d1117;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
}
#chat-send-btn:hover { background: #d97706; }

/* Skill radar modal */
#skill-radar-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 5500;
    align-items: center;
    justify-content: center;
}
#skill-radar-modal.open { display: flex; }
#skill-radar-content {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 24px;
    width: 420px;
    max-width: 90vw;
}

/* Global badge a navbar-on */
#chat-global-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
