* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #b0bec5; /* Tom ligeiramente mais escuro para destacar a janela */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    overflow: hidden;
}

/* APLICATIVO EM TAMANHO MENOR COM BORDA DE SOFTWARE */
.container-aplicativo { 
    display: flex; 
    width: 1024px;          /* Largura de janela de software desktop */
    height: 680px;         /* Altura contida para visualização confortável */
    max-width: 95vw; 
    max-height: 92vh;
    border: 4px solid #546e7a; /* Borda bem estruturada ao redor */
    border-radius: 12px; 
    box-shadow: 0 12px 40px rgba(0,0,0,0.25); 
    overflow: hidden; 
    transition: all 0.3s ease; 
}

/* MENUS E CABEÇALHO LATERAIS */
#menu-lateral { width: 340px; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; background-color: #ffffff; }
.linha-topo-titulo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cabeçalho-menu h2 { font-size: 18px; font-weight: bold; letter-spacing: 0.5px; }
.logos { font-size: 13px; opacity: 0.7; margin-top: 5px; text-align: right; }

/* DROPDOWN CONFIGURAÇÃO */
.dropdown-config { position: relative; display: inline-block; }
.btn-config { background: none; border: none; font-size: 18px; cursor: pointer; color: white; padding: 4px; transition: transform 0.2s; }
.btn-config:hover { transform: rotate(45deg); }
.conteudo-submenu-config { display: none; position: absolute; right: 0; top: 25px; background-color: #ffffff; min-width: 170px; box-shadow: 0px 8px 16px rgba(0,0,0,0.15); border-radius: 8px; z-index: 300; padding: 5px 0; border: 1px solid #e2e8f0; }
.titulo-submenu-item { font-size: 11px; font-weight: bold; color: #64748b; padding: 6px 12px; text-transform: uppercase; background: #f8fafc; }
.conteudo-submenu-config button { color: #334155; padding: 10px 12px; text-decoration: none; display: block; width: 100%; border: none; background: none; text-align: left; cursor: pointer; font-size: 12px; font-weight: 500; }
.conteudo-submenu-config button:hover { background-color: #f1f5f9; color: #0f172a; }

/* LAYOUT PERFIL DO TOPO */
.perfil-usuario-topo { display: flex; gap: 12px; align-items: center; background: rgba(0, 0, 0, 0.15); padding: 10px; border-radius: 8px; margin-bottom: 5px; }
.avatar-topo-container { width: 55px; height: 55px; border-radius: 50%; overflow: hidden; position: relative; cursor: pointer; border: 2px solid #ffffff; }
#avatar-usuario-topo { width: 100%; height: 100%; object-fit: cover; }
.overlay-avatar-topo { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); color: white; display: flex; justify-content: center; align-items: center; font-size: 14px; opacity: 0; transition: opacity 0.2s; }
.avatar-topo-container:hover .overlay-avatar-topo { opacity: 1; }

.controles-perfil-topo { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.musica-usuario-atual { font-size: 11px; background-color: rgba(255, 255, 255, 0.2); padding: 4px 8px; border-radius: 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* BOTÕES DE STATUS ONLINE / OCUPADO */
#btn-status-disponibilidade { border: none; padding: 4px 10px; font-weight: bold; font-size: 11px; border-radius: 12px; cursor: pointer; width: fit-content; text-transform: uppercase; color: white; transition: background 0.2s; }
.status-online { background-color: #00a884; }
.status-ocupado { background-color: #ea4335; }

/* ABAS DE NAVEGAÇÃO COM MAIS ESPAÇAMENTO */
.abas-menu { display: flex; background-color: #f0f2f5; border-bottom: 1px solid #e0e0e0; flex-wrap: wrap; gap: 2px; padding: 6px 6px 0 6px; }
.aba { flex: 1; min-width: 65px; text-align: center; padding: 12px 4px; font-size: 12px; color: #54656f; cursor: pointer; font-weight: 600; transition: all 0.2s; white-space: nowrap; border-radius: 4px 4px 0 0; }
.conteudo-aba-container { flex: 1; overflow-y: auto; }
.painel-aba { padding: 5px 0; }

/* REGRAS REESTRUTURADAS DOS IFRAMES LATERAIS */
.container-iframe-lateral { width: 100%; height: calc(680px - 185px); overflow: hidden; transition: all 0.2s ease; }
.container-iframe-lateral iframe { width: 100%; height: 100%; border: none; background-color: #ffffff; }

/* EXCEÇÃO EXCLUSIVA PARA O MENU TV BVW AO VIVO */
.ocultar-iframe-lateral { display: none !important; }
.chat-bvw-tv-ativa { flex: 1 !important; display: flex !important; flex-direction: column !important; }
.area-mensagens.modo-tv-player { padding: 0 !important; background: #000000 !important; display: flex; justify-content: center; align-items: center; }
.area-mensagens.modo-tv-player iframe { width: 100%; height: 100%; border: none; }

/* BANCO DE DADOS E LISTAS */
.acoes-banco-dados { padding: 14px 15px; border-bottom: 1px solid #f0f2f5; }
.btn-adicionar-contato { width: 100%; color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 13px; }

/* MAIOR DISTÂNCIA E RESPIRO VISUAL NA LISTA DE CONTATOS */
.item-linha { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid #f5f5f5; cursor: pointer; position: relative; gap: 4px; }
.avatar-img { width: 45px; height: 45px; border-radius: 50%; margin-right: 15px; object-fit: cover; }
.info-linha { flex: 1; min-width: 0; padding-right: 25px; }
.linha-topo { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.hora { font-size: 11px; color: #667781; }
.linha-sub { font-size: 12px; color: #667781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-deletar-contato { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #d32f2f; font-size: 14px; cursor: pointer; display: none; }
.item-linha:hover .btn-deletar-contato { display: block; }

/* DISTANCIAMENTO EM TÍTULOS E GRUPOS */
.secao-titulo { font-size: 13px; font-weight: bold; padding: 14px 15px; border-bottom: 1px solid #f0f2f5; margin-bottom: 4px; }
.item-status-musica { display: flex; align-items: center; padding: 14px 15px; border-bottom: 1px solid #f9f9f9; }

/* GRUPOS E CATEGORIAS */
.categoria-grupo { border-bottom: 1px solid #f0f2f5; margin-bottom: 12px; }
.titulo-categoria { padding: 14px 15px; font-weight: bold; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background-color: #f8f9fa; }
.lista-sub-itens { padding: 8px 0; }
.item-linha-mini { padding: 10px 32px; font-size: 13px; cursor: pointer; }
.item-linha-mini:hover { text-decoration: underline; background-color: rgba(0, 0, 0, 0.03); }

/* JANELA DE CHAT GLOBAL */
#janela-chat { flex: 1; display: flex; flex-direction: column; position: relative; transition: all 0.2s ease; }
.cabeçalho-chat { padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e0e0e0; }
.info-usuario-chat { display: flex; align-items: center; gap: 12px; }
#avatar-chat { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.conteiner-nome-chat { display: flex; flex-direction: column; font-size: 14px; }
.meta-texto-status { font-size: 11px; color: #667781; }
.acoes-chamada { display: flex; gap: 10px; align-items: center; }
.btn-chamada { background: none; border: none; font-size: 20px; cursor: pointer; padding: 5px; transition: transform 0.2s; }
.btn-chamada:hover { transform: scale(1.15); }

/* SUBMENU DE INTERAÇÕES DROP */
.conteudo-submenu button { color: #111; padding: 12px 16px; text-decoration: none; display: block; width: 100%; border: none; background: none; text-align: left; cursor: pointer; font-size: 13px; }
.conteudo-submenu button:hover { background-color: #f1f5f9; }

/* MENSAGENS / RENDERS */
.area-mensagens { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.balao-msg { padding: 8px 14px; border-radius: 8px; max-width: 65%; font-size: 13px; position: relative; box-shadow: 0 1px 1px rgba(0,0,0,0.1); word-wrap: break-word; }
.meta-horario { font-size: 9px; color: #667781; display: block; text-align: right; margin-top: 4px; }
.midia-foto { max-width: 100%; max-height: 200px; border-radius: 6px; margin-top: 4px; display: block; object-fit: cover; }
.texto-status-sistema { text-align: center; font-size: 11px; color: #667781; font-style: italic; margin-top: 5px; }

/* INPUT BARRA */
.barra-entrada-chat { padding: 10px 15px; display: flex; gap: 10px; align-items: center; }
.acoes-midia { display: flex; gap: 8px; }
.btn-midia-clip { background: none; border: none; font-size: 18px; cursor: pointer; color: #54656f; }
.barra-entrada-chat input { flex: 1; padding: 10px; border-radius: 8px; border: none; outline: none; font-size: 13px; }
.btn-enviar { color: white; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 14px; cursor: pointer; display: flex; justify-content: center; align-items: center; }

/* MODAIS OVERLAY */
.modal-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 500; }
.modal-box { background: white; padding: 25px; border-radius: 12px; width: 400px; }
.modal-box h3 { margin-bottom: 12px; font-size: 15px; }
.modal-form label { display: block; font-size: 11px; font-weight: bold; color: #4a4a4a; margin-bottom: 4px; margin-top: 8px; }
.modal-form input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 6px; outline: none; font-size: 13px; margin-bottom: 8px; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.btn-salvar { color: white; border: none; padding: 8px 14px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-cancelar { background-color: #e0e0e0; color: #333; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; }


/* ==================== TEMA 1: PADRÃO (ESTILO WHATSAPP) ==================== */
.theme-default { background-color: #fff; }
.theme-default .cabeçalho-menu { background: linear-gradient(135deg, #1d529a 0%, #075e54 100%); color: white; padding: 15px; }
.theme-default .aba.ativa { color: #075e54; border-bottom: 3px solid #075e54; background-color: #ffffff; }
.theme-default .btn-adicionar-contato { background-color: #00a884; }
.theme-default .btn-adicionar-contato:hover { background-color: #008f70; }
.theme-default .item-linha:hover, .theme-default .conversa-ativa { background-color: #f0f2f5; }
.theme-default .secao-titulo { color: #075e54; }
.theme-default .titulo-categoria { color: #4a4a4a; background-color: #f8f9fa; }
.theme-default .item-linha-mini { color: #075e54; }
.theme-default .item-linha-mini:hover { background-color: #f0f2f5; }
.theme-default #janela-chat { background-color: #efeae2; background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); }
.theme-default .cabeçalho-chat { background-color: #f0f2f5; }
.theme-default .balao-msg.recebida { background-color: #ffffff; align-self: flex-start; }
.theme-default .balao-msg.enviada { background-color: #d9fdd3; align-self: flex-end; }
.theme-default .barra-entrada-chat { background-color: #f0f2f5; }
.theme-default .btn-enviar { background-color: #00a884; }
.theme-default .modal-box h3 { color: #075e54; }
.theme-default .btn-salvar { background-color: #075e54; }


/* ==================== TEMA 2: MSN CLASSIC ==================== */
.theme-msn { background-color: #e3efff; border: 4px solid #7faaff; border-radius: 4px; font-family: 'Tahoma', sans-serif; }
.theme-msn #menu-lateral { background-color: #ffffff; border-right: 2px solid #a4c6ff; width: 320px; }
.theme-msn .cabeçalho-menu { background: linear-gradient(to bottom, #7caaff 0%, #4a84f6 100%); color: white; padding: 10px; border-bottom: 2px solid #2e62c9; }
.theme-msn .perfil-usuario-topo { background: #fff; border: 2px solid #7faaff; border-radius: 2px; padding: 6px; color: #000; margin-top: 8px; }
.theme-msn .avatar-topo-container { border-radius: 0%; border: 1px solid #666; width: 48px; height: 48px; }
.theme-msn .musica-usuario-atual { background: none; color: #0044cc; padding: 0; font-size: 11px; text-decoration: underline; }
.theme-msn .abas-menu { background-color: #f0f0f0; padding: 4px 4px 0 4px; border-bottom: 1px solid #aca899; gap: 0; }
.theme-msn .aba { background-color: #e0dfe3; border: 1px solid #aca899; border-bottom: none; border-radius: 3px 3px 0 0; color: #000; padding: 8px 4px; font-size: 11px; }
.theme-msn .aba.ativa { background-color: #ffffff; color: #000; font-weight: bold; border: 1px solid #aca899; border-bottom: 1px solid #fff; margin-bottom: -1px; z-index: 5; }
.theme-msn .item-linha { padding: 10px 12px; border-bottom: none; }
.theme-msn .avatar-img { width: 22px; height: 22px; border-radius: 0%; border: 1px solid #999; margin-right: 8px; }
.theme-msn .linha-topo strong { font-size: 12px; color: #000; font-weight: normal; }
.theme-msn .linha-sub { font-size: 11px; color: #666; }
.theme-msn .item-linha:hover, .theme-msn .conversa-ativa { background-color: #cbe3ff; outline: 1px dotted #0044cc; }
.theme-msn #janela-chat { background-color: #f1f5fb; background-image: none; }
.theme-msn .cabeçalho-chat { background: linear-gradient(to bottom, #e8f1fc 0%, #d2e4f9 100%); border-bottom: 1px solid #a4c6ff; padding: 8px 15px; }
.theme-msn .info-usuario-chat #avatar-chat { display: none; }
.theme-msn .area-mensagens { background-color: #ffffff; border: 2px solid #abc7ec; margin: 10px; border-radius: 0px; padding: 10px; }
.theme-msn .balao-msg { background: none !important; border: none !important; box-shadow: none !important; padding: 2px 0 !important; max-width: 100% !important; font-size: 12px; display: block; }
.theme-msn .balao-msg.enviada { align-self: flex-start; color: #ff4500; }
.theme-msn .balao-msg.recebida { align-self: flex-start; color: #0000ff; }
.theme-msn .balao-msg.enviada::before { content: "Você diz: "; font-weight: bold; display: block; color: #b34a00; }
.theme-msn .balao-msg.recebida::before { content: "Contato diz: "; font-weight: bold; display: block; color: #1e40af; }
.theme-msn .barra-entrada-chat { background-color: #f1f5fb; padding: 10px; }
.theme-msn .barra-entrada-chat input { border: 2px solid #abc7ec; border-radius: 0px; }
.theme-msn .btn-enviar { background: linear-gradient(to bottom, #ffffff 0%, #dcdcdc 100%); color: #000; border: 1px solid #7f9db9; border-radius: 3px; width: 65px; height: 32px; font-size: 11px; }


/* ==================== TEMA 3: MSN DARK RETRO ==================== */
.theme-msndark { background-color: #1e293b; border: 4px solid #334155; border-radius: 4px; font-family: 'Tahoma', sans-serif; color: #f8fafc; }
.theme-msndark #menu-lateral { background-color: #0f172a; border-right: 2px solid #334155; width: 320px; }
.theme-msndark .cabeçalho-menu { background: linear-gradient(to bottom, #334155 0%, #1e293b 100%); color: #f1f5f9; padding: 10px; border-bottom: 2px solid #0f172a; }
.theme-msndark .perfil-usuario-topo { background: #1e293b; border: 2px solid #475569; border-radius: 2px; padding: 6px; color: #fff; margin-top: 8px; }
.theme-msndark .avatar-topo-container { border-radius: 0%; border: 1px solid #94a3b8; width: 48px; height: 48px; }
.theme-msndark .musica-usuario-atual { background: none; color: #38bdf8; padding: 0; font-size: 11px; text-decoration: underline; }
.theme-msndark .abas-menu { background-color: #1e293b; padding: 4px 4px 0 4px; border-bottom: 1px solid #475569; gap: 0; }
.theme-msndark .aba { background-color: #334155; border: 1px solid #475569; border-bottom: none; border-radius: 3px 3px 0 0; color: #cbd5e1; padding: 8px 4px; font-size: 11px; }
.theme-msndark .aba.ativa { background-color: #0f172a; color: #f8fafc; font-weight: bold; border: 1px solid #475569; border-bottom: 1px solid #0f172a; margin-bottom: -1px; z-index: 5; }
.theme-msndark .item-linha { padding: 10px 12px; border-bottom: none; }
.theme-msndark .avatar-img { width: 22px; height: 22px; border-radius: 0%; border: 1px solid #475569; margin-right: 8px; }
.theme-msndark .linha-topo strong { font-size: 12px; color: #f8fafc; font-weight: normal; }
.theme-msndark .linha-sub { font-size: 11px; color: #94a3b8; }
.theme-msndark .item-linha:hover, .theme-msndark .conversa-ativa { background-color: #334155; outline: 1px dotted #38bdf8; }
.theme-msndark #janela-chat { background-color: #0f172a; background-image: none; }
.theme-msndark .cabeçalho-chat { background: linear-gradient(to bottom, #1e293b 0%, #0f172a 100%); border-bottom: 1px solid #334155; padding: 8px 15px; }
.theme-msndark .info-usuario-chat strong { color: #fff; }
.theme-msndark .info-usuario-chat #avatar-chat { display: none; }
.theme-msndark .area-mensagens { background-color: #1e293b; border: 2px solid #475569; margin: 10px; border-radius: 0px; padding: 10px; }
.theme-msndark .balao-msg { background: none !important; border: none !important; box-shadow: none !important; padding: 2px 0 !important; max-width: 100% !important; font-size: 12px; display: block; }
.theme-msndark .balao-msg.enviada { align-self: flex-start; color: #f97316; }
.theme-msndark .balao-msg.recebida { align-self: flex-start; color: #38bdf8; }
.theme-msndark .balao-msg.enviada::before { content: "Você diz: "; font-weight: bold; display: block; color: #ea580c; }
.theme-msndark .balao-msg.recebida::before { content: "Contato diz: "; font-weight: bold; display: block; color: #0284c7; }
.theme-msndark .barra-entrada-chat { background-color: #0f172a; padding: 10px; }
.theme-msndark .barra-entrada-chat input { border: 2px solid #475569; border-radius: 0px; background-color: #1e293b; color: #fff; }
.theme-msndark .btn-enviar { background: linear-gradient(to bottom, #334155 0%, #1e293b 100%); color: #fff; border: 1px solid #475569; border-radius: 3px; width: 65px; height: 32px; font-size: 11px; }
.theme-msndark .secao-titulo { color: #fff; background-color: #334155; font-size: 11px; }

/* CAMERAS E EXTRA OVERLAYS */
.camera-preview-box { position: absolute; bottom: 60px; left: 5%; width: 90%; height: 260px; background: #000; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; z-index: 50; border: 3px solid #00a884; }
#video-preview { flex: 1; object-fit: cover; }
.controles-camera { display: flex; justify-content: center; gap: 10px; padding: 8px; background: #111; }
.btn-cam-acao { background-color: #00a884; color: white; border: none; padding: 6px 12px; border-radius: 4px; font-weight: bold; cursor: pointer; }
.btn-cam-fechar { background-color: #555; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }

.tela-chamada-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(7, 94, 84, 0.95); z-index: 100; display: flex; justify-content: center; align-items: center; color: white; }
.chamada-box { text-align: center; }
.chamada-avatar-anim { font-size: 60px; margin-bottom: 15px; animation: pulse 1.5s infinite; }
.btn-desligar { background-color: #d32f2f; color: white; border: none; padding: 10px 25px; border-radius: 20px; font-weight: bold; cursor: pointer; margin-top: 20px; }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); opacity: 0.8; } }
@keyframes efeitoTremer { 0%, 100% { transform: translate(0, 0); } 10%, 30%, 50%, 70%, 90% { transform: translate(-4px, -2px); } 20%, 40%, 60%, 80% { transform: translate(4px, 2px); } }
.atencao-ativa { animation: efeitoTremer 0.4s ease-in-out; }