/* static/style.css */
/* Импорт стилей для меню выбора экрана */
@import url('screen-select-menu.css');

/* Стили для выбора микрофона */
.microphone-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: #2f3136;
    border-radius: 8px;
    border: 1px solid #4f545c;
}

.microphone-select {
    flex: 1;
    padding: 8px 12px;
    background: #36393f;
    border: 1px solid #4f545c;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.microphone-select:hover {
    border-color: #72767d;
}

.microphone-select:focus {
    border-color: #7289da;
    box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.2);
}

.refresh-btn {
    padding: 8px 12px;
    background: #4f545c;
    border: 1px solid #4f545c;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #5f6570;
    border-color: #5f6570;
}

.refresh-btn:active {
    transform: scale(0.98);
}

.microphone-info {
    margin-top: 10px;
    padding: 12px;
    background: #202225;
    border-radius: 6px;
    border: 1px solid #4f545c;
}

.microphone-info p {
    margin: 0 0 10px 0;
    color: #b9bbbe;
    font-size: 14px;
}

.microphone-info ul {
    margin: 0;
    padding-left: 20px;
    color: #b9bbbe;
    font-size: 14px;
}

.microphone-info li {
    margin-bottom: 5px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
}

/* Основной макет с боковой панелью */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Боковая панель */
.sidebar {
    width: 280px;
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    color: #7289da;
    font-size: 1.5rem;
    margin: 0;
}

/* Секция каналов */
.channels-section {
    flex: 1;
    padding: 20px 0;
}

.channels-header {
    padding: 0 20px 15px 20px;
}

.channels-header h3 {
    color: #b9bbbe;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-item {
    padding: 8px 20px;
    color: #b9bbbe;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

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

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

.channel-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #faa61a;
    border-radius: 0 3px 3px 0;
}

.channel-icon {
    font-size: 16px;
}

.channel-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.leave-channel-btn {
    background: rgba(237, 66, 69, 0.2);
    border: none;
    color: #ed4245;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.leave-channel-btn:hover {
    background: rgba(237, 66, 69, 0.4);
}

.channel-item:hover .leave-channel-btn,
.channel-item.active .leave-channel-btn {
    opacity: 1;
}

