﻿css
/* ============================================================
   QUAZAR CALL / MEETING
   wwwroot/css/call.css
   ============================================================ */
/* ============================================================
   CONTENEDOR PRINCIPAL DE LLAMADA
   ============================================================ */
.call-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 100px);
    min-height: 500px;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
}

/* ============================================================
   VIDEO REMOTO PRINCIPAL
   ============================================================ */

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    border-radius: 12px;
}

/* ============================================================
   VIDEO LOCAL
   ============================================================ */

.local-video {
    position: absolute;
    right: 20px;
    bottom: 90px;
    width: 220px;
    max-width: 35%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    background: #111;
    border: 2px solid #fff;
    z-index: 20;
}

/* ============================================================
   PANEL GENERAL DE LLAMADA
   ============================================================ */

.quazar-call-panel {
    position: relative;
    width: 100%;
    transition: all 0.25s ease;
}

    .quazar-call-panel.call-rotated {
        transform: rotate(90deg);
        transform-origin: center center;
    }

    .quazar-call-panel.call-minimized {
        display: none !important;
    }

/* ============================================================
   CONTROLES DE LLAMADA
   ============================================================ */

.call-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 50;
}

    .call-controls button {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        border-radius: 50%;
        font-size: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    }

        .call-controls button:hover {
            transform: scale(1.08);
        }

        .call-controls button:active {
            transform: scale(0.95);
        }

        .call-controls button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

/* ============================================================
   CAMBIAR CÁMARA
   ============================================================ */

#btnSwitchCamera {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}

    #btnSwitchCamera .camera-text {
        display: inline;
    }

/* ============================================================
   WRAPPER VIDEO LOCAL
   ============================================================ */

.local-video-wrapper {
    position: relative;
    width: 300px;
    height: 220px;
    margin-top: 15px;
    margin-left: auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

#localVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    border-radius: 12px;
}

/* ============================================================
   GRID DE VIDEOS REMOTOS
   ============================================================ */

.remote-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(280px, 1fr) );
    gap: 12px;
    width: 100%;
    min-height: 300px;
    padding: 10px;
    background: #080808;
    border-radius: 12px;
    box-sizing: border-box;
}

/* ============================================================
   VIDEO REMOTO INDIVIDUAL
   ============================================================ */

.remote-video-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

    .remote-video-wrapper video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: #000;
        display: block;
    }

/* ============================================================
   NOMBRE DEL USUARIO REMOTO
   ============================================================ */

.remote-user-label {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
}

/* ============================================================
   MINI LLAMADA
   ============================================================ */

.quazar-mini-call {
    position: fixed;
    right: 15px;
    bottom: 15px;
    width: 260px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    z-index: 99999;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
}

.quazar-mini-video {
    position: relative;
    width: 100%;
    height: 160px;
    background: #000;
}

    .quazar-mini-video video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: #000;
        display: block;
    }

/* ============================================================
   OVERLAY MINI LLAMADA
   ============================================================ */

.quazar-mini-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 7px 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 12px;
    background: linear-gradient( transparent, rgba(0, 0, 0, 0.85) );
}

/* ============================================================
   CONTROLES MINI LLAMADA
   ============================================================ */

.quazar-mini-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #050505;
}

    .quazar-mini-controls button {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.2s ease;
    }

        .quazar-mini-controls button:hover {
            transform: scale(1.08);
        }

/* ============================================================
   ESTADO DE LLAMADA ACTIVA
   ============================================================ */

body.quazar-call-active {
    padding-bottom: 20px;
}

/* ============================================================
   PANTALLA COMPLETA
   ============================================================ */

#callPanel:fullscreen {
    background: #000;
    width: 100vw;
    height: 100vh;
    overflow: auto;
}

    #callPanel:fullscreen #localVideo,
    #callPanel:fullscreen #remoteVideo {
        height: 100% !important;
        object-fit: contain !important;
    }

/* ============================================================
   LLAMADA ENTRANTE
   ============================================================ */

.incoming-call-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

/* ============================================================
   TARJETA LLAMADA ENTRANTE
   ============================================================ */

.incoming-call-card {
    width: min(420px, 90%);
    background: #fff;
    color: #111;
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
    animation: incomingCallPulse 1s infinite alternate;
}

/* ============================================================
   ICONO LLAMADA ENTRANTE
   ============================================================ */

.incoming-call-icon {
    font-size: 70px;
    margin-bottom: 15px;
}

/* ============================================================
   ANIMACIÓN LLAMADA ENTRANTE
   ============================================================ */

@keyframes incomingCallPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.03);
    }
}

