:root {
    --primary-bg: #1c1e20;
    --secondary-bg: #002159;
    --border-color: #3D3D42;
    --text-color: #d2d2d2;
    --text-white: #f5f5f5;
    --danger-color: #CC3B33;
    --success-color: #1ec71b;
    --leave-color: #eb534b;
    --hover-bg: #343434;
    --pip-size: 180px; /* Tamanho do vídeo pequeno */
    --pip-margin: 20px; /* Margem do vídeo pequeno */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Poppins", Sans-serif;
    background: var(--primary-bg);
    color: var(--text-color);
}

/* ===== LAYOUT PRINCIPAL ===== */
.main {
    height: 100vh;
    display: flex;
    position: relative;
}

.main-left {
    flex: 0.8;
    display: flex;
    flex-direction: column;
}

.main-right {
    flex: 0.2;
    display: none;
    flex-direction: column;
    background-color: var(--secondary-bg);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease;
}


/* ===== GRADE DE VÍDEOS ===== */
#video-grid {

    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    background: #a5c3da;
}

/* Quando a tela for maior que 999px */
@media (min-width: 1000px) {
    #video-grid {
        width: 50%;
    }
}

/* Quando a tela for menor ou igual a 999px */
@media (max-width: 999px) {
    #video-grid {
        width: 100%;
    }
}

video {
    height: 300px;
    width: 100%;
    object-fit: cover;
    background: #000;

    /*  ACELERAÇÃO MÁXIMA PARA RECUPERAÇÃO RÁPIDA */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    
    /*  EVITA QUE O NAVEGADOR "ESQUEÇA" O VÍDEO */
    contain: layout style paint;
   
}

/* ===== CONTROLES ===== */
.main-videos {
    flex-grow: 1;
    background-color: #a5c3da;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.main-controls {
    display: flex;
    /*background-color: var(--primary-bg);*/
    background: #002159;
    color: var(--text-color);
    padding: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.main-controls-block {
    display: flex;
    flex-wrap: wrap;
}

.main-controls-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px 10px;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    color: inherit;
}

.main-controls-button i {
    font-size: 24px;
    margin-bottom: 4px;
}

.main-controls-button:hover {
    /* background-color: var(--hover-bg);*/
    background-color: #353d65;
    border-radius: 5px;
}

.leave-meeting {
    color: var(--leave-color);
    font-weight: bold;
}














/* ===== CHAT ===== */
.main-header {
    color: var(--text-white);
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 0 10px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.chat-close-button {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-close-button:hover {
    opacity: 0.9;
    transform: scale(1.1);
    background: #ff5252;
}

.chat-title {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.main-chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 10px;
}

/* ===== ÁREA DE TEXTO MELHORADA ===== */
.main-message-container {
       padding: 15px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-color);
}

.message-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#chat-message {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 25px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    outline: none;
    min-height: 20px;
    resize: none;
    max-height: 100px;
}

.main-message-container input {
    flex-grow: 1;
    background-color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    color: #262626;
    font-size: 14px;
}

#chat-message::placeholder {
    color: #999;
}

.main-message-container input:focus {
    outline: 2px solid var(--success-color);
    outline-offset: -2px;
}

#chat-message:focus {
    outline: none;
   /* box-shadow: 0 0 0 2px var(--success-color);*/
    box-shadow: 0 0 0 2px #a5c3da;
}

#enviar-form {
     background: var(--success-color);
    border: none;
    border-radius: 50%;
    padding: 12px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30, 199, 27, 0.3);
}

#enviar-form:hover {
    opacity: 0.9;
    transform: scale(1.05);
    background: #17b114;
}

#enviar-form i {
    color: white;
    font-size: 16px;
}

/* ===== MENSAGENS ===== */
/* ===== MENSAGENS DO CHAT - ESTILO WHATSAPP ===== */
.messages {
    display: flex;
    flex-direction: column;
    padding: 10px;
    color: white;
    list-style: none;
    margin: 0;
    gap: 8px;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

/* Mensagem do usuário atual (direita) */
.message-user {
    align-self: flex-end;
    margin-left: auto;
}

.message-user .message-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
    gap: 8px;
}

.message-user .message-header b {
    color: #2196F3;
    order: 2;
}

.message-user .message-time {
    font-size: 10px;
    color: #888;
    order: 1;
}

.message-user .message-bubble {
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 18px;
    border-bottom-right-radius: 6px;
    padding: 8px 12px;
    position: relative;
    align-self: flex-end;
}

