/* Основные стили для NodeSpeak веб-клиента */

:root {
    /* Цветовая схема */
    --primary-color: #5865f2;
    --primary-hover: #4752c4;
    --secondary-color: #4f545c;
    --success-color: #3ba55d;
    --danger-color: #ed4245;
    --warning-color: #faa61a;
    --info-color: #00d4aa;
    
    /* Фон */
    --bg-primary: #36393f;
    --bg-secondary: #2f3136;
    --bg-tertiary: #202225;
    --bg-quaternary: #18191c;
    
    /* Текст */
    --text-primary: #ffffff;
    --text-secondary: #b9bbbe;
    --text-muted: #72767d;
    --text-link: #00aff4;
    
    /* Границы */
    --border-color: #40444b;
    --border-radius: 8px;
    --border-radius-small: 4px;
    
    /* Тени */
    --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-large: 0 8px 16px rgba(0, 0, 0, 0.4);
    
    /* Размеры */
    --header-height: 60px;
    --footer-height: 80px;
    --sidebar-width: 240px;
    --panel-padding: 16px;
    
    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    user-select: none;
}

/* Утилиты */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn:focus {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #5d6269;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--border-radius-small);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-voice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-voice:hover {
    background-color: var(--secondary-color);
    color: var(--text-primary);
}

.btn-voice.active {
    background-color: var(--success-color);
    color: white;
}

.btn-voice.muted {
    background-color: var(--danger-color);
    color: white;
}

/* Формы */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
}

/* Экран загрузки */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-quaternary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    margin-bottom: 32px;
}

.loading-logo i {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.loading-logo h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Экран подключения */
.connection-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-quaternary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.connection-form {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-large);
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.form-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.connection-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.server-info h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.server-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Основной интерфейс */
.main-interface {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Верхняя панель */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--panel-padding);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-small);
}

.server-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-info i {
    color: var(--primary-color);
}

.server-info span {
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
}

.status-connected {
    background-color: rgba(59, 165, 93, 0.1);
    color: var(--success-color);
}

.status-connecting {
    background-color: rgba(250, 166, 26, 0.1);
    color: var(--warning-color);
}

.status-disconnected {
    background-color: rgba(237, 66, 69, 0.1);
    color: var(--danger-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Основной контент */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Панели */
.channels-panel,
.users-panel {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.users-panel {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--panel-padding);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-count {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 500;
}

/* Дерево каналов */
.channels-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    margin-bottom: 2px;
}

.channel-item:hover {
    background-color: var(--bg-primary);
}

.channel-item.active {
    background-color: var(--primary-color);
    color: white;
}

.channel-item.has-password::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: var(--text-muted);
}

.channel-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.channel-users {
    font-size: 12px;
    color: var(--text-muted);
}

/* Список пользователей */
.users-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    margin-bottom: 2px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.user-item:hover {
    background-color: var(--bg-primary);
}

.user-item-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.user-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.user-item-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
}

.user-item-status.away {
    background-color: var(--warning-color);
}

.user-item-status.busy {
    background-color: var(--danger-color);
}

.user-item-status.offline {
    background-color: var(--text-muted);
}

/* Панель чата */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--panel-padding);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-controls {
    display: flex;
    gap: 8px;
}

/* Сообщения */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-radius: var(--border-radius-small);
    transition: background-color var(--transition-fast);
}

.message:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.message-timestamp {
    font-size: 12px;
    color: var(--text-muted);
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    word-wrap: break-word;
}

.message.system {
    justify-content: center;
    font-style: italic;
    color: var(--text-muted);
    font-size: 13px;
}

.message.system .message-content {
    text-align: center;
}

/* Ввод сообщений */
.chat-input {
    padding: var(--panel-padding);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

/* Нижняя панель */
.bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--footer-height);
    padding: 0 var(--panel-padding);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.voice-controls {
    display: flex;
    gap: 12px;
}

.volume-controls {
    display: flex;
    gap: 16px;
}

.volume-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--bg-primary);
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
    border: none;
}

.connection-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-large);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--border-radius-small);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Вкладки */
.settings-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 16px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Горячие клавиши */
.hotkey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.hotkey-item:last-child {
    border-bottom: none;
}

.hotkey-input {
    width: 150px;
    text-align: center;
    font-family: monospace;
}

/* Уведомления */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-width: 300px;
    box-shadow: var(--shadow-medium);
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--info-color);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Скроллбары */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #5d6269;
}

/* Контекстные меню */
.context-menu {
    position: fixed;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 10002;
    min-width: 200px;
    padding: 8px 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: 14px;
}

