
/* style-call.css */


.profile-modal-call-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #18b800;
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 100;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    width: 100px;
    height: 100px;
    margin: 20px auto 0px;
    justify-content: center;
    flex-direction: column;
}

.profile-modal-call-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.profile-modal-call-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.profile-modal-call-button img {
    width: 36px;
}

.profile-modal-call-button svg {
    width: 60px;
    height: 40px;
    vertical-align: middle;
}

/* Стили для модального окна уведомления о входящем звонке */
.incoming-call-notification {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #272727;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: translateX(100%);
    opacity: 0;
}

.incoming-call-notification.active {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    backdrop-filter: blur(8px);
}

.incoming-call-notification .notification-header {
    display: flex;
    justify-content: center;
    align-items: center;
}

.incoming-call-notification .notification-header span {
    font-size: 20px;
    color: #ffffff;
}

.incoming-call-notification .notification-close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
    display: none; /* Изначально скрыта, активируется JS */
}

.incoming-call-notification .notification-close-button.active {
    display: block; /* Показываем, когда звонок завершен/отклонен */
}

.incoming-call-notification .notification-close-button:hover {
    color: #555;
}

.incoming-call-notification .notification-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.incoming-call-notification .notification-avatar-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0; /* Фоновый цвет для аватара */
    box-shadow: 0px 0px 12px 0px #fccaff, 0px 0px 49px 0px #ff86f0, 0px 0px 65px 0px #b984ff;
}

.incoming-call-notification .notification-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.incoming-call-notification .notification-initial-letter {
    font-size: 40px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.incoming-call-notification .notification-text {
    font-size: 13px;
    color: #00ff68;
    margin: 0;
    text-align: center;
}

.incoming-call-notification .notification-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.incoming-call-notification .notification-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-width: 130px;
    padding: 10px 15px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.incoming-call-notification .accept-button {
    background-color: #18b800;
    color: white;
}


.incoming-call-notification .accept-button img {
    transform: rotate(0deg);
    animation-name: wiggle;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}
@keyframes wiggle {
  0% {transform: rotate(0deg);}
  10% {transform: rotate(-20deg);}
  20% {transform: rotate(20deg);}
  30% {transform: rotate(-20deg);}
  40% {transform: rotate(0deg);}
  100% {transform: rotate(0deg);}
}

.incoming-call-notification .accept-button:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.incoming-call-notification .reject-button {
    background-color: #ff2312; /* Красный */
    color: white;
}

.incoming-call-notification .reject-button img{
    transform: rotate(90deg);
}

.incoming-call-notification .reject-button:hover {
    background-color: #ff5061;
    transform: translateY(-1px);
}

.incoming-call-notification .notification-button svg {
    width: 20px;
    height: 20px;
}


/* Стили для модального окна активного звонка (перекрывает все) */
.active-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #001d4787;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    backdrop-filter: blur(6px);
}



/* Модалка предупреждения о перезагрузке при активном звонке */
.reload-confirm-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    z-index: 4000; /* выше, чем active-call-overlay (3000) */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.reload-confirm-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.reload-confirm-content {
    background: radial-gradient(circle at top, #1f2933 0%, #10141a 55%, #05070b 100%);
    border-radius: 18px;
    padding: 20px 22px;
    max-width: 420px;
    width: 90%;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(0, 255, 104, 0.06);
    color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reload-confirm-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #f5f5f5;
}

.reload-confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.reload-confirm-button {
    min-width: 140px;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Кнопка "Перезагрузить" — красная, как end call */
.reload-confirm-button.reload-confirm-reload {
    background-color: #ff2312;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 35, 18, 0.5);
}

.reload-confirm-button.reload-confirm-reload:hover {
    background-color: #ff4b3e;
    transform: translateY(-1px);
}

.reload-confirm-button.reload-confirm-reload:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 35, 18, 0.35);
}

/* Кнопка "Отмена" — тёмно-серая, нейтральная */
.reload-confirm-button.reload-confirm-cancel {
    background-color: #30353f;
    color: #ffffff;
}

.reload-confirm-button.reload-confirm-cancel:hover {
    background-color: #3d4451;
    transform: translateY(-1px);
}

.reload-confirm-button.reload-confirm-cancel:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Адаптивность для узких экранов */
@media (max-width: 480px) {
    .reload-confirm-content {
        padding: 18px 16px;
        max-width: 95%;
    }

    .reload-confirm-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .reload-confirm-button {
        width: 100%;
    }
}