/* Секция участников голосового канала (под списком каналов) */
.voice-members-section {
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(79, 84, 92, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.voice-members-section::-webkit-scrollbar {
    width: 4px;
}

.voice-members-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.voice-members-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.voice-members-section::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 0;
}

.member-item {
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.member-item:hover {
    background: rgba(79, 84, 92, 0.3);
}

.member-item.speaking {
    background: rgba(67, 181, 129, 0.15);
}

.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-username {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #747f8d;
    transition: all 0.3s ease;
}

.status-indicator.speaking {
    background: #43b581;
    box-shadow: 0 0 6px #43b581;
    animation: pulse 1.5s infinite;
}

.member-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* .status-icon {
    font-size: 12px;
} */

/* Профиль пользователя */
.user-profile {
    padding: 15px 20px;
    background: rgba(79, 84, 92, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.user-avatar {
    position: relative;
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: hsl(248, 53%, 58%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .username {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .user-status {
    color: #43b581;
    font-size: 12px;
}

.settings-icon {
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.settings-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Основное содержимое */
.main-content {
    flex: 1;
    /* overflow-y: auto; */
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Скрываем старый заголовок h1, так как он теперь в боковой панели */
h1 {
    display: none;
}

.setup {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

input {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    font-size: 16px;
    flex: 1;
    min-width: 200px;
}

input:focus {
    outline: none;
    border-color: #7289da;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#joinBtn {
    background: #7289da;
    color: white;
}

#joinBtn:hover:not(:disabled) {
    background: #5b6eae;
}

#leaveBtn {
    background: #ed4245;
    color: white;
}

#leaveBtn:hover:not(:disabled) {
    background: #c03537;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.status p {
    margin-bottom: 8px;
    font-size: 16px;
}

.status span {
    font-weight: 600;
    color: #7289da;
}


/* Ползунок громкости - стиль YouTube */
.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.volume-slider {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.volume-slider::-webkit-slider-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #7289da;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(114, 137, 218, 0.5);
}

.volume-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(to right, #7289da 0%, #7289da var(--progress, 50%), rgba(255, 255, 255, 0.2) var(--progress, 50%));
    border-radius: 3px;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    border: none;
}

.volume-slider::-moz-range-progress {
    height: 6px;
    background: #7289da;
    border-radius: 3px;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #7289da;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(114, 137, 218, 0.5);
}

.volume-value {
    font-size: 12px;
    color: #fff;
    min-width: 35px;
    text-align: right;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#muteToggleBtn {
    background: #4f545c;
    color: white;
    flex: 1;
}

#deafenBtn {
    background: #4f545c;
    color: white;
    flex: 1;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Стили для секции демонстрации экрана */
.screen-share-section {
    background: rgba(255, 165, 26, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 165, 26, 0.3);
}

.screen-share-section h3 {
    margin-bottom: 15px;
    color: #faa61a;
    font-size: 1.1rem;
    text-align: center;
}

.screenshares-list {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.screen-share-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(255, 165, 26, 0.3);
}

.screen-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.screen-share-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #faa61a;
}

.screen-share-video {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    background: #000;
    margin: 0 auto;
    display: block;
}

.logs {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
}

.logs h3 {
    margin-bottom: 10px;
    color: #7289da;
}

#log {
    height: 150px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 5px;
    white-space: pre-wrap;
}

/* Стиль для участника, требующего взаимодействия */
.participant.needs-interaction {
    border: 2px dashed #faa61a !important;
    background: rgba(250, 166, 26, 0.1) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Индикатор необходимости клика */
.participant.needs-interaction::after {
    content: '🔊 Кликните для включения звука';
    font-size: 12px;
    color: #faa61a;
    margin-left: 10px;
    font-style: italic;
}

/* Стили для управления тишиной */
.silence-controls {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.silence-controls h3 {
    margin-bottom: 15px;
    color: #7289da;
    font-size: 1.1rem;
}

.silence-indicator {
    margin-bottom: 15px;
    text-align: center;
}

#silenceIndicator {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

#silenceIndicator.silent {
    background: rgba(237, 66, 69, 0.2);
    color: #ed4245;
    border: 1px solid #ed4245;
}

#silenceIndicator.speaking {
    background: rgba(67, 181, 129, 0.2);
    color: #43b581;
    border: 1px solid #43b581;
}

.volume-control-wrapper {
    margin-bottom: 15px;
}

.threshold-label {
    font-size: 12px;
    color: #ccc;
    text-align: center;
    margin-top: 5px;
}

#toggleSilenceBtn {
    width: 100%;
    background: #faa61a;
    color: white;
}

#toggleSilenceBtn:hover:not(:disabled) {
    background: #d48a15;
}

/* Стили для полоски громкости с ползунком порога */
.volume-meter {
    margin-bottom: 5px;
}

.volume-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
}

.volume-fill {
    height: 8px;
    width: 0%;
    background: #43b581;
    border-radius: 4px;
    transition: width 0.1s ease, background 0.3s ease;
    margin: 0 6px;
}

.threshold-slider {
    position: absolute;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    pointer-events: auto;
}

.threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #7289da;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.threshold-slider::-webkit-slider-thumb:hover {
    background: #5b6eae;
    transform: scale(1.1);
}

.threshold-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #7289da;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.threshold-slider::-moz-range-thumb:hover {
    background: #5b6eae;
    transform: scale(1.1);
}

/* Стили для контейнера видео с элементами управления */
.screen-video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.screen-video-container video {
    width: 100% !important;
    height: auto !important;
    display: block;
    max-width: none !important;
    max-height: none !important;
}