/* Mensagem de outros usuários (esquerda) */
.message-other {
    align-self: flex-start;
    margin-right: auto;
}

.message-other .message-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
    gap: 8px;
}

.message-other .message-header b {
    color: var(--success-color);
}

.message-other .message-time {
    font-size: 10px;
    color: #888;
}

.message-other .message-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    padding: 8px 12px;
    position: relative;
    align-self: flex-start;
}

/* Texto da mensagem */
.message-text {
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 14px;
}

/* Efeitos de hover suaves */
.message-bubble {
    transition: all 0.2s ease;
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Indicador visual para mensagens longas */
.message-text {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* RESPONSIVIDADE PARA DIFERENTES TAMANHOS DE TELA */

/* Tablets */
@media screen and (max-width: 1024px) {
    .message {
        max-width: 85%;
    }
    
    .message-text {
        font-size: 14px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .message {
        max-width: 90%;
    }
    
    .message-bubble {
        padding: 6px 10px;
    }
    
    .message-text {
        font-size: 13px;
    }
    
    .message-header {
        font-size: 10px !important;
    }
    
    .message-time {
        font-size: 9px !important;
    }
}

/* Mobile pequeno */
@media screen and (max-width: 480px) {
    .message {
        max-width: 95%;
    }
    
    .message-bubble {
        padding: 5px 8px;
        border-radius: 16px !important;
    }
    
    .message-text {
        font-size: 12px;
    }
    
    .messages {
        padding: 8px;
        gap: 6px;
    }
}

/* Ajustes para mensagens muito curtas */
.message-bubble:has(.message-text:empty) {
    display: none;
}

/* Melhorias para mensagens com conteúdo específico */
.message-text:only-child {
    margin: 0;
}

/* Efeito de sombra sutil para melhor legibilidade */
.message-bubble {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Destaque para mensagens do médico */
.message-other .message-header b[style*="Médico"] {
    color: var(--success-color) !important;
    font-weight: 600;
}

/* Destaque para mensagens do paciente */
.message-user .message-header b[style*="Paciente"] {
    color: #2196F3 !important;
    font-weight: 500;
}




/* ===== ESTADOS ===== */
.stop,
.unmute {
    color: var(--danger-color);
}

/* ===== PRELOADER ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: #ffffff82;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

#statusPre {
    width: 200px;
    height: 200px;
    background: url(connect.gif) center no-repeat;
    /* background-size: contain; */
    background-size: 100px;
}

/* ===== CHAT RESPONSIVO ===== */
.flex-margin-left-negative {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 70%;
    border-radius: 20px 20px 0 0;
    background-color: rgba(36, 35, 36, 0.95);
    z-index: 1001;
}

/* ===== RESPONSIVIDADE ===== */

/* Tablets */
@media screen and (max-width: 1024px) {
    .main-left {
        flex: 0.7;
    }

    .main-right {
        flex: 0.3;
    }

    video {
        height: 250px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .main {
        height: 100vh;
        flex-direction: column;
    }

    .main-left {
        flex: 1;
    }

    .main-right {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    #video-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 5px;
        padding: 5px;
    }

    video {
        height: 200px;
        border-radius: 8px;
    }

    .main-controls {
        padding: 10px 5px;
    }

    .main-controls-button {
        min-width: 70px;
        padding: 6px 8px;
    }

    .main-controls-button i {
        font-size: 20px;
    }

    .main-controls-button span {
        font-size: 12px;
    }

    .main-controls-block {
        justify-content: space-between;
        width: 100%;
    }

}

/* Mobile Pequeno */
@media screen and (max-width: 480px) {
    video {
        height: 150px;
    }

    .main-controls-button {
        min-width: 60px;
        padding: 4px 6px;
    }

    .main-controls-button i {
        font-size: 18px;
    }

    .main-controls-button span {
        font-size: 10px;
    }

    .main-message-container {
        padding: 10px 8px;
    }

    .main-message-container input {
        padding: 10px;
        font-size: 12px;
    }

    #enviar-form {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
}


/* ===== UTILITÁRIOS ===== */
#chat-message-open {
    display: flex; /* Visível por padrão no mobile */
}


@media screen and (max-width: 768px) {
    #chat-message-open {
        display: flex;
    }
}

.hidden {
    display: none !important;
}

.visible {
    visibility: visible !important;
}

/* Scrollbar personalizado */
.main-chat-window::-webkit-scrollbar {
    width: 6px;
}

.main-chat-window::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.main-chat-window::-webkit-scrollbar-thumb {
    background: var(--success-color);
    border-radius: 3px;
}


/* Vídeo principal (remoto) - Ocupa toda a tela */
.video-remote {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Vídeo local (PIP) - Pequeno no canto */
.video-local {
    width: var(--pip-size);
    height: calc(var(--pip-size) * 0.75); /* Mantém proporção 4:3 */
    object-fit: cover;
    position: absolute;
    bottom: var(--pip-margin);
    right: var(--pip-margin);
    z-index: 2;
   /* border: 2px solid var(--success-color); */
    border: 2px solid rgb(0 33 89);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.video-local:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

/* Quando há apenas um usuário (apenas o vídeo local) */
.single-user .video-local {
    position: relative;
    width: 50%;
    height: auto;
    max-width: 500px;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

/* ===== CONTROLES SOBRE O VÍDEO ===== */
.video-overlay {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.video-overlay .main-controls {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 25px;
    padding: 8px 16px;
    pointer-events: all;
}

/* ===== RESPONSIVIDADE PARA PIP ===== */

/* Tablets */
@media screen and (max-width: 1024px) {
    :root {
        --pip-size: 150px;
        --pip-margin: 15px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    :root {
        --pip-size: 120px;
        --pip-margin: 10px;
    }

    .video-local {
        border-width: 1px;
    }

    .single-user .video-local {
        width: 90%;
    }
   

}

/* Mobile muito pequeno */
@media screen and (max-width: 480px) {
    :root {
        --pip-size: 100px;
        --pip-margin: 8px;
    }
}

/* Modo paisagem em mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    :root {
        --pip-size: 80px;
        --pip-margin: 5px;
    }
}


/* Estado de sala cheia */
.room-full-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--primary-bg);
    color: white;
    text-align: center;
    padding: 20px;
}

.room-full-content {
    max-width: 400px;
}

.room-full-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.room-full-title {
    color: var(--danger-color);
    margin-bottom: 15px;
    font-size: 24px;
}

.room-full-message {
    margin-bottom: 25px;
    line-height: 1.5;
}

.room-full-button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s ease;
}

.room-full-button:hover {
    opacity: 0.9;
}

/* Estados do vídeo */
#video-grid.single-user .video-local {
    position: relative;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#video-grid.two-users {
    position: relative;
}

.circle-red-exit{
    transform: rotate(225deg);
    display: flex!important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: red;
    color: white;
}

.circle-blue{
    display: flex!important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
   /* background-color: #2196F3; */
   background-color: #a5c3da;
   /*color: white; */
    color: #002159;
}

/* ESTILOS PARA O SISTEMA DE ABAS DUPLICADAS */
.duplicate-tab-overlay {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.soft-warning-banner {
    animation: slideDown 0.5s ease-out;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}


/* ===== SISTEMA DE TOGGLE DO CHAT ===== */

/* Chat sempre visível no desktop */
@media screen and (min-width: 769px) {
    .main-right {
       /* display: flex !important;*/
       position: fixed;
        top: 0;
       right: 0;
        width: 25%;
        height: 100%;
        z-index: 1000;
        background: var(--secondary-bg); 
       /* background: #002159;*/
    }
    
    #chat-message-open,
    #chat-message-fechar {
       /* display: none !important;*/
    }
}

/* Chat toggle no mobile */
@media screen and (max-width: 768px) {

    .main-header {
        margin-top: 0;
        padding: 15px;
        /* background: var(--primary-bg); */
        border-radius: 15px 15px 0 0;
        min-height: 70px;
    }

    .chat-title {
        font-size: 1.2rem;
    }

    .chat-close-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }




    .main-right {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        background: var(--secondary-bg);
    }
    
     /* Quando chat está aberto */
    .chat-open #chat-message-open {
       /* display: none !important; */
    }
     .chat-open #chat-message-fechar {
        display: flex !important;
    }
    
    #chat-message-fechar {
       /* display: none;*/
    }
    
    /* Quando o chat está aberto no mobile */
    .chat-open .main-right {
        display: flex !important;
    }
    
    /* Ajustes para o chat no mobile */
    .main-chat-window {
        flex-grow: 1;
        padding-bottom: 80px; /* Espaço para o input */
    }
    
    .main-message-container {
        padding: 15px;
        gap: 10px;
    }

    .message-input-container {
        border-radius: 20px;
    }

     #chat-message {
        padding: 10px 14px;
        font-size: 16px; /* Melhor para mobile */
    }
    #enviar-form {
        width: 50px;
        height: 50px;
    }
}

