/* Call Widget Styles (v1.6) */

#call-widget {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #202225; /* Темный фон на весь экран */
    z-index: 1100;
    display: flex; /* По умолчанию flex, управляется display: none в HTML */
    flex-direction: column;
}

.call-participants-container {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 16px;
    justify-content: center;
    align-items: center;
}

.participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.participant-view {
    width: 40vw; /* Ширина относительно окна просмотра */
    max-width: 640px; /* Максимальная ширина */
    aspect-ratio: 16 / 9; /* Соотношение сторон */
    background-color: #36393f;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid transparent; /* Для эффекта говорящего */
    transition: border-color 0.2s;
}

.participant-view.speaking {
    border-color: #4285F4;
}

.participant-view video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-view .placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.participant-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.participant-avatar.big {
    width: 96px;
    height: 96px;
}

.participant-username {
    color: #dcddde;
    font-weight: 500;
}

/* Controls */
.call-controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: rgba(0,0,0,0.1);
}

.call-controls-left,
.call-controls-center,
.call-controls-right {
    display: flex;
    gap: 12px;
}

.call-control-button {
    background-color: #40444b;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.call-control-button:hover {
    background-color: #4f545c;
}

.call-control-button img {
    width: 24px;
    height: 24px;
}

.call-control-button.hang-up {
    background-color: #DB4437;
}
.call-control-button.hang-up:hover {
    background-color: #b93b30;
}

.call-control-button.active {
    background-color: #7289da; /* Синий цвет для активных кнопок */
}
.call-control-button.active:hover {
    background-color: #677bc4;
}

.call-control-button.utility {
    background-color: #2f3136;
}
.call-control-button.utility:hover {
    background-color: #3a3c43;
}


/* --- Модальное окно настроек звонка --- */
.modal.call-settings .modal-content {
    width: 400px;
}

.settings-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #8e9297;
    text-transform: uppercase;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-container img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.slider-container input[type="range"] {
    flex: 1;
}

.styled-select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #202225;
    background-color: #2f3136;
    color: #dcddde;
    font-size: 0.95rem;
}

/* --- Мини-панель звонка --- */
#minimized-call-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background-color: #5865f2; /* Яркий фон для заметности */
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.app-container.call-minimized {
    padding-top: 48px; /* Сдвигаем основной контент вниз */
}

#minimized-call-bar .call-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

#minimized-call-bar .call-info img {
    width: 20px;
    height: 20px;
}

#minimized-call-bar .btn {
    background-color: hsla(0, 0%, 100%, .2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

#minimized-call-bar .btn:hover {
    background-color: hsla(0, 0%, 100%, .3);
}

/* --- Aurora Theme Overrides --- */
.aurora-theme #call-widget {
    background-color: transparent; /* Убираем сплошной фон */
}

.aurora-theme .participant-view {
    /* Применяем тот же эффект, что и к другим панелям */
    background-color: rgba(30, 32, 35, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

.aurora-theme .call-controls-container {
    /* Делаем панель управления "стеклянной" */
    background-color: rgba(30, 32, 35, 0.45);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.125);
    margin: 16px;
    border-radius: 12px;
}

.aurora-theme .participant-username {
    color: #f1f2f6;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.fullscreen-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.participant-view:hover .fullscreen-button {
    opacity: 1;
}

.fullscreen-button img {
    width: 20px;
    height: 20px;
}

/* --- Fullscreen Mode Styles --- */
#remote-participant:fullscreen .participant-view {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
}

#remote-participant:fullscreen .participant-info {
    /* Скрываем имя пользователя в полноэкранном режиме для чистоты */
    display: none;
}