.screen-video-container:hover .screen-player-controls {
    opacity: 1;
}

/* Скрываем стандартные элементы управления видео */
.screen-share-video::-webkit-media-controls {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-panel {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-play-button {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-timeline {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-timeline-container {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-mute-button {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.screen-share-video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

/* Для Firefox */
.screen-share-video::-moz-media-controls {
    display: none !important;
}

/* Элементы управления плеером */
.screen-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000; /* Убедимся, что элементы управления поверх всего */
}

/* В полноэкранном режиме всегда показываем элементы управления */
:fullscreen .screen-player-controls,
:-webkit-full-screen .screen-player-controls,
:-moz-full-screen .screen-player-controls,
:-ms-fullscreen .screen-player-controls {
    opacity: 1 !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.7)) !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

/* Стили для полноэкранного режима */
:fullscreen .screen-video-container,
:-webkit-full-screen .screen-video-container,
:-moz-full-screen .screen-video-container,
:-ms-fullscreen .screen-video-container {
    all: initial !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
    z-index: 2147483647 !important;
}

:fullscreen .screen-share-video,
:-webkit-full-screen .screen-share-video,
:-moz-full-screen .screen-share-video,
:-ms-fullscreen .screen-share-video {
    all: initial !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: fill !important;
    position: static !important;
}

.screen-volume-icon {
    font-size: 14px;
    color: #fff;
    align-items: center;
}

.screen-volume-slider {
    padding: 0px;
    min-width: 10px;
    max-width: 100px;
}

.screen-volume-value {
    font-size: 12px;
    color: #fff;
    min-width: 35px;
    text-align: right;
    font-weight: 600;
}

/* Кнопки управления */
.screen-control-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.screen-stop-btn,
.screen-fullscreen-btn,
.screen-popout-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.screen-stop-btn {
    background: #ed4245;
    color: white;
}

.screen-stop-btn:hover {
    background: #c03537;
    transform: translateY(-1px);
}

.screen-fullscreen-btn {
    background: #7289da;
    color: white;
}

.screen-fullscreen-btn:hover {
    background: #5b6eae;
    transform: translateY(-1px);
}

.screen-popout-btn {
    background: #43b581;
    color: white;
    margin-left: auto;
}

.screen-popout-btn:hover {
    background: #368a66;
    transform: translateY(-1px);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .screen-player-controls {
        padding: 10px;
        opacity: 1; /* Всегда показываем на мобильных */
    }
    
    .screen-control-buttons {
        gap: 5px;
    }
    
    .screen-stop-btn,
    .screen-fullscreen-btn,
    .screen-popout-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .screen-volume-container {
        gap: 5px;
    }
    
    .screen-volume-slider {
        min-width: 80px;
    }
}

/* Стили для чата */
.chat-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-section h3 {
    margin-bottom: 15px;
    color: #7289da;
    font-size: 1.1rem;
    text-align: center;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 96vh;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.chat-container.dragover {
    border: 2px dashed #43b581;
    background: rgba(67, 181, 129, 0.1);
    transform: scale(1.02);
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(67, 181, 130, 0.514);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 10px;
}

.drag-hint {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
}

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

.chat-message.own {
    background: rgba(114, 137, 218, 0.2);
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message-content {
    flex: 1;
    min-width: 0;
}

.chat-message-username {
    font-weight: 600;
    font-size: 12px;
    color: #7289da;
    margin-bottom: 4px;
}

.chat-message.own .chat-message-username {
    color: #43b581;
    text-align: right;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    color: #fff;
}

.chat-message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.chat-message.media-message .chat-message-text {
    margin-bottom: 8px;
}

.chat-media {
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.chat-media img:hover {
    transform: scale(1.02);
}

.chat-media img {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-media video {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    border-radius: 8px;
    background: #000;
}

.chat-input-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
}

.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.file-upload-area:hover {
    border-color: #7289da;
    background: rgba(114, 137, 218, 0.1);
}

.file-upload-area.dragover {
    border-color: #43b581;
    background: rgba(67, 181, 129, 0.1);
    transform: scale(1.02);
}

.upload-hint {
    color: #999;
    font-size: 14px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

#chatInput:focus {
    border-color: #7289da;
}

.chat-buttons {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.attach-btn {
    padding: 10px 15px;
    background: #4f545c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.attach-btn:hover {
    background: #5b6eae;
    transform: translateY(-1px);
}

.send-btn {
    padding: 10px 20px;
    background: #43b581;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.send-btn:hover:not(:disabled) {
    background: #368a66;
    transform: translateY(-1px);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Модальное окно для изображений */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Стили для модального окна настроек */
.settings-modal {
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    background: #36393f;
    border-radius: 12px;
    border: 1px solid #4f545c;
    overflow: hidden;
}

.settings-header {
    background: #1e1e2e;
    padding: 20px;
    border-bottom: 1px solid #4f545c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    color: #ffffff;
    margin: 0;
    font-size: 1.5rem;
}

.settings-body {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    color: #7289da;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.settings-section .silence-indicator {
    margin-bottom: 15px;
    text-align: center;
}

.settings-section .volume-control-wrapper {
    margin-bottom: 15px;
}

.settings-section .threshold-label {
    font-size: 12px;
    color: #ccc;
    text-align: center;
    margin-top: 5px;
}

.settings-section .logs {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.settings-section .logs h3 {
    margin-bottom: 10px;
    color: #7289da;
}

.settings-section #log {
    height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 5px;
    white-space: pre-wrap;
}

/* Полоса прокрутки для настроек */
.settings-body::-webkit-scrollbar {
    width: 8px;
}

.settings-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.settings-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.settings-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Полоса прокрутки для чата */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Адаптивность чата */
@media (max-width: 768px) {
    .chat-container {
        height: auto;
    }
    
    .chat-message {
        padding: 8px;
    }
    
    .chat-media img,
    .chat-media video {
        max-width: 250px;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
    }
    
    .chat-buttons {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* Адаптивность для боковой панели и основного макета */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .rooms-section {
        padding: 15px;
    }
    
    .current-room-info {
        padding: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-header {
        text-align: center;
    }
    
    .room-buttons {
        flex-direction: row;
    }
    
    .room-buttons button {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .main-content {
        overflow-y: visible;
        padding: 15px;
    }
    
    .container {
        padding: 20px;
        border-radius: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .sidebar-header h2 {
        font-size: 1.2rem;
    }
    
    .rooms-section h3 {
        font-size: 0.9rem;
    }
    
    .room-controls select {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .room-buttons button {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 10px;
    }
    
    .participants h3,
    .screen-share-section h3,
    .silence-controls h3,
    .chat-section h3,
    .logs h3 {
        font-size: 1rem;
    }
    
    button {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    #muteToggleBtn,
    #deafenBtn {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Панель управления голосовым каналом */
.voice-control-panel {
    background: rgba(30, 30, 46, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    backdrop-filter: blur(10px);
}

.voice-panel-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.voice-panel-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.voice-panel-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #4f545c;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.voice-panel-btn:hover {
    background: #5b6eae;
    transform: translateY(-1px);
}

.voice-panel-btn:active {
    transform: translateY(0);
}

.voice-panel-btn.active {
    background: #ed4245;
}

.voice-panel-btn.active:hover {
    background: #c03537;
}

.voice-panel-exit {
    background: #4f545c;
}

.voice-panel-exit:hover {
    background: #ed4245;
}

.live-status {
    display: inline-flex;
    align-items: center;
    background: #ed4245;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* Контейнер для имени пользователя и статуса */
.member-username-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.btn-icon {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Адаптивность для панели управления */
@media (max-width: 768px) {
    .voice-control-panel {
        padding: 10px;
    }
    
    .voice-panel-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .voice-panel-buttons {
        gap: 6px;
    }
}

/* Стили для кнопки закрытия трансляции */
.screen-share-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #ed4245;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.screen-share-close-btn:hover {
    background: rgba(237, 66, 69, 0.1);
    transform: scale(1.1);
}

.screen-share-close-btn:active {
    transform: scale(0.95);
}

/* Стили для аватарок */
.user-avatar {
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover .avatar-placeholder {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(114, 137, 218, 0.5);
}

.avatar-placeholder {
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Анимация при загрузке аватарки */
@keyframes avatarUpload {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.user-avatar.uploading .avatar-placeholder {
    animation: avatarUpload 0.6s ease-in-out;
}

.crossed-element {
    position: relative;
    display: inline-block;
}

.cross-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking through */
}

.cross-line {
    position: absolute;
    width: 130%; /* Extends beyond emoji boundaries */
    height: 3px; /* Line thickness */
    background-color: #ff2400; /* Bright red color */
    border-radius: 8px; /* Rounded edges */
    top: 50%; /* Center vertically */
    left: -15%; /* Extend beyond left edge */
    transform: translateY(-50%) rotate(45deg); /* Diagonal line */
    transform-origin: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Стили для переключателя (как на телефонах) */
.toggle-switch-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.toggle-label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #4f545c;
    border-radius: 20px;
    transition: 0.4s;
    margin-left: 10px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .toggle-slider {
    background-color: #43b581;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.rnnoise-intensity-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.rnnoise-intensity-container.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.rnnoise-intensity-label {
    color: #b9bbbe;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.rnnoise-intensity-buttons {
    display: inline-flex;
}

.rnnoise-intensity-btn {
    padding: 6px 14px;
    background: #36393f;
    border: 1px solid #4f545c;
    color: #b9bbbe;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: none;
    border-radius: 0;
}

.rnnoise-intensity-btn:first-child {
    border-left: 1px solid #4f545c;
    border-radius: 4px 0 0 4px;
}

.rnnoise-intensity-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.rnnoise-intensity-btn:hover {
    background: #4f545c;
    color: #ffffff;
}

.rnnoise-intensity-btn.active {
    background: #7289da;
    border-color: #7289da;
    color: #ffffff;
}

.rnnoise-intensity-btn.active:hover {
    background: #5b6eae;
    border-color: #5b6eae;
}

.rnnoise-intensity-container.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.rnnoise-intensity-label {
    color: #b9bbbe;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.rnnoise-intensity-buttons {
    display: inline-flex;
}

.rnnoise-intensity-btn {
    padding: 6px 14px;
    background: #36393f;
    border: 1px solid #4f545c;
    color: #b9bbbe;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: none;
    border-radius: 0;
}

.rnnoise-intensity-btn:first-child {
    border-left: 1px solid #4f545c;
    border-radius: 4px 0 0 4px;
}

.rnnoise-intensity-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.rnnoise-intensity-btn:hover {
    background: #4f545c;
    color: #ffffff;
}

.rnnoise-intensity-btn.active {
    background: #7289da;
    border-color: #7289da;
    color: #ffffff;
}

.rnnoise-intensity-btn.active:hover {
    background: #5b6eae;
    border-color: #5b6eae;
}
}

.rnnoise-intensity-btn.active {
    background: #7289da;
    border-color: #7289da;
    color: #ffffff;
}

.rnnoise-intensity-btn.active:hover {
    background: #5b6eae;
    border-color: #5b6eae;
}
}

.rnnoise-intensity-btn.active:hover {
    background: #5b6eae;
}

/* Стили для переключателя (как на телефонах) */
.toggle-switch-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.toggle-label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #4f545c;
    border-radius: 20px;
    transition: 0.4s;
    margin-left: 10px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked + .toggle-slider {
    background-color: #43b581;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}