/* ===== ANIMAÇÕES SUAVES ===== */
.main-right {
    transition: all 0.3s ease-in-out;
}

#chat-message-open,
#chat-message-fechar {
    transition: all 0.2s ease;
}

/* Efeito de clique nos botões */
.main-controls-button:active {
    transform: scale(0.95);
}

/* Destaque para o botão de chat quando há novas mensagens */
.chat-has-new-messages #chat-message-open {
    position: relative;
    animation: pulse 2s infinite;
}

.chat-has-new-messages #chat-message-open::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== MELHORIAS PARA O INPUT DE TEXTO ===== */
.message-input-container:focus-within {
    box-shadow: 0 0 0 2px var(--success-color);
}

/* Scrollbar para textarea quando necessário */
#chat-message::-webkit-scrollbar {
    width: 4px;
}

#chat-message::-webkit-scrollbar-track {
    background: transparent;
}

#chat-message::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* ===== BOTÃO ENVIAR DESABILITADO ===== */
#enviar-form:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#enviar-form:disabled:hover {
    background: #ccc;
    transform: none;
}




/* ===== TIMER INFERIOR ESQUERDA TRANSPARENTE ===== */
.timer-bottom-left {
    position: absolute;
    bottom: 80px;
    left: 15px;
    z-index: 10;
    background: transparent;
    padding: 8px 12px;
    min-width: 110px;
    text-align: center;
}

