* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: #030014; color: #fff;
    font-family: 'Outfit', sans-serif;
    height: 100vh; overflow: hidden;
    display: flex; justify-content: center; align-items: center;
}

body::before, body::after {
    content: ''; position: absolute; width: 50vw; height: 50vw;
    background: #8b5cf6; border-radius: 50%; filter: blur(200px); z-index: -1; opacity: 0.5;
}
body::before { top: -10%; left: -10%; }
body::after { bottom: -10%; right: -10%; background: #7c3aed; }

.glass-panel { background: rgba(20, 20, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); backdrop-filter: blur(16px); }

#login-container { text-align: center; width: 350px; padding: 40px; border-radius: 20px; }
#login-container h2 { margin-bottom: 10px; font-weight: 600; }
#login-container p { color: #a78bfa; margin-bottom: 30px; font-size: 14px; }

button, .primary-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white;
    border: none; padding: 12px 24px; border-radius: 10px;
    font-family: 'Outfit', sans-serif; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s, transform 0.1s; width: auto;
}
button:hover, .primary-btn:hover { opacity: 0.9; }
button:active, .primary-btn:active { transform: scale(0.98); }

.text-btn { background: rgba(255,255,255,0.05); padding: 6px 12px; font-size: 13px; font-weight: 400; border-radius: 8px; }
.text-btn:hover { background: rgba(255,255,255,0.1); }

#app-container { display: flex; width: 100vw; height: 100vh; padding: 10px; gap: 10px; max-width: 1600px; margin: 0 auto; }

.accounts-sidebar { width: 70px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; padding: 15px 0; gap: 15px; }
.account-avatar { width: 44px; height: 44px; border-radius: 50%; background: #2a2a35; display: flex; justify-content: center; align-items: center; font-weight: 600; cursor: pointer; transition: 0.2s; border: 2px solid transparent; }
.account-avatar.active { border-color: #a78bfa; background: #7c3aed; }
.account-avatar:hover { transform: scale(1.1); }
.add-account-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.05); color: #a78bfa; font-size: 24px; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 1px dashed rgba(255,255,255,0.2); padding: 0;}
.add-account-btn:hover { background: rgba(255,255,255,0.1); }

.chats-sidebar { width: 320px; border-radius: 16px; display: flex; flex-direction: column; }
.sidebar-header { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.header-user-info { font-weight: 600; font-size: 16px; }
.search-bar { padding: 10px 15px; }
.search-bar input { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); color: white; padding: 10px 15px; border-radius: 20px; outline: none; font-family: 'Outfit'; }
.search-bar input:focus { border-color: #8b5cf6; }

.chat-list { flex: 1; overflow-y: auto; padding: 5px 10px; }
.chat-item { display: flex; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; transition: 0.2s; margin-bottom: 2px; }
.chat-item:hover, .chat-item.active { background: rgba(139, 92, 246, 0.2); }
.chat-item-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #4c1d95, #7c3aed); display: flex; justify-content: center; align-items: center; margin-right: 12px; font-weight: 600; font-size: 18px; flex-shrink: 0; }
.chat-item-avatar.saved { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.chat-item-info { flex: 1; overflow: hidden; }
.chat-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview { font-size: 13px; color: #a78bfa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-chat { flex: 1; border-radius: 16px; display: flex; flex-direction: column; position: relative; }
.chat-header { padding: 15px 25px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.1); border-radius: 16px 16px 0 0; }
.chat-title { font-weight: 600; font-size: 18px; }
.chat-status { font-size: 13px; color: #a78bfa; }

.messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.empty-state { margin: auto; color: #a78bfa; background: rgba(0,0,0,0.2); padding: 10px 20px; border-radius: 20px; font-size: 14px; }

.msg { padding: 8px 14px; border-radius: 16px; max-width: 65%; word-break: break-word; line-height: 1.4; position: relative; }
.msg.self { background: #7c3aed; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.other { background: rgba(255, 255, 255, 0.1); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-author { font-size: 12px; color: #d8b4fe; margin-bottom: 2px; font-weight: 600; cursor: pointer; display: inline-block; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 10px; opacity: 0.6; float: right; margin-top: 8px; margin-left: 10px; }

.input-area { padding: 15px 25px; display: flex; gap: 15px; border-top: 1px solid rgba(255, 255, 255, 0.05); background: rgba(0,0,0,0.1); border-radius: 0 0 16px 16px; align-items: center; }
.input-area input { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid rgba(255, 255, 255, 0.05); color: white; border-radius: 20px; padding: 14px 20px; font-family: 'Outfit'; outline: none; font-size: 15px; transition: 0.2s; }
.input-area input:focus { border-color: #8b5cf6; background: rgba(255,255,255,0.05); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); z-index: 99; backdrop-filter: blur(5px); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 350px; padding: 25px; border-radius: 20px; z-index: 100; display: flex; flex-direction: column; gap: 15px; }
.modal h3 { font-weight: 600; text-align: center; margin-bottom: 10px; }
.modal input { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); color: white; padding: 12px 15px; border-radius: 12px; outline: none; font-family: 'Outfit'; width: 100%; }
.menu-action-btn { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 12px; text-align: center; color: white; font-weight: 400; border: 1px solid rgba(255,255,255,0.05); }
.menu-action-btn:hover { background: rgba(255,255,255,0.1); }
.divider { height: 1px; background: rgba(255,255,255,0.1); margin: 5px 0; }
.search-results { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.search-user-item { padding: 10px 15px; background: rgba(255,255,255,0.05); border-radius: 10px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.search-user-item:hover { background: #8b5cf6; }

.profile-large-avatar { width: 100px; height: 100px; border-radius: 50%; background: #2a2a35; display: flex; justify-content: center; align-items: center; font-size: 36px; font-weight: 600; background-size: cover; background-position: center; margin-bottom: 10px; }
.profile-subtitle { color: #a78bfa; font-size: 14px; margin-top: -10px; }
.profile-bio { font-size: 14px; text-align: center; background: rgba(0,0,0,0.2); padding: 10px; border-radius: 10px; width: 100%; min-height: 40px; margin-top: 10px;}
.secondary-link { color: #a78bfa; font-size: 13px; text-decoration: none; text-align: center; margin-top: 10px; display: block; }
.secondary-link:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