.context-menu-item:hover {
    background-color: var(--bg-secondary);
}

.context-menu-item.danger {
    color: var(--danger-color);
}

.context-menu-item.danger:hover {
    background-color: rgba(237, 66, 69, 0.1);
}

.context-menu-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* Модальные окна - большие */
.modal-content.large {
    max-width: 800px;
    max-height: 90vh;
}

/* Разрешения */
.permissions-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.permissions-section {
    margin-bottom: 32px;
}

.permissions-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.permission-item {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: var(--border-radius-small);
    background-color: var(--bg-secondary);
}

.permission-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.permission-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-left: 30px;
}

.section-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-style: italic;
}

/* Информация о пользователе */
.user-info-content {
    display: flex;
    gap: 24px;
}

.user-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.user-details-section {
    flex: 1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    font-weight: 500;
    color: var(--text-secondary);
}

.info-row span {
    color: var(--text-primary);
    font-family: monospace;
}

.user-permissions-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.user-details h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.user-details p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}
@media (max-width: 768px) {
    :root {
        --sidebar-width: 200px;
        --panel-padding: 12px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .channels-panel,
    .users-panel {
        width: 100%;
        height: 200px;
    }
    
    .chat-panel {
        flex: 1;
        min-height: 0;
    }
    
    .bottom-bar {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    
    .volume-controls {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 480px) {
    .connection-form {
        margin: 20px;
        padding: 24px;
    }
    
    .modal-content {
        margin: 20px;
        max-width: none;
    }
    
    .notifications-container {
        left: 20px;
        right: 20px;
    }
    
    .notification {
        min-width: auto;
    }
}

/* Индикатор голосовой активности */
.voice-activity-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.voice-activity-bar {
    width: 60px;
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.voice-activity-indicator {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--success-color), var(--warning-color), var(--danger-color));
    border-radius: 2px;
    transition: width 0.1s ease;
}

.voice-activity-indicator.active {
    animation: pulse 0.5s ease-in-out infinite alternate;
}

.voice-activity-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes pulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Селектор режима ввода */
.input-mode-selector {
    margin-left: 16px;
}

.input-mode-selector select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 4px 8px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.input-mode-selector select:focus {
    border-color: var(--primary-color);
}

/* Кнопка передачи */
.btn-voice.transmitting {
    background-color: var(--success-color) !important;
    color: white !important;
    animation: transmit-pulse 1s ease-in-out infinite;
}

@keyframes transmit-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Настройки VAD и PTT */
.settings-section {
    margin: 24px 0;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.settings-section h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.vad-settings, .ptt-settings {
    margin-top: 16px;
}

.ptt-settings.hidden {
    display: none;
}

/* Слайдеры для VAD */
input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Поле ввода клавиши PTT */
#ptt-key {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    font-family: monospace;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
}

#ptt-key:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    margin-left: 8px;
}

/* Значения слайдеров */
#vad-threshold-value,
#vad-sensitivity-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 12px;
}

/* Адаптивность для нижней панели */
.bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--panel-padding);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    height: var(--footer-height);
    flex-wrap: wrap;
    gap: 16px;
}

.voice-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 300px;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    justify-content: flex-end;
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
    .bottom-bar {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    
    .voice-controls,
    .volume-controls,
    .connection-info {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
    
    .voice-activity-container {
        margin-left: 8px;
    }
    
    .input-mode-selector {
        margin-left: 8px;
    }
}

/* Темы */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f6f6;
    --bg-tertiary: #e3e5e8;
    --bg-quaternary: #ebedef;
    --text-primary: #2e3338;
    --text-secondary: #4f5660;
    --text-muted: #747f8d;
    --border-color: #e3e5e8;
}

.theme-light .voice-activity-indicator {
    background: linear-gradient(90deg, #3ba55d, #faa61a, #ed4245);
}

/* Размеры шрифта */
.font-size-small {
    font-size: 12px;
}

.font-size-medium {
    font-size: 14px;
}

.font-size-large {
    font-size: 16px;
}

/* Компактный режим */
.compact-mode .bottom-bar {
    height: 60px;
    padding: 0 12px;
}

.compact-mode .voice-activity-bar {
    width: 40px;
    height: 3px;
}

.compact-mode .btn-voice {
    padding: 6px;
}

.compact-mode .settings-section {
    padding: 12px;
    margin: 16px 0;
}
/* Активные состояния кнопок */
.btn-voice.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.btn-voice.muted {
    background-color: var(--danger-color) !important;
    color: white !important;
}

.btn-voice.deafened {
    background-color: var(--warning-color) !important;
    color: white !important;
}

/* Анимация для кнопки PTT */
.btn-voice.ptt-active {
    background-color: var(--success-color) !important;
    color: white !important;
    animation: ptt-pulse 0.8s ease-in-out infinite;
}

@keyframes ptt-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 165, 93, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 165, 93, 0);
    }
}