.timer-bottom-left .timer-display {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: bold;
    /* color: #000000; */
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 2px;
}

.timer-bottom-left .timer-label {
    font-size: 10px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}


.logo-brilho {    
    width: 70px;
    filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0.9));
    transition: filter 0.3s ease, transform 0.3s ease;   
}

@media (max-width: 999px) {
    .timer-bottom-left {
        bottom: 100px;
    }
    .logo-brilho {  
        filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
    }     

}

@media screen and (max-width: 305px) {
    .timer-bottom-left{
        bottom: 170px;
    }

}


/* Estilos para o Modal Moderno */
.modern-modal {
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  background: #FFFFFF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header do Modal */
.modern-modal .modal-header {
  display: flex;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #F3F4F6;
  position: relative;
}

.modern-modal .modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #FEF2F2;
  border-radius: 12px;
  margin-right: 16px;
  flex-shrink: 0;
}

.modern-modal .modal-title-container {
  flex: 1;
  padding-right: 20px;
}

.modern-modal .modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.modern-modal .modal-subtitle {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
  font-weight: 400;
}

.modern-modal .close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #F9FAFB;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  padding: 0;
  transition: all 0.2s ease;
}

.modern-modal .close:hover {
  background: #F3F4F6;
  transform: scale(1.05);
}

/* Body do Modal */
.modern-modal .modal-body {
  padding: 24px;
}

.modern-modal .message-container {
  text-align: left;
}

.modern-modal .modal-message {
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  margin: 0 0 16px 0;
  font-weight: 400;
}

.modern-modal .modal-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #F9FAFB;
  border-radius: 8px;
  border-left: 3px solid #E5E7EB;
}

.modern-modal .modal-info span {
  font-size: 14px;
  color: #6B7280;
  font-weight: 400;
}

/* Footer do Modal */
.modern-modal .modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 24px;
  border-top: 1px solid #F3F4F6;
}

.modern-modal .btn {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.modern-modal .btn-secondary {
  background: #FFFFFF;
  color: #374151;
  border: 1px solid #D1D5DB;
}

.modern-modal .btn-secondary:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
  transform: translateY(-1px);
}

.modern-modal .btn-primary {
  background: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.1);
}