/* ============================================================
   MENSAJES
   ============================================================ */

#messages {
    scroll-behavior: smooth;
}

.message-row {
    animation: messageAppear 0.15s ease-in;
}

.message-bubble {
    word-break: break-word;
    white-space: pre-wrap;
}

/* ============================================================
   ANIMACIÓN MENSAJES
   ============================================================ */

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   ENLACES DEL CHAT QUAZAR
   ============================================================ */

.quazar-chat-link {
    color: #8ecbff;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    word-break: break-all;
}

    .quazar-chat-link:hover {
        color: #fff;
        text-decoration: underline;
    }

/* ============================================================
   ESTADO DE CONEXIÓN
   ============================================================ */

.call-status {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 30;
    padding: 7px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 13px;
    backdrop-filter: blur(5px);
}

    /* ============================================================
   INDICADOR ONLINE
   ============================================================ */

    .call-status.online {
        border: 1px solid rgba(0, 255, 120, 0.6);
    }

    .call-status.offline {
        border: 1px solid rgba(255, 80, 80, 0.6);
    }

/* ============================================================
   INDICADOR DE MICRÓFONO
   ============================================================ */

.microphone-active {
    box-shadow: 0 0 15px rgba(0, 255, 150, 0.45);
}

.microphone-muted {
    opacity: 0.65;
}

/* ============================================================
   INDICADOR DE CÁMARA
   ============================================================ */

.camera-active {
    box-shadow: 0 0 15px rgba(0, 180, 255, 0.45);
}

.camera-disabled {
    opacity: 0.65;
}

/* ============================================================
   SCREEN SHARING
   ============================================================ */

.screen-sharing {
    border: 2px solid rgba(0, 180, 255, 0.8);
    box-shadow: 0 0 25px rgba(0, 180, 255, 0.3);
}

/* ============================================================
   VIDEO APAGADO
   ============================================================ */

.video-disabled {
    background: radial-gradient( circle at center, #1f2937, #000 );
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* ============================================================
   AVATAR DURANTE VIDEO APAGADO
   ============================================================ */

.call-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

/* ============================================================
   SEPARADOR DE LLAMADA
   ============================================================ */

.call-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 10px 0;
}

/* ============================================================
   BOTÓN FINALIZAR LLAMADA
   ============================================================ */

#btnEndCall {
    background: #dc3545;
    color: #fff;
}

    #btnEndCall:hover {
        background: #bb2d3b;
        box-shadow: 0 0 18px rgba(220, 53, 69, 0.5);
    }

/* ============================================================
   BOTONES DE LLAMADA
   ============================================================ */

#btnMicrophone,
#btnCamera,
#btnScreen,
#btnSwitchCamera {
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    #btnMicrophone:hover,
    #btnCamera:hover,
    #btnScreen:hover,
    #btnSwitchCamera:hover {
        transform: scale(1.08);
    }

    /* ============================================================
   BOTÓN MICRÓFONO APAGADO
   ============================================================ */

    #btnMicrophone.muted {
        background: #6c757d;
    }

    /* ============================================================
   BOTÓN CÁMARA APAGADA
   ============================================================ */

    #btnCamera.off {
        background: #6c757d;
    }

    /* ============================================================
   BOTÓN COMPARTIR PANTALLA
   ============================================================ */

    #btnScreen.active {
        box-shadow: 0 0 12px rgba(13, 202, 240, 0.8);
    }

/* ============================================================
   REUNIÓN
   ============================================================ */

.meeting-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 100px);
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* ============================================================
   GRID REUNIÓN
   ============================================================ */

.meeting-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(280px, 1fr) );
    gap: 10px;
    width: 100%;
    min-height: 500px;
    padding: 10px;
    background: #050505;
}

/* ============================================================
   PARTICIPANTE
   ============================================================ */

.meeting-participant {
    position: relative;
    min-height: 220px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

    .meeting-participant video {
        width: 100%;
        height: 100%;
        min-height: 220px;
        object-fit: cover;
        display: block;
    }

/* ============================================================
   NOMBRE PARTICIPANTE
   ============================================================ */

.meeting-participant-name {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 5;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 13px;
}

/* ============================================================
   INDICADOR DE PARTICIPANTE HABLANDO
   ============================================================ */

.participant-speaking {
    border: 2px solid rgba(0, 255, 140, 0.9);
    box-shadow: 0 0 15px rgba(0, 255, 140, 0.35);
}

/* ============================================================
   CONEXIÓN
   ============================================================ */

.connection-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

    .connection-indicator::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #999;
    }

    .connection-indicator.connected::before {
        background: #00d084;
        box-shadow: 0 0 8px rgba(0, 208, 132, 0.8);
    }

    .connection-indicator.connecting::before {
        background: #ffc107;
        animation: connectionPulse 1s infinite;
    }

    .connection-indicator.disconnected::before {
        background: #dc3545;
    }

