* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: #36393f;
    color: #dcddde;
    height: 100vh;
    overflow: hidden;
}

/* Логин */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #7289da 0%, #36393f 100%);
}

.login-box {
    background: #2f3136;
    padding: 40px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-box h2 {
    color: white;
    margin-bottom: 30px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #40444b;
    border: 1px solid #202225;
    border-radius: 4px;
    color: white;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #7289da;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.login-box button:hover {
    background: #677bc4;
}

.users-hint {
    margin-top: 20px;
    padding: 15px;
    background: #40444b;
    border-radius: 4px;
    font-size: 14px;
    color: #b9bbbe;
}

.error {
    background: #ed4245;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Основной интерфейс */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 240px;
    background: #202225;
    display: flex;
    flex-direction: column;
}

.server-header {
    padding: 20px;
    border-bottom: 1px solid #2f3136;
}

.server-header h3 {
    color: white;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.user-avatar-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-right: 8px;
}

.channels {
    padding: 20px;
    flex-grow: 1;
}

.channel-category {
    margin-bottom: 20px;
}

.channel-category h4 {
    color: #8e9297;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.channel-link {
    display: block;
    padding: 8px 10px;
    color: #8e9297;
    text-decoration: none;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.2s;
}

.channel-link:hover, .channel-link.active {
    background: #34373c;
    color: white;
}

.channel-link.voice {
    color: #43b581;
}

.online-users {
    padding: 20px;
    border-top: 1px solid #2f3136;
}

.user-item {
    padding: 5px 0;
    display: flex;
    align-items: center;
}

.user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ba55d;
    margin-right: 10px;
}

.logout-btn {
    padding: 15px;
    color: #ed4245;
    text-decoration: none;
    border-top: 1px solid #2f3136;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #ed4245;
    color: white;
}

/* Основной контент */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #36393f;
}

.chat-header, .voice-header {
    padding: 20px;
    border-bottom: 1px solid #2f3136;
    background: #36393f;
}

.messages-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    display: flex;
    margin-bottom: 20px;
    padding: 5px;
}

.message:hover {
    background: #32353b;
    border-radius: 4px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    flex-shrink: 0;
}

.message-content {
    flex-grow: 1;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.message-user {
    font-weight: bold;
    margin-right: 10px;
}

.message-time {
    color: #72767d;
    font-size: 12px;
}

.message-text {
    color: #dcddde;
    line-height: 1.4;
}

.message-input {
    padding: 20px;
    background: #36393f;
    border-top: 1px solid #2f3136;
}

.message-input form {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex-grow: 1;
    padding: 12px;
    background: #40444b;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 16px;
}

.message-input button {
    background: #7289da;
    color: white;
    border: none;
    border-radius: 4px;
    width: 50px;
    cursor: pointer;
    transition: background 0.3s;
}

.message-input button:hover {
    background: #677bc4;
}

/* Голосовые каналы */
.voice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-controls {
    display: flex;
    gap: 10px;
}

.btn-success, .btn-danger, .btn-secondary {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.btn-success {
    background: #43b581;
}

.btn-danger {
    background: #ed4245;
}

.btn-secondary {
    background: #4f545c;
}

.voice-container {
    flex-grow: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.video-container {
    position: relative;
    background: #202225;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.local-video video {
    transform: scaleX(-1); /* Зеркальное отображение для своей камеры */
}

.remote-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.voice-instructions {
    padding: 20px;
    background: #2f3136;
    margin: 20px;
    border-radius: 8px;
}

.voice-instructions ol {
    margin-left: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.voice-instructions li {
    margin: 5px 0;
}

/* Дополнительные стили */
.welcome-message {
    padding: 40px;
    text-align: center;
}

.features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.feature {
    background: #2f3136;
    padding: 30px;
    border-radius: 8px;
    width: 200px;
}

.feature i {
    font-size: 48px;
    color: #7289da;
    margin-bottom: 15px;
}

/* Полоса прокрутки */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2e3338;
}

::-webkit-scrollbar-thumb {
    background: #202225;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a1c20;
}