.modern-modal .btn-primary:hover {
  background: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.modern-modal .btn:active {
  transform: translateY(0);
}

/* Animações */
.modal.fade .modal-dialog {
  transform: translateY(-20px) scale(0.95);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

/* Responsividade */
@media (max-width: 576px) {
  .modern-modal .modal-header {
    padding: 20px 20px 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .modern-modal .modal-icon {
    margin-bottom: 12px;
  }
  
  .modern-modal .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  
  .modern-modal .btn {
    width: 100%;
  }
  
  .modern-modal .close {
    top: 16px;
    right: 16px;
  }
}

/* Acessibilidade - Foco visível */
.modern-modal .btn:focus,
.modern-modal .close:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Dark Mode (opcional) */
@media (prefers-color-scheme: dark) {
  .modern-modal {
    background: #1F2937;
    color: #F9FAFB;
  }
  
  .modern-modal .modal-title {
    color: #F9FAFB;
  }
  
  .modern-modal .modal-subtitle {
    color: #D1D5DB;
  }
  
  .modern-modal .modal-header,
  .modern-modal .modal-footer {
    border-color: #374151;
  }
  
  .modern-modal .modal-message {
    color: #E5E7EB;
  }
  
  .modern-modal .modal-info {
    background: #374151;
    border-left-color: #4B5563;
  }
  
  .modern-modal .modal-info span {
    color: #D1D5DB;
  }
  
  .modern-modal .btn-secondary {
    background: #374151;
    color: #F9FAFB;
    border-color: #4B5563;
  }
  
  .modern-modal .btn-secondary:hover {
    background: #4B5563;
  }
  
  .modern-modal .close {
    background: #374151;
  }
  
  .modern-modal .close:hover {
    background: #4B5563;
  }
}



/* =========== btn open close chat ==============  */
/* Estado quando o chat está aberto */
.chat-open #chat-toggle-button .fa-comment {
   /* color: var(--success-color) !important; */
}

.chat-open #chat-toggle-button {
    /*
    background: rgba(30, 199, 27, 0.1) !important;
    border: 1px solid rgba(30, 199, 27, 0.3) !important;
    */
}


/* ===== ANIMAÇÃO DO BOTÃO CHAT COM CORES ESPECÍFICAS ===== */
.chat-icon-blink {
    animation: chatPulse 1s ease-in-out 5;
    position: relative;
}

@keyframes chatPulse {
    0%, 100% {
        background-color: #002159; /* Azul escuro */
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 33, 89, 0.7);
    }
    25% {
        background-color: #a5c3da; /* Azul claro */
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(165, 195, 218, 0.4);
    }
    50% {
        background-color: #002159; /* Azul escuro */
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 33, 89, 0.7);
    }
    75% {
        background-color: #a5c3da; /* Azul claro */
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(165, 195, 218, 0.4);
    }
}

/* Animação do ícone dentro do botão */
.chat-icon-blink .fa-comment {
    animation: iconColorChange 1s ease-in-out 5;
}

@keyframes iconColorChange {
    0%, 100% {
        color: #a5c3da !important; /* Azul claro no ícone */
        transform: scale(1);
    }
    25%, 75% {
        color: #002159 !important; /* Azul escuro no ícone */
        transform: scale(1.1);
    }
    50% {
        color: #a5c3da !important; /* Azul claro no ícone */
        transform: scale(1);
    }
}

#chat-toggle-button i.chat-has-notification::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ff4444, #cc0000); /* Gradiente vermelho */
    border-radius: 50%;
    animation: redBadgePulse 1.5s infinite;
    border: 2px solid #002159;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

@keyframes redBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
    }
}



/* ===== ESTILOS PARA COMPARTILHAMENTO DE TELA ===== */
.screen-share {
    border: 3px solid #1ec71b !important;
    box-shadow: 0 0 20px rgba(30, 199, 27, 0.5) !important;
    position: relative;
}

.screen-share::before {
    content: 'TELA COMPARTILHADA';
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(30, 199, 27, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Indicador visual para tela compartilhada */
.screen-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1ec71b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Botão de compartilhamento ativo */
#screen-share-button.active {
    background: rgba(30, 199, 27, 0.2);
    border: 1px solid #1ec71b;
    border-radius: 8px;
}

.circle-red {
    display: flex!important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ff4444;
    color: white;
}

/* Layout quando há tela compartilhada */
#video-grid.has-screen-share .video-remote:not(.screen-share) {
    width: 30%;
    height: 30%;
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2;
}

#video-grid.has-screen-share .screen-share {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Responsividade para tela compartilhada */
@media screen and (max-width: 768px) {
    .screen-share::before {
        font-size: 8px;
        padding: 2px 4px;
        top: 5px;
        left: 5px;
    }
    
    #video-grid.has-screen-share .video-remote:not(.screen-share) {
        width: 120px;
        height: 90px;
        bottom: 10px;
        right: 10px;
    }
}



