/* Переменные фирменных цветов Discord */
:root {
    --bg-servers: #202225;
    --bg-channels: #2f3136;
    --bg-chat: #36393f;
    --bg-input: #40444b;
    --bg-auth: #2f3136;
    --bg-card: #36393f;
    --text-main: #dcddde;
    --text-muted: #72767d;
    --text-link: #00aff4;
    --brand-color: #5865f2;
    --brand-hover: #4752c4;
    --success: #3ba55d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-chat);
    color: var(--text-main);
    overflow: hidden;
}

/* ВСПОМОГАТЕЛЬНЫЙ КЛАСС ДЛЯ СКРЫТИЯ ЭЛЕМЕНТОВ */
.hidden {
    display: none !important;
}

/* ОФОРМЛЕНИЕ ОКНА АВТОРИЗАЦИИ */
.auth-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-auth);
}

.auth-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 8px;
    width: 480px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.auth-card h2 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 24px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.auth-card form {
    text-align: left;
}

.auth-card label {
    display: block;
    color: #b9bbbe;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.auth-card input {
    width: 100%;
    padding: 10px;
    background: #202225;
    border: 1px solid #202225;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
    outline: none;
    transition: border 0.2s;
}

.auth-card input:focus {
    border-color: var(--brand-color);
}

.auth-card button {
    width: 100%;
    padding: 12px;
    background: var(--brand-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.auth-card button:hover {
    background: var(--brand-hover);
}

.auth-footer {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

#switchToRegister {
    color: var(--text-link);
    cursor: pointer;
}

/* ГЛАВНАЯ СЕТКА ИНТЕРФЕЙСА */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* 1. ПАНЕЛЬ СЕРВЕРОВ */
.servers-panel {
    width: 72px;
    background-color: var(--bg-servers);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    gap: 8px;
}

.server-icon {
    width: 48px;
    height: 48px;
    background-color: #36393f;
    color: #dcddde;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.server-icon:hover, .server-icon.active {
    border-radius: 16px;
    background-color: var(--brand-color);
    color: #fff;
}

.server-icon.add-server {
    color: var(--success);
}
.server-icon.add-server:hover {
    background-color: var(--success);
    color: #fff;
}

.server-separator {
    width: 32px;
    height: 2px;
    background: #36393f;
    border-radius: 1px;
    margin: 4px 0;
}

/* 2. ПАНЕЛЬ КАНАЛОВ */
.channels-panel {
    width: 240px;
    background-color: var(--bg-channels);
    display: flex;
    flex-direction: column;
}

.server-header {
    height: 48px;
    border-bottom: 1px solid #202225;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.server-header h3 {
    font-size: 16px;
    color: #fff;
}

.channels-list {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-item {
    padding: 6px 8px;
    border-radius: 4px;
    color: #8e9297;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.1s, color 0.1s;
}

.channel-item:hover {
    background-color: rgba(79,84,92,0.16);
    color: #dcddde;
}

.channel-item.active {
    background-color: rgba(79,84,92,0.32);
    color: #fff;
}

/* ПРОФИЛЬ ЮЗЕРА ВНИЗУ ПАНЕЛИ КАНАЛОВ */
.user-profile-bar {
    height: 52px;
    background-color: #292b2f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

.user-info .username {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}
.logout-btn:hover {
    color: #fff;
}

/* 3. ЗОНА ЧАТА */
.chat-zone {
    flex: 1;
    background-color: var(--bg-chat);
    display: flex;
    flex-direction: column;
}

.chat-header {
    height: 48px;
    border-bottom: 1px solid #202225;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.chat-header .hashtag {
    color: var(--text-muted);
    font-size: 24px;
    font-weight: 300;
}

.chat-header h4 {
    color: #fff;
    font-size: 16px;
}

/* ОКНО ВЫВОДА СООБЩЕНИЙ */
.messages-display {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Кастомизация скроллбара */
.messages-display::-webkit-scrollbar {
    width: 8px;
}
.messages-display::-webkit-scrollbar-track {
    background: #2e3136;
}
.messages-display::-webkit-scrollbar-thumb {
    background: #202225;
    border-radius: 4px;
}

/* ЭЛЕМЕНТ СООБЩЕНИЯ */
.message-item {
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-body {
    display: flex;
    flex-direction: column;
}

.msg-author {
    color: #fff;
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 4px;
}

.msg-content {
    color: #dcddde;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
}

/* НИЖНЯЯ ЗОНА ВВОДА */
.input-area {
    padding: 0 20px 24px 20px;
}

.input-area input {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--bg-input);
    border: none;
    border-radius: 8px;
    color: #dcddde;
    font-size: 16px;
    outline: none;
}

.input-area input::placeholder {
    color: #72767d;
}