/* Adicione no topo do seu style.css */

* {
    /* Impede a seleção de texto em toda a aplicação */
    -webkit-user-select: none;
    /* Safari, Chrome */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    user-select: none;
    /* Padrão */

    /* Remove o "brilho" azul/cinza que aparece ao tocar em links/botões no mobile */
    -webkit-tap-highlight-color: transparent;

    /* Remove a borda de foco que pode aparecer ao clicar em elementos */
    outline: none;
}

/* Impede que imagens e links sejam "arrastados" pelo utilizador */
img,
a {
    -webkit-user-drag: none;
    user-drag: none;
}

:root {
    --azul-claro: #51c0f0;
    --azul-escuro: #004766;
    --azul-gradiente: linear-gradient(135deg, #012838 0%, #004766 100%);
    --azul-gradiente-rev: linear-gradient(135deg, #004766 0%, #80d9ff 100%);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--azul-gradiente);
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
}

.app-header {
    background: rgba(0, 71, 102, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 16px 0 16px;
    text-align: center;
    border-bottom: 1px solid rgba(128, 217, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-gm {
    width: 120px;
    max-width: 50vw;
    margin: 0 auto 8px auto;
    display: block;
}

.app-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--azul-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 2px 8px #00476633;
}

.app-title i {
    font-size: 1.2em;
    color: var(--azul-claro);
}

.main-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-bottom: 110px;
    min-height: 100dvh;
}

.settings-section {
    background: rgba(128, 217, 255, 0.10);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(128, 217, 255, 0.15);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-form input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 71, 102, 0.10);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.settings-form input:focus {
    background: rgba(128, 217, 255, 0.15);
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px #80d9ff33;
}

.settings-form input::placeholder {
    color: #b3e6ff;
}

.connect-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--azul-gradiente);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px #80d9ff33;
}

.connect-btn:active {
    transform: translateY(1px);
}

.status-section {
    text-align: center;
    padding: 12px;
    background: rgba(128, 217, 255, 0.08);
    border-radius: 12px;
    font-size: 14px;
    color: #e0f7ff;
    min-height: 20px;
}

.participants-section {
    background: rgba(0, 71, 102, 0.10);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(128, 217, 255, 0.10);
}

.participants-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--azul-escuro);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.participant-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-list li {
    background: rgba(128, 217, 255, 0.15);
    color: #a3a8f7;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
}

.participant-list li::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--azul-claro);
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(128, 217, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(128, 217, 255, 0.10);
    min-height: 300px;
    max-height: 50vh;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #80d9ff44;
    border-radius: 2px;
}

