* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background-color: #0a0a0a;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle, #1a0505 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* АВТОРИЗАЦИЯ */
.auth-container { text-align: center; width: 100%; max-width: 420px; padding: 20px; transition: all 0.5s ease; }
h1 { font-family: 'Orbitron', sans-serif; font-size: 3.5rem; letter-spacing: 4px; color: #ff0055; text-shadow: 0 0 20px #ff0055; margin-bottom: 5px; }
.subtitle { font-size: 0.9rem; color: #888888; margin-bottom: 25px; letter-spacing: 2px; text-transform: uppercase; }
.auth-box { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 0, 85, 0.2); padding: 30px; border-radius: 12px; box-shadow: 0 0 40px rgba(255, 0, 85, 0.05); backdrop-filter: blur(15px); }
.tabs { display: flex; margin-bottom: 25px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.tab-btn { flex: 1; padding: 10px; background: none; border: none; color: #888888; font-size: 1rem; font-weight: 600; cursor: pointer; text-transform: uppercase; border-bottom: 2px solid transparent; }
.tab-btn.active { color: #ff0055; border-bottom: 2px solid #ff0055; text-shadow: 0 0 10px #ff0055; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; font-size: 0.75rem; color: #ff0055; text-transform: uppercase; margin-bottom: 8px; font-weight: 600; }
.input-group input { width: 100%; padding: 12px 16px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; color: #ffffff; outline: none; }
.input-group input:focus { border-color: #ff0055; box-shadow: 0 0 10px rgba(255, 0, 85, 0.3); }
.btn-action { width: 100%; padding: 14px; background: #ff0055; border: none; border-radius: 6px; color: #ffffff; font-weight: 600; text-transform: uppercase; cursor: pointer; box-shadow: 0 0 15px rgba(255, 0, 85, 0.4); }
#system-log { margin-top: 20px; font-family: 'Orbitron', sans-serif; font-size: 0.85rem; color: #00ff66; text-shadow: 0 0 10px #00ff66; }

/* ГЛАВНОЕ МЕНЮ МЕССЕНДЖЕРА */
.app-interface { display: none; width: 100vw; height: 100vh; background: #070707; border: 1px solid rgba(255, 0, 85, 0.1); }

/* Сайдбар серверов */
.sidebar-servers { width: 80px; height: 100%; background: #030303; border-right: 1px solid rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; align-items: center; padding-top: 20px; gap: 15px; }
.server-icon { width: 50px; height: 50px; background: #111; border-radius: 50%; border: 1px solid rgba(255, 0, 85, 0.3); display: flex; align-items: center; justify-content: center; font-weight: 600; color: #ff0055; cursor: pointer; transition: all 0.3s; font-family: 'Orbitron', sans-serif; }
.server-icon:hover, .server-icon.active { border-radius: 30%; background: #ff0055; color: #fff; box-shadow: 0 0 15px #ff0055; }
.add-server { border: 1px dashed #888; color: #888; }
.add-server:hover { border-color: #00ff66; color: #00ff66; box-shadow: 0 0 15px #00ff66; }

/* Сайдбар каналов */
.user-panel { width: 240px; height: 100%; background: #050505; border-right: 1px solid rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; justify-content: space-between; padding: 20px 10px; }
.profile-section { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 10px; }
.avatar-wrapper { position: relative; width: 90px; height: 90px; cursor: pointer; }
.avatar-img { width: 100%; height: 100%; background: #111; border-radius: 50%; border: 2px solid #ff0055; object-fit: cover; box-shadow: 0 0 15px rgba(255, 0, 85, 0.3); }
.avatar-wrapper:hover .avatar-img { border-color: #00ff66; box-shadow: 0 0 15px #00ff66; }
.avatar-hint { position: absolute; bottom: 0; background: rgba(0,0,0,0.7); font-size: 0.65rem; width: 100%; text-align: center; padding: 2px 0; border-radius: 0 0 50% 50%; color: #888; }
.profile-name { font-family: 'Orbitron', sans-serif; font-size: 1.1rem; color: #fff; }
.nav-channels { display: flex; flex-direction: column; gap: 5px; margin-top: 20px; flex: 1; width: 100%; padding: 0 5px; }
.channel-type { font-size: 0.7rem; text-transform: uppercase; color: #555; letter-spacing: 1px; font-weight: bold; margin-bottom: 5px; padding-left: 5px; }
.channel-link { padding: 8px 10px; background: transparent; border-radius: 50px; font-size: 0.9rem; color: #888; cursor: pointer; border-left: 2px solid transparent; transition: all 0.2s ease; }
.channel-link.active, .channel-link:hover { color: #fff; background: rgba(255, 0, 85, 0.05); border-left-color: #ff0055; }
.voice-link:hover { background: rgba(0, 255, 102, 0.03); border-left-color: #00ff66; color: #00ff66; }

/* ПАНЕЛЬ ГОЛОСОВОГО СТАТУСА (КАК В ДС) */
.voice-status-panel { display: none; background: #020202; border: 1px solid rgba(0, 255, 102, 0.2); border-radius: 8px; padding: 12px; margin-top: auto; flex-direction: column; gap: 10px; box-shadow: 0 0 20px rgba(0,255,102,0.05); }
.vc-info { text-align: left; padding-left: 5px; }
.vc-state { font-size: 0.75rem; color: #00ff66; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 0 5px #00ff66; }
.vc-name { font-size: 0.85rem; color: #888; margin-top: 2px; }
.vc-controls { display: flex; justify-content: space-between; gap: 8px; }
.vc-btn { flex: 1; padding: 8px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; color: #fff; cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.vc-btn:hover { background: rgba(255,255,255,0.08); border-color: #ff0055; }
.vc-btn.disconnect-btn { background: rgba(255, 0, 85, 0.1); border-color: rgba(255,0,85,0.3); }
.vc-btn.disconnect-btn:hover { background: #ff0055; box-shadow: 0 0 15px #ff0055; }

/* Зона чата и МЕДИА-СТРИМА */
.main-chat-area { flex: 1; height: 100%; display: flex; flex-direction: column; background: #090909; }
.chat-header { height: 60px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); display: flex; align-items: center; padding: 0 20px; font-weight: 600; color: #ff0055; font-family: 'Orbitron', sans-serif; font-size: 0.9rem; }

/* ОКНО ТРАНЗАКЦИИ СТРИМА (ВЕБКА + ДЕМКА) */
.stream-window { display: none; width: calc(100% - 40px); height: 260px; background: #030303; margin: 20px 20px 0 20px; border: 1px solid rgba(255, 0, 85, 0.3); border-radius: 8px; overflow: hidden; position: relative; box-shadow: 0 0 35px rgba(255,0,85,0.05); }
.stream-window video { width: 100%; height: 100%; object-fit: cover; background: #000; transform: scaleX(-1); /* Зеркалим вебку для удобства */ }
.stream-overlay-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: 'Orbitron', sans-serif; font-size: 0.85rem; color: #ff0055; text-shadow: 0 0 10px #ff0055; pointer-events: none; letter-spacing: 1px; }

.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.msg { background: rgba(255, 255, 255, 0.02); padding: 12px 16px; border-radius: 8px; border-left: 3px solid #ff0055; max-width: 80%; text-align: left; }
.msg-author { font-size: 0.8rem; color: #ff0055; font-weight: 600; margin-bottom: 4px; }

/* Ввод сообщений */
.chat-input-area { height: 70px; padding: 15px 20px; border-top: 1px solid rgba(255, 255, 255, 0.05); display: flex; gap: 15px; }
.chat-input-area input { flex: 1; background: #030303; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 0 15px; color: #fff; outline: none; }
.chat-input-area input:focus { border-color: #ff0055; }
.btn-send { padding: 0 25px; background: #ff0055; border: none; border-radius: 6px; color: #fff; font-weight: 600; cursor: pointer; text-transform: uppercase; }

/* МОДАЛЬНОЕ ОКНО */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); z-index: 999; align-items: center; justify-content: center; }
.modal-box { background: #0d0d0d; border: 1px solid rgba(255, 0, 85, 0.3); padding: 30px; border-radius: 12px; width: 100%; max-width: 380px; box-shadow: 0 0 50px rgba(255, 0, 85, 0.1); text-align: center; }
.modal-box h2 { font-family: 'Orbitron', sans-serif; color: #ff0055; text-shadow: 0 0 15px #ff0055; text-transform: uppercase; font-size: 1.5rem; letter-spacing: 1px; }
/* КНОПКА ЗАБЫЛ ПАРОЛЬ */
.btn-forgot {
    background: none;
    border: none;
    color: #ff0055;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
    transition: all 0.3s;
}
.btn-forgot:hover {
    color: #ffffff;
    text-shadow: 0 0 15px #ffffff;
}
/* СПИСОК УЧАСТНИКОВ В ГОЛОСОВОМ КАНАЛЕ */
.user-list-vc {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding-left: 30px;
    margin-bottom: 10px;
    text-align: left;
}
.vc-user-item {
    font-size: 0.8rem;
    color: #aaaaaa;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vc-user-avatar-mini {
    width: 16px;
    height: 16px;
    background: #ff0055;
    border-radius: 50%;
    box-shadow: 0 0 5px #ff0055;
}
/* ПУЛЬСАЦИЯ РАЗГОВОРА (СИМУЛЯЦИЯ БАЗАРА) */
@keyframes voicePulse {
    0% { text-shadow: 0 0 5px #00ff66; color: #00ff66; }
    50% { text-shadow: 0 0 15px #00ff66, 0 0 25px #00ff66; color: #fff; }
    100% { text-shadow: 0 0 5px #00ff66; color: #00ff66; }
}
.vc-speaking {
    animation: voicePulse 1s infinite;
}
/* КНОПКА НАЙТИ ДРУГА */
.btn-find-friend {
    width: 100%;
    padding: 12px;
    background: rgba(255, 0, 85, 0.08);
    border: 1px solid rgba(255, 0, 85, 0.3);
    border-radius: 50px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.1);
}
.btn-find-friend:hover, .btn-find-friend.active {
    background: #ff0055;
    border-color: #ff0055;
    box-shadow: 0 0 20px #ff0055;
    text-shadow: 0 0 5px #fff;
}
/* ПРАВЫЙ СПИСОК УЧАСТНИКОВ */
.member-category { font-size: 0.7rem; text-transform: uppercase; color: #555; font-weight: bold; letter-spacing: 1px; margin-bottom: 15px; }
.member-item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #888; margin-bottom: 12px; font-weight: 600; }
.member-avatar-status { width: 10px; height: 10px; border-radius: 50%; background: #00ff66; box-shadow: 0 0 8px #00ff66; }
/* ============================================================
   RIGHT MEMBERS SIDEBAR
   ============================================================ */

.sidebar-members {
    width: 220px;
    height: 100%;
    flex-shrink: 0;
    background: #050505;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px 15px;
    overflow-y: auto;
}

.sidebar-members::-webkit-scrollbar {
    width: 5px;
}

.sidebar-members::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 85, 0.35);
    border-radius: 10px;
}

.sidebar-members::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================================
   FRIEND SEARCH
   ============================================================ */

#friend-search-panel input:focus {
    border-color: #ff0055 !important;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.2);
}

#friend-search-results .btn-find-friend {
    margin-bottom: 0;
}

/* ============================================================
   REMOTE MEDIA
   ============================================================ */

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* ============================================================
   VOICE USER
   ============================================================ */

.vc-user-item {
    transition: all 0.2s ease;
}

.vc-user-item:hover {
    color: #fff;
}

.vc-user-item .vc-user-avatar-mini {
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
    .sidebar-members {
        display: none;
    }
}

@media (max-width: 800px) {
    .sidebar-servers {
        width: 65px;
    }

    .user-panel {
        width: 210px;
    }

    .chat-header {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    .sidebar-servers {
        width: 55px;
    }

    .server-icon {
        width: 42px;
        height: 42px;
    }

    .user-panel {
        width: 180px;
    }

    .stream-window {
        width: calc(100% - 20px);
        margin: 10px 10px 0;
    }

    .chat-messages {
        padding: 10px;
    }

    .chat-input-area {
        padding: 10px;
        gap: 8px;
    }

    .btn-send {
        padding: 0 12px;
    }
}
/* ============================================================
   DISRUPT SERVER / MEMBERS / FRIENDS / WEBRTC
   ============================================================ */

.server-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.channel-type-spaced {
    margin-top: 20px;
}

.empty-server {
    color: #555;
    text-align: center;
    margin-top: 30px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.sidebar-members {
    width: 220px;
    height: 100%;
    background: #050505;
    border-left: 1px solid rgba(255,255,255,0.05);
    padding: 25px 15px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-members::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.sidebar-members::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,0,85,0.35);
    border-radius: 10px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 30px;
}

.member-name {
    color: #aaa;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-offline {
    opacity: 0.35;
}

.status-offline {
    background: #444 !important;
    box-shadow: none !important;
}

.offline-category {
    margin-top: 25px;
}

.member-avatar-small {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255,0,85,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff0055;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.member-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friends-list {
    width: 100%;
    margin-bottom: 10px;
}

.friend-item {
    padding: 8px 10px;
    border-radius: 7px;
    color: #999;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}

.friend-item:hover {
    color: #fff;
    background: rgba(255,0,85,0.08);
}

.friend-status {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00ff66;
    box-shadow: 0 0 7px #00ff66;
    margin-right: 7px;
}

.friend-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.friend-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 7px;
    color: #aaa;
}

.friend-add-button {
    background: rgba(255,0,85,0.1);
    border: 1px solid rgba(255,0,85,0.3);
    color: #ff0055;
    padding: 5px 9px;
    border-radius: 5px;
    cursor: pointer;
}

.friend-add-button:hover {
    background: #ff0055;
    color: #fff;
}

.modal-cancel {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
}

.msg-time {
    margin-top: 6px;
    font-size: 0.65rem;
    color: #444;
}

.vc-user-item {
    transition: 0.2s;
}

.vc-user-item.vc-speaking {
    color: #fff;
    text-shadow:
        0 0 5px #00ff66,
        0 0 12px #00ff66;
}

.vc-user-item.vc-speaking
.vc-user-avatar-mini {
    background: #00ff66 !important;
    box-shadow:
        0 0 8px #00ff66,
        0 0 15px #00ff66;
}

.vc-user-avatar-mini.vc-speaking {
    background: #00ff66 !important;
    box-shadow: 0 0 15px #00ff66 !important;
}

.remote-streams {
    position: absolute;
    inset: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    pointer-events: none;
}

.remote-video {
    width: 220px;
    height: 140px;
    object-fit: cover;
    background: #000;
    border: 1px solid rgba(255,0,85,0.35);
    border-radius: 7px;
    box-shadow: 0 0 20px rgba(255,0,85,0.1);
}

.stream-window {
    position: relative;
}

#local-video {
    position: relative;
    z-index: 1;
}

.remote-streams {
    z-index: 2;
}

@media (max-width: 900px) {

    .sidebar-members {
        display: none;
    }

    .user-panel {
        width: 210px;
    }

    .sidebar-servers {
        width: 65px;
    }

}

@media (max-width: 650px) {

    .user-panel {
        width: 180px;
    }

    .chat-header {
        font-size: 0.7rem;
    }

    .btn-send {
        padding: 0 12px;
    }

}