/* Узкая полоска состояния активного звонка (для других вкладок) */
.active-call-mini-bar {
    position: fixed;
    bottom: 15%;
    right: 0%;
    transform: translate(0%, 0%);
    width: 93px;
    padding: 16px;
    border-radius: 10px;
    background: #1f2933;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    z-index: 47;
    transition: 0.25s ease-out;
    flex-direction: column;
}

.active-call-mini-bar.active {
    opacity: 1;
    pointer-events: auto;
}

.active-call-mini-bar-text {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.active-call-mini-bar-end {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background-color: #ff2312;
    color: #ffffff;
    transition: 0.2s ease;
    white-space: nowrap;
}

.active-call-mini-bar-end:hover {
    background-color: #ff4b3e;
    transform: translateY(-1px);
}

.active-call-mini-bar-end:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 35, 18, 0.4);
}

@media (max-width: 600px) {
    .active-call-mini-bar {
    }

    .active-call-mini-bar-end {
        padding: 5px 10px;
        font-size: 11px;
    }
}


.active-call-overlay.active {
    opacity: 1;
    visibility: visible;
}

.active-call-content {
    background: linear-gradient(#161616, #1e1e1e);
    color: #000;
    padding: 0px;
    border-radius: 20px;
    text-align: center;
    width: -webkit-fill-available;
    height: 100%;
    max-width: 620px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    animation: fadeInScale 0.4s ease-out forwards;
    flex-wrap: nowrap;
    justify-content: space-between;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9);}
    to { opacity: 1; transform: scale(1);}
}

.active-call-overlay .call-close-button {
    background: none;
    font-size: 50px;
    transition: color 0.2s ease, transform 0.2s ease;
    display: none;
    transform: rotate(0deg);
    padding: 0;
    right: 24px;
    top: 20px;
}

.active-call-overlay .call-close-button.active {
}

.active-call-overlay .call-close-button:hover {
    transform: rotate(90deg);
}

.active-call-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    margin-top: 9%;
}

.active-call-avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #7f97b1;
    box-shadow: 0px 0px 12px 0px #fccaff, 0px 0px 49px 0px #ff86f0, 0px 0px 65px 0px #b984ff;
}

.active-call-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.active-call-initial-letter {
    font-size: 60px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.active-call-username {
    font-size: 2.2em;
    margin: 0;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    FONT-WEIGHT: 100;
}

.active-call-status {
    font-size: 17px;
    color: #ffffff69;
    margin: 0;
    font-weight: 100;
}

.active-call-timer {
    FONT-WEIGHT: 100;
    font-size: 46px;
    color: #fff;
    margin: 0px;
}

.active-call-controls {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    z-index: 1;
}







.call-control-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    width: 70px;
    height: 70px;
    border-radius: 40%;
    background-color: #ffffff2b;
    color: white;
    border: none;
    cursor: pointer;
    transition: 0.3s ease;
    background: #282b33;
    box-shadow: 0px 3px 10px #2a5aff;
    border-bottom: 1px solid #00adff;
    }
.call-control-button:hover {
    transform: translateY(-2px);}
.call-control-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);}
.call-control-button img{
    width: 30px;
    }
.call-control-button svg {
    width: 30px;
    height: 30px;}
.call-control-button.end-button {
    background-color: #ff2312;
    background-color: #ff2312;
    box-shadow: 0px 3px 10px #ff2a2a;
    border-bottom: 1px solid #fba5a5;
    }
.call-control-button.end-button img {
    transform: rotate(105deg);
    display: block;
    margin: 0 auto;
    padding: 0;
    }
