/* ========== БАЗОВЫЕ СТИЛИ (СВЕТЛАЯ ТЕМА) ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    overflow: hidden;
}
/* Авторизация */
#auth {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#auth input, #auth button {
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
#auth button {
    background: #0084ff;
    color: white;
    border: none;
    cursor: pointer;
}
#auth button:hover {
    background: #0066cc;
}
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}
.auth-footer a {
    color: #0084ff;
    text-decoration: none;
}
.auth-footer a:hover {
    text-decoration: underline;
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
}
.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
/* Основной интерфейс */
#app {
    display: none;
    height: 100vh;
    width: 100%;
}
/* Левая панель */
.sidebar-left {
    width: 72px;
    background: #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    overflow-y: auto;
    border-right: 1px solid #34495e;
}
.dm-mode-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #34495e;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}
.dm-mode-btn.active {
    background: #0084ff;
}
.servers-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #34495e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    color: white;
}
.server-icon.active {
    background: #0084ff;
}
.add-server-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #34495e;
    border: none;
    color: #2ecc71;
    font-size: 24px;
    cursor: pointer;
}
.friends-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #34495e;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
}
.friends-button:hover {
    background: #3b5a6f;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #2c3e50;
    border-radius: 8px;
    margin-top: auto;
    margin-bottom: 8px;
    width: calc(100% - 24px);
}
.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.edit-profile-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}
/* Средняя панель */
.middle-panel {
    width: 240px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9ecef;
}
.channels-header {
    padding: 12px;
    font-weight: bold;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.settings-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}
.channels-list {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
}
.channel-item {
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e1f22;
}
.channel-item:hover {
    background: #e9ecef;
}
.channel-item.active {
    background: #e9ecef;
    color: #0084ff;
}
.friends-panel {
    display: none;
    flex-direction: column;
    padding: 8px;
    flex: 1;
    overflow-y: auto;
}
.friends-header {
    font-size: 12px;
    font-weight: bold;
    padding: 8px;
    text-align: center;
    color: #7f8c8d;
}
.friends-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 8px;
}
.friends-tab {
    flex: 1;
    background: none;
    border: none;
    color: #7f8c8d;
    padding: 8px;
    cursor: pointer;
}
.friends-tab.active {
    color: #0084ff;
    border-bottom: 2px solid #0084ff;
}
.friends-tab-content {
    display: none;
}
.friends-tab-content.active {
    display: block;
}
.friend-item, .request-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.friend-item:hover, .request-item:hover {
    background: #e9ecef;
}
.friend-avatar, .request-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0084ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}
.request-item {
    justify-content: space-between;
}
.request-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}
.accept-btn {
    color: #2ecc71;
}
.decline-btn {
    color: #e74c3c;
}
.friends-search {
    position: relative;
}
#friend-search-input {
    width: 100%;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
}
.search-result-item:hover {
    background: #f8f9fa;
}
/* Центральная область */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}
.channel-header {
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.channel-info {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logout-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
}
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.message {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.message-content {
    flex: 1;
}
.message-author {
    font-weight: bold;
    margin-right: 8px;
}
.message-time {
    font-size: 11px;
    color: #7f8c8d;
}
.message-text {
    margin-top: 4px;
}
.message img, .message video, .message audio {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
}
.message-input-area {
    padding: 16px 20px;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    border-top: 1px solid #e9ecef;
}
#message-input {
    flex: 1;
    background: white;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 24px;
}
#send-btn, #attach-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 20px;
}
#send-btn:hover, #attach-btn:hover {
    color: #0084ff;
}
/* Правая панель */
.sidebar-right {
    width: 240px;
    background: #f8f9fa;
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}
.members-header {
    padding: 16px;
    font-weight: bold;
    border-bottom: 1px solid #e9ecef;
}
.members-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.member-item {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    cursor: pointer;
}
.member-item:hover {
    background: white;
}
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
}
.sidebar-right.hidden {
    display: none;
}
/* Админка */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}
.admin-tab {
    flex: 1;
    background: none;
    border: none;
    color: #7f8c8d;
    padding: 8px;
    cursor: pointer;
}
.admin-tab.active {
    color: #0084ff;
    border-bottom: 2px solid #0084ff;
}
.admin-tab-content {
    display: none;
}
.admin-tab-content.active {
    display: block;
}
.make-admin-btn, .kick-btn {
    background: #0084ff;
    border: none;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    cursor: pointer;
    color: white;
}
.kick-btn {
    background: #e74c3c;
}
.delete-cat-btn, .delete-channel-btn {
    background: #e74c3c;
    border: none;
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: white;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin: 10px 0;
}
#create-server-btn,
#dm-mode-btn,
#friends-button {
    position: relative;
    z-index: 9999 !important;
    pointer-events: auto !important;
}