/* ============================================================
   ANIMACIÓN CONEXIÓN
   ============================================================ */

@keyframes connectionPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   OVERLAY DE CARGA
   ============================================================ */

.call-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}

/* ============================================================
   SPINNER
   ============================================================ */

.call-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: callSpinner 0.8s linear infinite;
}

@keyframes callSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   MENSAJE DE ERROR
   ============================================================ */

.call-error {
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ffb3b8;
}

/* ============================================================
   MENSAJE DE INFORMACIÓN
   ============================================================ */

.call-info {
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(13, 202, 240, 0.12);
    border: 1px solid rgba(13, 202, 240, 0.4);
    color: #b8efff;
}

/* ============================================================
   RESPONSIVE TABLET
   ============================================================ */

@media (max-width: 992px) {

    .local-video {
        width: 180px;
        bottom: 85px;
        right: 15px;
    }

    .remote-grid {
        grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
    }

    .remote-video-wrapper {
        height: 260px;
    }
}

/* ============================================================
   RESPONSIVE MÓVIL
   ============================================================ */

@media (max-width: 768px) {

    .call-container {
        height: calc(100vh - 80px);
        min-height: 400px;
        border-radius: 0;
    }

    .remote-video {
        border-radius: 0;
    }

    .local-video {
        width: 130px;
        max-width: 40%;
        right: 10px;
        bottom: 85px;
        border-radius: 10px;
    }

    .call-controls {
        bottom: 12px;
        gap: 8px;
        padding: 0 8px;
    }

        .call-controls button {
            width: 48px;
            height: 48px;
            min-width: 48px;
            min-height: 48px;
            font-size: 18px;
        }

    #btnSwitchCamera {
        display: inline-flex !important;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
        border-radius: 50%;
        font-size: 20px;
    }

        #btnSwitchCamera .camera-text {
            display: none;
        }

    .remote-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
    }

    .remote-video-wrapper {
        height: 240px;
    }

    .local-video-wrapper {
        width: 180px;
        height: 140px;
    }

    #messages {
        height: 55vh !important;
        overflow-y: auto;
    }

    .quazar-mini-call {
        width: 190px;
        right: 10px;
        bottom: 10px;
        border-radius: 12px;
    }

    .quazar-mini-video {
        height: 120px;
    }

    .quazar-mini-controls {
        gap: 5px;
        padding: 6px;
    }

        .quazar-mini-controls button {
            width: 34px;
            height: 34px;
        }

    #callPanel:fullscreen .card-body {
        padding: 5px;
    }

    #callPanel:fullscreen #localVideo,
    #callPanel:fullscreen #remoteVideo {
        min-height: 40vh;
        height: 45vh !important;
        object-fit: contain !important;
    }

    .meeting-container {
        min-height: calc(100vh - 80px);
        border-radius: 0;
    }

    .meeting-grid {
        grid-template-columns: 1fr;
        padding: 5px;
    }

    .meeting-participant {
        min-height: 240px;
    }

        .meeting-participant video {
            min-height: 240px;
        }

    .incoming-call-card {
        width: 90%;
        padding: 25px 20px;
    }

    .incoming-call-icon {
        font-size: 55px;
    }
}

/* ============================================================
   MÓVIL PEQUEÑO
   ============================================================ */

@media (max-width: 480px) {

    .local-video {
        width: 110px;
        max-width: 38%;
        bottom: 78px;
        right: 8px;
    }

    .call-controls {
        gap: 5px;
    }

        .call-controls button {
            width: 44px;
            height: 44px;
            min-width: 44px;
            min-height: 44px;
            font-size: 16px;
        }

    #btnSwitchCamera {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .remote-video-wrapper {
        height: 220px;
    }

    .quazar-mini-call {
        width: 170px;
    }

    .quazar-mini-video {
        height: 105px;
    }

    .call-status {
        top: 8px;
        left: 8px;
        font-size: 11px;
        padding: 5px 9px;
    }
}

/* ============================================================
   ACCESIBILIDAD
   ============================================================ */

.call-controls button:focus-visible,
.quazar-mini-controls button:focus-visible,
#btnSwitchCamera:focus-visible {
    outline: 3px solid rgba(13, 202, 240, 0.8);
    outline-offset: 3px;
}

/* ============================================================
   REDUCCIÓN DE MOVIMIENTO
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