/* Улучшенные стили для кнопок голосового управления */
.btn-voice {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.btn-voice:hover {
    background-color: var(--bg-quaternary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-voice:active {
    transform: translateY(0);
}

/* Стили для уведомлений о состоянии */
.transmission-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.transmission-status.inactive {
    background-color: var(--text-muted);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Улучшенные стили для настроек */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Стили для групп настроек */
.settings-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 16px 0;
}

.settings-section h4 {
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 480px) {
    .voice-controls {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .btn-voice {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .voice-activity-bar {
        width: 40px;
    }
    
    .input-mode-selector select {
        font-size: 11px;
        padding: 2px 4px;
    }
}
/* Стили для списка пользователей */
.users-list {
    padding: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.user-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    margin-bottom: 2px;
}

.user-item:hover {
    background-color: var(--bg-tertiary);
}

.user-item.online {
    opacity: 1;
}

.user-item.offline {
    opacity: 0.5;
}

.user-item.muted .user-avatar::after {
    content: '🔇';
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 10px;
}

.user-item.deafened .user-avatar::after {
    content: '🔊';
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 10px;
}

/* Аватар пользователя */
.user-avatar {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Индикатор голоса */
.voice-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--bg-secondary);
    transition: all var(--transition-fast);
}

.voice-indicator.speaking {
    background-color: var(--success-color);
    animation: voice-pulse 1s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(59, 165, 93, 0.6);
}

@keyframes voice-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Информация о пользователе */
.user-info {
    flex: 1;
    min-width: 0;
}

.user-nickname {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Действия пользователя */
.user-actions {
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.user-item:hover .user-actions {
    opacity: 1;
}

.user-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.user-action-btn:hover {
    background-color: var(--bg-quaternary);
    color: var(--text-primary);
}

/* Заголовок панели пользователей */
.users-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.users-panel .panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.user-count {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .user-item {
        padding: 12px 8px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }
    
    .voice-indicator {
        width: 10px;
        height: 10px;
    }
    
    .user-nickname {
        font-size: 13px;
    }
    
    .user-status {
        font-size: 11px;
    }
}

/* Темная тема (по умолчанию) */
.user-item.online .user-avatar {
    border: 2px solid var(--success-color);
}

.user-item.away .user-avatar {
    border: 2px solid var(--warning-color);
}

.user-item.busy .user-avatar {
    border: 2px solid var(--danger-color);
}

.user-item.offline .user-avatar {
    border: 2px solid var(--text-muted);
}

/* Светлая тема */
.theme-light .user-item:hover {
    background-color: var(--bg-quaternary);
}

.theme-light .user-avatar {
    background-color: var(--bg-quaternary);
}

.theme-light .voice-indicator.speaking {
    box-shadow: 0 0 6px rgba(59, 165, 93, 0.4);
}
/* Выпадающее меню пользователя */
.user-menu {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    min-width: 200px;
    z-index: 1000;
    padding: 8px 0;
    margin-top: 4px;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

.dropdown-item.danger {
    color: var(--danger-color);
}

.dropdown-item.danger:hover {
    background-color: rgba(237, 66, 69, 0.1);
}

.dropdown-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* Диалог "О программе" */
.about-content {
    text-align: center;
    padding: 20px;
    max-width: 400px;
}

.about-logo {
    margin-bottom: 20px;
}

.about-logo i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.about-logo h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
}

.about-logo p {
    margin: 5px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.about-info {
    text-align: left;
}

.about-info p {
    margin: 10px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.about-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.about-info li {
    margin: 5px 0;
    color: var(--text-secondary);
}

/* Улучшенные стили для уведомлений */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
    max-width: 400px;
}

.notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-medium);
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--info-color);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
    margin-top: 2px;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.error .notification-icon {
    color: var(--danger-color);
}

.notification.warning .notification-icon {
    color: var(--warning-color);
}

.notification.info .notification-icon {
    color: var(--info-color);
}

.notification-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.notification-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Прогресс-бар для уведомлений с таймером */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width linear;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .notification-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }
    
    .dropdown-menu {
        left: 0;
        right: 0;
        min-width: auto;
    }
}