.call-control-button.end-button:hover {
    background-color: #d32f2f;}
.call-control-button.call-again-button {
    background-color: #00a107;
    box-shadow: 0px 3px 10px #2aff7f;
    border-bottom: 1px solid #a9ff00;
    }/* Повтор звонка */
.call-control-button.call-again-button:hover {
    background-color: #45a049; } /* Повтор звонка при наведении */
.call-control-button.mute-button.active {
    opacity: 0.3;}
.call-control-button.mute-button.muted {
    background-color: #0000001a}
.call-control-button.mute-button.muted svg {
    color: #000;}
.call-control-screen-sharing {
flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    width: 70px;
    height: 70px;
    border-radius: 40%;
    color: white;
    display: flex;
    border: none;
    cursor: pointer;
    transition: 0.3s ease;
    background: #232d3b00;
    box-shadow: 0px 3px 10px #2a5aff;
    border-bottom: 1px solid #00adff;
    }
.call-control-screen-sharing img {
    width: 35px;
    }
.callwidget-fullscreen-btn {
    position: absolute;
    right: 8px;
    top: 2%;
    z-index: 20;
    padding: 4px 8px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 26px;
    background: #2e3138;
    color: #fff;
    display: block;
    width: 40px;
    height: 40px;
    line-height: 1;
    }





    
/* video control buttons */
.call-control-button.camera-button {
}
.call-control-button.camera-button img {
    width: 30px;}
.call-control-button.camera-button.off {
    background-color: #0000001a;}
.call-control-button.camera-button.off svg {
    color: #000;}
.call-control-button.camera-button.active {
    background-color: #006ec2;}
#remoteAudio {
    display: none;
}


/* Адаптивность для маленьких экранов */
@media (max-width: 600px) {
    .incoming-call-notification {width: fit-content;}
    .incoming-call-notification .notification-buttons {width: 100%;}
    .incoming-call-notification .notification-button {width: min-content; min-width: 140px;}
    /* .active-call-content {width: 75%;} */
    .active-call-username {font-size: 30px;}
    .active-call-timer {font-size: 50px;}
    .active-call-controls {gap: 7px;}
    .call-control-button { }
    .call-control-button svg {width: 24px; height: 24px;}
}







/* Крестик закрытия в модалке звонка */
.active-call-content {
  position: relative; /* ОБЯЗАТЕЛЬНО, чтобы absolute у крестика был привязан к модалке */
}

.active-call-content .modal-close-button,
.active-call-content .call-close-button {
position: absolute;
top: 0px;
right: 0px;
width: 39px;
height: 39px;
z-index: 999;
border: none;
cursor: pointer;
color: #ffffff3b;
background: #ffffff14;
display: flex;
line-height: 0;
padding: 14px;
font-size: 33px;
border-radius: 0px 20px 0px 10px;
transition: 0.2s ease;
justify-content: center;
align-items: center;
}

.active-call-content .modal-close-button:hover,
.active-call-content .call-close-button:hover {
    background-color: #990b00;
    color: #fff;
    border-radius: 20px 0px 10px 0px;
}











/* VIDEO CALLS */
.video-call-container {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    z-index: 0;
    top: 0px;
    left: 0;
    width: 100%;
    height: 82%;
    background: no-repeat;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-direction: column;
    gap: 10px;
}
.video-call-container.active {
    opacity: 1;
    visibility: visible;
}

.local-video, .remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: none;
    border-radius: 15px 15px 0px 0px;
}
.local-video {
    position: absolute;
    bottom: 0;
    width: 70px;
    height: 70px;
    border: 0px solid #fff;
    z-index: 0;
    background: #00000040;
    border-radius: 10px;
    box-shadow: 0 0px 5px #0000004d;
}
.local-video.hidden {
    transform: translateX(calc(100% + 20px)); 
}
.remote-video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.video-status-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    z-index: 0;
    display: none;
}
.video-status-message.active {
    display: block;
}

.close-remote-video-button {
    position: absolute;
    top: 53px;
    right: 7px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    cursor: pointer;
    background: #bb0000;
    color: #ffffff;
    border: 0;
    border-radius: 10px;
}
.close-remote-video-button:hover {
    background: red;
}







/* VIDEO CALLS */
.video-call-container {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    z-index: 0;
    top: 0px;
    left: 0;
    width: 100%;
    height: 82%;
    background: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    }
.video-call-container.active {
    opacity: 1;
    visibility: visible;
    }
.local-video, .remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: none;
    border-radius: 15px 15px 0px 0px;
    }
.local-video {
    position: absolute;
    bottom: -10px;
    width: 70px;
    height: 70px;
    border: 0px solid #fff;
    z-index: 0;
    background: #00000040;
    border-radius: 10px;
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.3);
    }
.local-video.hidden {
    transform: translateX(calc(100% + 20px)); 
    }
.remote-video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    }
.video-controls {
    position: absolute;
    bottom: 10px;
    display: flex;
    gap: 15px;
    z-index: 0;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 50px;
    }
.video-status-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    z-index: 0;
    display: none;
    }
.video-status-message.active {
    display: block;
    }