/* public/css/call/call-group.css */
/* ============================================= */
/* ГРУППОВОЙ ЗВОНОК – вертикальная раскладка     */
/* ============================================= */

/* Оверлей использует переменные темы */
.call-group.call-overlay {
    background: var(--call-overlay-bg, rgba(0, 0, 0, 0.95));
    backdrop-filter: blur(20px);
}

.call-group .call-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--call-container-bg, #1e1e2f);
    overflow: hidden;
}

/* Основной контент – flex-контейнер с растяжением */
.call-group .call-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background: #0a0a0a;
    align-items: stretch; /* чтобы дочерние элементы растягивались по высоте */
}

/* ---------- Режим спикера (центральное окно) ---------- */
.speaker-layout {
    flex: 1;
    display: flex;
    flex-direction: row;
    height: 100%;
    background: #0a0a0a;
}

/* Основное видео (экран или камера) */
.main-video {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.main-video-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    padding: 6px 16px;
    border-radius: 30px;
    color: white;
    font-size: 14px;
    pointer-events: none;
}

.main-fullscreen {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 18px;
}

.main-fullscreen:hover {
    opacity: 1;
}

/* Аватарка в главном окне (когда нет видео) */
.main-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    color: white;
}

.main-avatar-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.3);
    margin-bottom: 16px;
}

.main-avatar-icon {
    font-size: 160px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 16px;
}

.main-avatar-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.main-avatar-status {
    font-size: 16px;
    opacity: 0.7;
}

/* ---------- Кнопка "Вернуться к активному" ---------- */
.btn-return-auto {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: background 0.2s, transform 0.1s;
    z-index: 20;
}

.btn-return-auto:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-return-auto i {
    font-size: 14px;
}

/* ---------- Панель участников ---------- */
.call-group .participants-panel {
    width: 320px;
    background: var(--call-participant-panel-bg, rgba(30, 30, 47, 0.95));
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--call-glass-border);
    padding: 20px;
    overflow-y: auto;
    color: white;
    animation: slideInRight 0.25s ease;
    flex-shrink: 0;
    height: 100%;
}

.call-group .participants-panel h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--call-participant-item-border, rgba(255,255,255,0.05));
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.muted-icon, .video-off-icon {
    font-size: 12px;
    color: #ff9800;
}

.role-badge {
    background: var(--call-participant-role-bg, #3a3a4a);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
}

.join-requests-section {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--call-glass-border);
}

.section-title {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 8px;
}

/* ---------- Панель чата – теперь здесь, а не в call-fixed.css ---------- */
.call-group .in-call-chat-panel,
.call-group .in-call-chat {
    width: 320px;
    height: 100%;
    flex-shrink: 0;
    margin-left: auto;
    background: var(--call-participant-panel-bg, rgba(30, 30, 47, 0.95));
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--call-glass-border);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.25s ease;
    overflow: hidden;
}

/* ---------- Шапка (если используется) ---------- */
.call-group .call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    color: white;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.call-group .call-title {
    font-size: 18px;
    font-weight: 500;
}

.call-duration {
    margin-left: 12px;
    font-size: 14px;
    opacity: 0.7;
    font-family: monospace;
}

.header-buttons {
    display: flex;
    gap: 12px;
}

.btn-icon {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, transform 0.1s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.participants-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.request-badge {
    background: #ff9800;
}

/* ---------- Анимации ---------- */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---------- Индикатор голоса ---------- */
.main-video.speaking {
    box-shadow: 0 0 0 4px #4caf50, 0 0 20px rgba(76, 175, 80, 0.5);
    transition: box-shadow 0.1s ease;
}

body.light-theme .main-video.speaking {
    box-shadow: 0 0 0 4px #4caf50, 0 0 20px rgba(76, 175, 80, 0.5);
}

/* ---------- PiP для локального видео ---------- */
.call-local-pip {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 180px;
    height: 135px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
    background: #000;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .call-local-pip {
        width: 120px;
        height: 90px;
        bottom: 80px;
        right: 10px;
    }
}

/* ---------- Светлая тема – переопределения ---------- */
body.light-theme .call-group .call-container {
    background: var(--call-container-bg, #f5f5f5);
}

body.light-theme .call-group .call-header {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
    border-bottom-color: var(--border);
}

body.light-theme .call-group .participants-panel,
body.light-theme .call-group .in-call-chat-panel,
body.light-theme .call-group .in-call-chat {
    background: var(--call-participant-panel-bg, rgba(255, 255, 255, 0.95));
    color: var(--text);
}

body.light-theme .main-avatar {
    background: #f0f2f5;
    color: var(--text);
}

body.light-theme .main-avatar-img {
    border-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .main-avatar-icon {
    color: #b0b8c4;
}

body.light-theme .main-avatar-name {
    color: var(--text);
}

body.light-theme .main-avatar-status {
    color: var(--text-secondary);
}

body.light-theme .main-video {
    background: #000;
}

body.light-theme .main-video-element {
    background: #000;
}

body.light-theme .btn-return-auto {
    background: rgba(255, 255, 255, 0.85);
    color: #1e2a3a;
    border-color: rgba(0,0,0,0.15);
}

body.light-theme .btn-return-auto:hover {
    background: rgba(255, 255, 255, 1);
}

/* ---------- Лобби ---------- */
.call-group .lobby-view {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 32px;
    padding: 32px;
}


/* Индикатор голоса на основном видео */
.voice-indicator {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ccc;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none; /* чтобы не мешать кликам */
}

.voice-indicator .fa-microphone {
    transition: color 0.2s, transform 0.2s;
}

.voice-indicator .fa-microphone.active {
    color: #4caf50;
    animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Дополнительно: если хотите показывать уровень громкости в виде полоски */
.voice-indicator .level-bar {
    position: absolute;
    bottom: -4px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: #4caf50;
    border-radius: 2px;
    transform-origin: left;
    transition: transform 0.1s;
}




















/* Полоска уровня громкости */
.voice-level-bar {
    position: absolute;
    bottom: 70px;
    left: 20px;
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    z-index: 10;
    pointer-events: none; /* чтобы не мешать кликам */
}

.voice-level-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.1s ease;
    border-radius: 4px;
    width: 0%;
}