.message {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 85%;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.message.other {
    background: rgba(0, 71, 102, 0.15);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.message.own {
    background: var(--azul-gradiente-rev);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.message-sender {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.8;
}

.chat-input {
    display: flex;
    border-top: 1px solid #80d9ff22;
    background: rgba(0, 71, 102, 0.10);
}

.chat-input input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 16px;
}

.chat-input input::placeholder {
    color: #b3e6ff;
}

.send-btn {
    padding: 14px 18px;
    border: none;
    background: var(--azul-gradiente);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:active {
    background: var(--azul-gradiente-rev);
}

.send-btn:disabled {
    background: #80d9ff44;
    cursor: not-allowed;
}

.ptt-section {
    padding: 16px;
    display: flex;
    justify-content: center;
    position: sticky;
    bottom: 0;
    background: rgba(0, 71, 102, 0.15);
    backdrop-filter: blur(10px);
    border-top: 1px solid #80d9ff22;
}

.ptt-button {
    font-family: 'Poppins', sans-serif;
    width: 80%;
    max-width: 280px;
    padding: 18px 24px;
    border: none;
    border-radius: 50px;
    background: var(--azul-gradiente);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 25px #80d9ff44;
    position: relative;
    overflow: hidden;
}

.ptt-button:active {
    transform: scale(0.95);
}

.ptt-button:disabled {
    background: #80d9ff44;
    color: #b3e6ff;
    cursor: not-allowed;
    box-shadow: none;
}

.ptt-button.recording {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    animation: pulse-recording 1.5s infinite;
}

.ptt-button i {
    font-size: 18px;
}

@keyframes pulse-recording {
    0% {
        box-shadow: 0 0 0 0 #ff6b6b77;
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    70% {
        box-shadow: 0 0 0 15px #ff6b6b00;
    }

    100% {
        box-shadow: 0 0 0 0 #ff6b6b00;
        transform: scale(1);
    }
}

@media (min-width: 768px) {
    .main-content {
        padding: 24px;
        gap: 20px;
    }

    .app-title {
        font-size: 1.6rem;
    }

    .settings-form {
        flex-direction: row;
        align-items: end;
    }

    .input-group {
        flex: 1;
    }

    .connect-btn {
        width: auto;
        min-width: 120px;
    }

    .chat-section {
        max-height: 60vh;
    }

    .ptt-button {
        width: 60%;
        max-width: 320px;
        padding: 20px 32px;
        font-size: 18px;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 600px;
        margin: 0 auto;
        box-shadow: 0 0 50px #00476655;
    }

    .main-content {
        padding: 32px;
        gap: 24px;
    }

    .app-title {
        font-size: 1.8rem;
    }

    .chat-section {
        max-height: 70vh;
    }

    .ptt-button:hover:not(:disabled) {
        background: var(--azul-gradiente-rev);
        box-shadow: 0 8px 30px #80d9ff55;
    }

    .connect-btn:hover {
        background: var(--azul-gradiente-rev);
    }
}

@media (min-width: 1440px) {
    .app-container {
        max-width: 700px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .app-header {
        padding: 8px 16px;
    }

    .app-title {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 12px;
        gap: 12px;
    }

    .chat-section {
        min-height: 200px;
        max-height: 10vh;
    }

    .ptt-section {
        padding: 12px;
    }

    .ptt-button {
        padding: 14px 20px;
        font-size: 14px;
    }
}

@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .ptt-section {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* Novo layout para mensagens no chat */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 90%;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    background: rgba(0, 71, 102, 0.10);
    margin-bottom: 2px;
    box-shadow: 0 2px 8px #00476611;
}

.message.own {
    background: var(--azul-gradiente-rev);
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.message.other {
    background: rgba(0, 71, 102, 0.15);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #51c0f0;
    color: #fff;
    font-weight: 700;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px #00476622;
    border: 2px solid #fff2;
    margin-top: 2px;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.message-sender {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #51c0f0;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px #00476622;
}

.message.own .message-sender {
    color: #fff;
}

.message-text {
    font-size: 15px;
    color: #fff;
    font-weight: 400;
    word-break: break-word;
}

/* Área de mensagens menor, com scroll, tipo jump top */
.chat-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 8px;
}

.chat-messages {
    flex: 1 1 auto;
    max-height: 120px;
    /* ajuste conforme necessário */
    overflow-y: auto;
    display: flex;
    /* flex-direction: column-reverse; mensagens novas embaixo, scroll sobe */
    /* background: #f7f7f7; */
    background: #80d9ff44;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 4px;
}

/* Botão PTT valorizado */
.ptt-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px;
}

.ptt-button {
    width: 90vw;
    max-width: 400px;
    height: 56px;
    background: linear-gradient(90deg, #007bff 60%, #0056b3 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.ptt-button:active {
    background: linear-gradient(90deg, #0056b3 60%, #003366 100%);
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Footer fixo com créditos */
.footer-info {
    width: 100vw;
    background: #222;
    color: #fff;
    font-size: 0.95rem;
    text-align: center;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.footer-credits {
    padding: 4px 0 8px 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Ajustes gerais para mobile */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
    /* espaço para footer */
}

.main-content {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #90d4f144;
    border-radius: 8px 8px 0 0;
}

.expand-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #007bff;
    transition: transform 0.2s;
}

.chat-messages {
    transition: max-height 0.3s;
    overflow-y: auto;
    /* background: #f7f7f7; */
    background: #80d9ff44;
    border-radius: 0 0 8px 8px;
    padding: 8px;
    max-height: 120px;
    /* Compacto por padrão */
    min-height: 60px;
    display: flex;
    flex-direction: column;
}

.chat-section.expanded .chat-messages {
    max-height: 320px;
    /* Expande para mostrar mais mensagens */
}

.toast {
    visibility: hidden;
    min-width: 200px;
    max-width: 90vw;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px 20px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.toast.show {
    visibility: visible;
    opacity: 0.95;
    pointer-events: auto;
}

.chat-messages {
    /* ...suas regras já existentes... */
    overflow-y: auto;
    overflow-x: auto;
    /* <-- Adicione esta linha */
    white-space: pre-wrap;
    /* Garante quebra de linha, mas permite scroll horizontal se necessário */
    word-break: break-word;
}

.chat-messages::-webkit-scrollbar {
    height: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #80d9ff44;
    border-radius: 2px;
}

.ptt-button {
    width: 90vw;
    max-width: 400px;
    height: 56px;
    background: linear-gradient(90deg, #007bff 60%, #0056b3 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.ptt-button i {
    font-size: 1.5em;
    /* maior para mobile */
    margin-right: 10px;
}

.ptt-button:active,
.ptt-button.recording {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    /* Efeito de gravação */
    animation: pulse-recording 1.5s infinite;
    color: #fff;
}

@keyframes pulse-recording {
    0% {
        box-shadow: 0 0 0 0 #ff6b6b77;
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    70% {
        box-shadow: 0 0 0 15px #ff6b6b00;
    }

    100% {
        box-shadow: 0 0 0 0 #ff6b6b00;
        transform: scale(1);
    }
}


#settings {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#settings input,
#settings select,
#settings button {
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex: 1 1 200px;
    /* Faz com que cada item tenha tamanho semelhante */
    max-width: 220px;
    min-width: 150px;
    box-sizing: border-box;
}

#settings button {
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#settings button:hover {
    background-color: #0056b3;
}

/* Modal overlay */
.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    /* align-items: center; */
    align-items: flex-start;
    /* Mudança: alinha no topo em vez do centro */
    padding: 1rem;
    padding-top: 10vh;
    /* Espaço do topo para não grudar */
    overflow-y: auto;
    /* Permite scroll se necessário */
}

/* Card moderno */
.modal-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 2rem;
    /* Espaço extra no final */
    max-height: 80vh;
    /* Limita altura máxima */
    overflow-y: auto;
    /* Scroll interno se necessário */
}

/* Logo opcional */
.modal-logo {
    width: 120px;
    margin: 0 auto 0.2rem auto;
}

.modal-entrar {
    margin-top: 20px;
}

/* Campos */
.modal-card input {
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 100%;
    box-sizing: border-box;
}

.modal-card label {
    font-weight: bold;
    text-align: left;
    width: 100%;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.modal-card button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
}


.login-error {
    color: red;
    font-size: 0.9rem;
    margin-top: -0.5rem;
}

.modal-card {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-form-card {
    background: rgba(0, 71, 102, 0.08);
    border: 1px solid rgba(128, 217, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.settings-form-card label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #b3e6ff;
}

.settings-form-card input,
.settings-form-card select {
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 71, 102, 0.10);
    color: #61ddf3;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    appearance: none;
}

.settings-form-card input::placeholder,
.settings-form-card select:invalid {
    color: #b3e6ff;
}

.settings-form-card input:focus,
.settings-form-card select:focus {
    background: rgba(128, 217, 255, 0.15);
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 3px #80d9ff33;
}

.settings-form-card select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='%23b3e6ff' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

.nome-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 2px #0002;
    transition: background 0.2s;
    margin-left: 8px;
}

.status-indicator.online {
    background: #2ecc40;
    /* verde */
}

.status-indicator.offline {
    background: #ff4136;
    /* vermelho */
}

/* Estilos para o botão de emergência */
.emergency-button {
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    background-color: #d9534f;
    /* Vermelho */
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    /* Espaçamento */
}

.emergency-button:hover:not(:disabled) {
    background-color: #c9302c;
    /* Vermelho mais escuro */
}

.emergency-button:disabled {
    background-color: #a5a5a5;
    cursor: not-allowed;
}

/* Estilos para as listas de usuários e canais */
.online-users-section,
.active-channels-section {
    background-color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
}

#online-users-list li,
#active-channels-list li {
    cursor: pointer;
    transition: background-color 0.2s;
}

#online-users-list li:hover {
    background-color: #e9ecef;
}

/* Estilos para o Modal de Chat Privado */
.modal-private {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    /* Começa escondido */
    justify-content: center;
    align-items: center;
}

.modal-card-private {
    background-color: #ffffff;
    border-radius: 20px;
    width: 92%;
    max-width: 400px;
    height: 65vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.3s ease-in-out;
    overflow: hidden;
}


.modal-header-private {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn-private {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.chat-messages-private {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f9f9f9;
}


.chat-input-private {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
}

.chat-input-private input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.95rem;
}

.send-btn-private {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Adicione este CSS ao seu arquivo style.css */

#emergencyMessageInput {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    margin-top: 5px;
    resize: vertical;
    /* Permite que o usuário redimensione verticalmente */
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-cancel-btn {
    background-color: #6c757d;
    /* Cinza */
    color: white;
}

.modal-cancel-btn:hover {
    background-color: #5a6268;
}

.modal-confirm-btn {
    background-color: #d9534f;
    /* Vermelho, igual ao botão principal */
    color: white;
}

.modal-confirm-btn:hover {
    background-color: #c9302c;
}

/* No final do seu style.css */
.toast.emergency {
    background-color: #d9534f;
    /* Vermelho */
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    padding: 20px;
}

/* Adicione este CSS ao final do seu arquivo style.css */

/* 1. O Container do Scroll */
.horizontal-scroll-container {
    display: flex;
    /* Transforma os itens internos em uma linha */
    overflow-x: auto;
    /* Permite a rolagem horizontal */
    width: 100%;

    /* A Mágica do Snap Scroll (faz parar no lugar certo) */
    scroll-snap-type: x mandatory;

    /* Para esconder a barra de rolagem, mas manter a funcionalidade */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    padding-bottom: 15px;
    /* Espaço para não cortar a sombra */
}

/* Esconde a barra de rolagem no Chrome, Safari e Opera */
.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

/* 2. Os Itens Dentro do Scroll */
.horizontal-scroll-container>section {
    /* Define que cada seção não deve encolher e ocupará 100% da largura do container */
    flex: 0 0 100%;

    width: 100%;

    /* Define o ponto de alinhamento para o snap */
    scroll-snap-align: start;

    /* Pequeno ajuste para garantir o espaçamento correto */
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
}

/* Move a seção de status para o centro, fica melhor */
.status-section {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    /* Garante uma altura mínima */
}


/* 3. Estilo para os Pontos de Navegação */
.scroll-dots {
    text-align: center;
    padding: 10px 0;
}

.dot {
    display: inline-block;
    height: 10px;
    width: 10px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: #007bff;
    /* Cor do ponto ativo */
}


#userInfoContainer {
    display: none;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    /* Colunas para info e botão */
    align-items: center;
    gap: 15px;
}

.user-details .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.user-details .info-item:first-child {
    margin-bottom: 5px;
}

.user-details .info-label {
    font-weight: 600;
    opacity: 0.8;
}

.user-details .info-value {
    font-weight: 400;
}

.logout-btn {
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background-color: #c9302c;
}

.user-actions {
    display: flex;
    align-items: center;
    /* Alinha os botões verticalmente */
    gap: 15px;
    /* Espaçamento entre os botões */
}

#adminLink {
    color: white;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

#adminLink:hover {
    color: #ddd;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.75);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
}

.loading-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Adicione no final do seu style.css */

/* Ajuste no input de chat para dar espaço ao novo botão */
.chat-input input {
    flex: 1;
}

/* Garante que os botões no input de chat tenham o mesmo estilo */
.chat-input .send-btn {
    padding: 14px 16px;
    /* Tamanho consistente */
    font-size: 1.1rem;
    /* Tamanho do ícone */
}

/* Estilo para a imagem dentro do chat */
.message-image {
    max-width: 200px;
    /* Tamanho da miniatura */
    max-height: 200px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 8px;
    /* Espaçamento do texto/nome */
    transition: filter 0.2s ease;
}

.message-image:hover {
    filter: brightness(0.9);
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    width: 100%;
    padding-right: 40px;
    /* Espaço para o botão do olho */
}

.toggle-password-btn {
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #007bff;
    /* color: #ff0000;  */
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.toggle-password-btn:focus {
    outline: none;
    color: #0056b3;
    /* Azul mais escuro ao focar */
}

.toggle-password-btn:hover {
    color: #0056b3;
    /* Azul mais escuro ao passar o mouse */
}

/* Botão que fecha o modal  da imagem enviada */
.close-btn-private {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 2.2rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    /* fundo visível em imagem clara */
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s;
}

.close-btn-private:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Bolha moderna para mensagem privada */
.private-message-bubble {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 8px;
    max-width: 85%;
    animation: fadeInMsg 0.25s;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.private-message-bubble.own {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.private-message-bubble.other {
    align-self: flex-start;
}

.private-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #51c0f0;
    color: #fff;
    font-weight: 700;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #00476622;
    border: 2px solid #fff2;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.private-message-content {
    background: linear-gradient(135deg, #e3f6ff 0%, #c6e6fa 100%);
    color: #222;
    border-radius: 18px 18px 6px 18px;
    padding: 10px 16px;
    min-width: 60px;
    max-width: 100%;
    box-shadow: 0 2px 8px #00476611;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.private-message-bubble.own .private-message-content {
    background: linear-gradient(135deg, #51c0f0 0%, #004766 100%);
    color: #fff;
    border-radius: 18px 18px 18px 6px;
}

.private-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92em;
    margin-bottom: 2px;
    opacity: 0.8;
}

.private-message-sender {
    font-weight: 600;
}

.private-message-time {
    font-size: 0.85em;
    color: #888;
}

.private-message-bubble.own .private-message-time {
    color: #e0f7ff;
}

.private-message-text {
    font-size: 1.05em;
    word-break: break-word;
    margin-top: 2px;
}

.scroll-container {
    max-height: 200px; /* ajuste conforme necessário */
    overflow-y: auto;
    padding-right: 4px; /* espaço para scrollbar */
    -webkit-overflow-scrolling: touch;
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.scroll-container::-webkit-scrollbar-track {
    background: transparent;
}


/* card dos detalhes de um participante */
.modal-detalhes {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(4px);
}

.modal-content-detalhes {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-align: center;
}

.avatar-circle-detalhes {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #007BFF;
    color: white;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
}

.modal-actions-detalhes button {
    margin: 10px 5px 0;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #007BFF;
    color: white;
    cursor: pointer;
}

.modal-actions-detalhes button:hover {
    background: #0056b3;
}

.avatar-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px auto;
    display: block;
}


