﻿/* ============ BASE DESKTOP ============ */
.call-container {
    position: fixed;
    top: 60px;
    left: 0;
    width: auto;
    z-index: 1050;
    background-color: rgba(33, 37, 41, 0.95);
    display: flex;
    flex-direction: column;
}

video.no-video {
    background-color: black !important;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    opacity: 1 !important;
}

.call-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.call-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.call-timer {
    font-size: 0.9rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.call-actions {
    display: flex;
    gap: 0.5rem;
}

.call-action-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-videos {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.video-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: #222;
}

    .video-container video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.video-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.local-video {
    width: 240px;
    height: 180px;
    border: 2px solid #007bff;
}

.remote-video {
    width: 460px;
    height: 370px;
}

.shared-screen-fullscreen {
    position: fixed !important;    
    left: 0;
    width: 100vw !important;
    height: 80vh !important;
    background-color: black;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

    .shared-screen-fullscreen video {
        width: 100%;
        /*height: 100%;*/
        object-fit: contain;
    }

/* Incoming call dialog */
.incoming-call-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1060;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 300px;
    overflow: hidden;
}

.incoming-call-content {
    padding: 1rem;
}

.incoming-call-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    color: #dc3545;
}

    .incoming-call-header i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

.incoming-call-info {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.incoming-call-actions {
    display: flex;
    justify-content: space-between;
}

@keyframes fa-pulse {
    0% {
        transform: scale(0.95);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(0.95);
    }
}

.fa-pulse {
    animation: fa-pulse 1s infinite;
}

.call-icon-btn {
    border: none;
    background: transparent;
    color: #6c757d;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .call-icon-btn:hover {
        background-color: rgba(108, 117, 125, 0.1);
        color: #007bff;
    }

    .call-icon-btn.video-call {
        margin-left: 5px;
    }

.call-container.minimized {
    width: 800px !important;
    height: 120px !important;
}

    .call-container.minimized .video-grid {
        display: none;
    }

.call-container:not(.minimized) {
    width: 100% !important;
    height: 100% !important;
    right: 0 !important;
}

/* ============ MOBILE ============ */
@media (max-width: 768px) {
    .call-container {
        top: 0;
        left: 0;
        width: 100% !important;
        height: calc(100% - 60px) !important;
        margin-top: 60px;
        border-radius: 0;
        padding-top: 60px;
    }

    @media (max-width: 768px) {
        .call-videos {
            flex: 1;
            padding-top: 0; /* rimuovi padding interno, ora gestito dal container */
            overflow-y: auto;
        }
    }

    .call-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .call-title {
        font-size: 1rem;
    }

    .call-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .call-action-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Mostra solo i pulsanti principali */
    .call-actions button:not(#end-call):not(#toggle-audio):not(#toggle-video):not(#switch-camera) {
        display: none;
    }

    .volume-control-container {
        display: none;
    }

    .local-video {
        width: 120px;
        height: 90px;
        position: fixed;
        bottom: 10px;
        right: 10px;
        border: 2px solid #007bff;
        z-index: 2;
        margin-top: 0 !important;
    }

    .remote-video {
        width: 100%;
        height: auto;
        flex: 1;
    }
}
.active-device {
    background-color: #0d6efd;
    color: white !important;
}
