/* Базовые сбросы */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0b141a;
    color: #e9edef;
    overflow: hidden;
}

/* Главный контейнер */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Боковая панель */
.sidebar {
    width: 300px;
    background-color: #111b21;
    border-right: 1px solid #2a3942;
    display: flex;
    flex-direction: column;
}

.my-profile {
    padding: 10px 15px;
    background-color: #202c33;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.settings-trigger {
    background: none;
    border: none;
    color: #aebac1;
    font-size: 20px;
    cursor: pointer;
}

/* Поиск */
.search-box {
    padding: 10px;
    background-color: #111b21;
}

#search-input {
    width: 100%;
    background-color: #2a3942;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    outline: none;
}

#search-results {
    background: #111b21;
    max-height: 200px;
    overflow-y: auto;
}

/* Основной чат */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0b141a;
}

.chat-header {
    height: 60px;
    background-color: #202c33;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2a3942;
}

#messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-area {
    background-color: #202c33;
    padding: 15px;
    display: flex;
    gap: 10px;
}

#msg-input {
    flex: 1;
    background-color: #2a3942;
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    outline: none;
}

#send-btn {
    background-color: #00a884;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Список чатов */
.chat-item {
    padding: 15px;
    border-bottom: 1px solid #222d34;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background-color: #2a3942;
}

/* ЭКРАН ВХОДА */
#auth-screen {
    position: fixed;
    inset: 0;
    background-color: #0b141a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.auth-card {
    background-color: #111b21;
    padding: 30px;
    border-radius: 12px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.auth-card input {
    background-color: #2a3942;
    border: none;
    padding: 12px;
    border-radius: 6px;
    color: white;
}

.auth-card button {
    background-color: #00a884;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* МОДАЛКА НАСТРОЕК */
#settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.settings-content {
    background-color: #111b21;
    padding: 30px;
    border-radius: 15px;
    width: 360px;
    position: relative;
    border: 1px solid #2a3942;
}

.close-settings {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #ea0038 !important;
    color: white;
    border: 2px solid #111b21;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.id-block {
    background: #0b141a;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#display-my-id {
    color: #00a884;
    font-size: 1.2em;
}

.avatar-upload-section {
    text-align: center;
}

#my-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00a884;
    margin-bottom: 15px;
}

.file-label {
    background: #2a3942;
    padding: 10px;
    display: block;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
}

.save-avatar-btn {
    width: 100%;
    background: #00a884;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.call-btn {
    background-color: #25d366;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}