* {
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 🔹 MODALES ESTILIZADOS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 350px;
    width: 90%;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 🔹 INPUTS */
.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* 🔹 BOTONES MODERNOS */
button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 5px 0;
}

#loginBtn {
    background-color: #007bff;
    color: white;
}

#registerBtn {
    background-color: #28a745;
    color: white;
}

.secondary-btn {
    background-color: #f0f0f0;
    color: #333;
}

#closeModal {
    background-color: #ff4c4c;
    color: white;
}

/* 🔹 CHAT */
.chat-container {
    width: 100vw;
    max-width: 500px;
    height: 100%; /* Ocupa toda la altura de la pantalla */
    background: #ffebee; /* Fondo rojo claro */
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header > img {
    width: 120px; /* Ajusta el tamaño del logo */
}

/* Media query para cuando la altura del navegador es mayor que 980px */
@media (min-height: 981px) {
    .header > img {
        width: 200px; /* Cambia el tamaño del logo */
    }
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 12px;
    max-width: fit-content;
    word-wrap: break-word;
    position: relative;
}

.message.right {
    margin-left: auto;
    background-color: #ffcdd2; /* Fondo rosa claro para mensajes enviados */
}

.message.left {
    margin-right: auto;
    background-color: #f5f5f5; /* Fondo gris claro para mensajes recibidos */
}

.message-name {
    font-weight: bold;
    font-size: 14px;
    color: #d32f2f; /* Color rojo oscuro para el nombre */
    margin-bottom: 5px;
}

.message-name > p {
    margin-top: 5px;
}

.message-img {
    /* width: 1000px; */
    max-width: 100%;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    object-fit: contain;
}

.message p {
    font-size: 18px;
    color: #333;
    margin: 0;
}

@media (min-height: 981px) {
    .message p {
        font-size: 25px;
    }
}

.message-input {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #ddd;
    align-items: center;
    background: none;
}

.camera-icon {
    cursor: pointer;
    font-size: 20px;
}

#messageBox {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

#send {
    padding: 10px 20px;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: auto;
}

/* Terminos y condiciones */

.terms {
    margin: 10px 2px;
    text-align: left;
    display: flex;
    align-items: center;
}

#termsCheckbox {
    margin-right: 10px;
    width: auto;
}

#termsLink {
    color: #007bff;
    text-decoration: none;
}

#termsLink:hover {
    text-decoration: underline;
}

#termsModal .modal-content {
    max-width: 600px;
    text-align: left;
}

#termsContent {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

#termsContent li {
    margin-bottom: 10px;
}

/* Modal Usuario */

#userModal .modal-content {
    max-width: 350px;
    text-align: center;
}

#username {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

#confirmRegisterBtn {
    background-color: #28a745;
    color: white;
}

.secondary-btn {
    background-color: #f0f0f0;
    color: #333;
    margin-top: 10px; /* Espacio entre los botones */
}

.secondary-btn:hover {
    background-color: #ddd; /* Efecto hover */
}

/* Estilo para el spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Deshabilitar botones que contienen un spinner */
button:disabled {
    opacity: 0.7; /* Hacer el botón semitransparente */
    cursor: not-allowed; /* Cambiar el cursor a "no permitido" */
}

/* Seleccionar botones que contienen un spinner y deshabilitarlos */
button:has(.spinner) {
    pointer-events: none; /* Deshabilitar clics */
    opacity: 0.7; /* Hacer el botón semitransparente */
    cursor: not-allowed; /* Cambiar el cursor a "no permitido" */
}

#infoModal {
    z-index: 1000;
}

/* Estilos para el header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

#menuButton {
    width: 53px;
    background: none;
    border: none;
    background-color: #d32f2f;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Estilos para el menú flotante */
.floating-menu {
    position: absolute;
    top: 100%;      /* Justo debajo del botón */
    right: 0;        /* Alineado a la derecha del contenedor */
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    padding: 10px;
    min-width: 150px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

/* Contenedor para el botón y menú desplegable */
.menu-container {
    position: relative;
    display: inline-block; /* Ajusta el tamaño al contenido */
}

.floating-menu.show {
    display: block; /* Mostrar cuando tenga la clase "show" */
    opacity: 1;
    transform: translateY(0);
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Espacio entre elementos */
}

#usernameDisplay {
    margin: 0;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

#logoutButton {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#logoutButton:hover {
    background-color: #ff1a1a;
}

.beforee {
    width: 53px;
}