body, html {
    margin: 0;
    padding: 0;
    height: 100dvh;
    width: 100%;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.ventana-fija {
    width: 800px;
    height: 600px; /* ✅ Altura real fija para permitir centrado vertical */
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    position: relative;
    overflow: auto;
    max-height: 100dvh;
}

#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 95vh;
    padding: 30px;
}

#login-screen form {
    background: white;
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    max-width: 360px;
    width: 90%;
    text-align: center;
    border: 2px solid #1ca08f;
}

/* Estilo de texto */
#login-screen h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #1ca08f;
    font-weight: bold;
}

#login-screen label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #444;
    text-align: left;
}

#login-screen input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 20px;
    font-size: 14px;
    box-sizing: border-box;
}

#start-chat-btn {
    padding: 10px 20px;
    background-color: #1ca08f;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#start-chat-btn:hover {
    background-color: #147f70;
}

#start-chat-btn:disabled {
    background-color: #ccc;
    color: #666;
    border: 1px solid #aaa;
    cursor: not-allowed;
    opacity: 0.6;
}

#chat-screen {
    display: flex;
    flex-direction: column;
    height: 100dvh !important;/* nuevo estándar más seguro */
    min-height: 100dvh;
    width: min(96vw, 820px);
    max-width: 820px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0px;
    overflow: hidden;
    background-color: #f9f9f9;
}

#chat-header {
    height: 45px !important;
    position: sticky;
    z-index: 1000;
    background-color: #00695c;
     display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 12px;
     border-bottom: 1px solid #ccc;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    color: white;
    font-size: 1rem;
    font-weight: bold;
}
.chat-message img {
    max-width: 95%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin: 5px auto;
}

.chat-header-left {
  flex: 60%;
  font-size: 1rem;
  font-weight: 500;
}

.chat-header-right {
  flex: 40%;
  text-align: right;
}

.chat-header-right button {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.chat-header-right button:hover {
  background-color: #0056b3;
}

#chat-input {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background-color: white;
    padding: 8px;
}

#chat-title {
    font-size: 1.05rem;
    padding: 0px 15px;
}

#client-container {
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2px;
    width: 800px;
    background-color: white;
    overflow: hidden;
    position: relative;
}

#disconnect-chat-btn {
    background-color: #e53935;
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}

#disconnect-chat-btn:hover {
    background-color: #c62828;
}

#main-menu-btn {
    background-color: #2f25c1;
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}

#main-menu-btn:hover {
    background-color: #5919a2;
}

#chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    display: flex;
    flex-direction: column; /* fuerza a que todo sea vertical */
    align-items: stretch;
    height: auto;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    box-sizing: border-box;
    padding-right: 0px;
}

.chat-input {
    position: sticky;
    bottom: 0;
    z-index: 1000;
    background-color: white;
    display: flex;
    align-items: center;
    padding: 3px 15px;
    border-top: 1px solid #ccc;
    box-sizing: border-box;
    overflow: hidden;
    left: 0;
    right: 0;
    max-width: 100%;
    width: 100%;
    height: 45px;
    border-top: 1px solid #ddd;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message {
    display: flex;
    flex-direction: column;
    width: fit-content;
    min-width: 60%;
    max-width: 90%;
  }

  .chat-message.admin {
    align-self: flex-start;
  }
  
  .chat-message.client {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 0;
  }

  .message-bubble {
    display: inline-block;
    min-width: 75%;
    max-width: 90%;
    width: fit-content;
    padding: 3px 5px;
    margin: 3px 10px;
    border-radius: 10px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 5px !important;
  }

  .message-bubble.admin {
    background-color: #dcf8c6;
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0px;
    max-width: 90%;
    padding-left: 5px;
    animation-name: aparecerBurbuja;
    animation-duration: 0.75s;
    animation-fill-mode: forwards;
  }
  
  .message-bubble.client {
    background-color: #98e0fc;
    align-self: flex-end;
    width: 100%;        
    max-width: 90%;
    min-width: 60%;
    animation-name: aparecerBurbuja;
    animation-duration: 0.75s;
    animation-fill-mode: forwards;
}
/* Menús JSON ocupan casi todo */
.json-section, .json-menu{
    width: 100%;
}

/* Si son muy largos, mejor elipsis */
.json-list-item{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 78%;
    max-width: 85%;
    }

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
  }

.message-sender {
    font-weight: bold;
    font-style: normal;
  }

#client-message-input {
    flex: 1;
    padding: 0px 10px;
    font-size: 14px;
    border: 2px solid #ccc;
    border-radius: 5px;
    outline: none;
    border-top: 2px solid #ddd;
    background: white;
}

#send-message-btn {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 0 16px;
    border-radius: 25%;
    font-size: 18px;
    cursor: pointer;
    height: 40px;
    width: 52px;
    padding-left: 10px;
    padding-right: 10px;
}

.option-button {
    display: inline-block;
    background-color: #0aad60;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    margin-top: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
}
  
.option-button:hover {
    background-color: #08894d;
}
  
.message-content ul {
    list-style: none;
    padding-left: 5px;
}
  
.message-content li {
    margin-bottom: 4px;
    padding-left: 5px;
}
  
.message-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #007bff;
    color: #fff;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 6px;
    overflow: hidden;
}

.message-header, .message-content, .message-text {
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    text-align: justify;
}

.sender-info {
    display: flex;
    align-items: center;
    gap: 6px; /* Esto deja aproximadamente 3 espacios en blanco visuales */
}

.message-content {
    width: 100%;
    font-size: 0.925rem;
    color: #111;
    word-wrap: break-word;
    background: #fff;
    border-radius: 12px;
    padding: 7px;
}

.message-text .json-section{
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.message-text {
    font-size: 14px;
}

.message-time {
    margin-left: auto;
    color: #000000;
    font-size: 11px;
}

.chat-input input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    margin-right: 10px;
    min-height: 40px;
    -webkit-user-select: text;
    user-select: text;
}

.chat-input button {
    background-color: #1ca08f;
    color: white;
    border: none;
    margin-left: 8px;
    padding: 10px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #147f70;
}

/* JSON y menús */
.json-container {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 5px 10px;
}

.json-list {
    padding: 0;
    list-style: none;
    user-select: none;
}

.json-list-item {
    border: 2px solid #1ca08f;
    border-radius: 20px;
    padding: 6px 10px;
    margin: 6px auto;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    color: #1ca08f;
    font-size: 14px;
    text-align: center;
    width: 75%;
    max-width: 350px;
}

.json-list-item:hover {
    background-color: #1ca08f;
    color: #ffffff;
    transform: scale(1.04);
}

.json-text {
    padding: auto;
    display:flex;
}

.json-header {
    margin: 5px 10px;
}

.json-body {
    margin: 8px 10px;
}

.json-container, .json-list-item {
    width: 100%;
    max-width: 100%;
    background-color: transparent; /* <- clave: evita doble blanco */
    border-radius: 15px;
    padding: 0;                   /* <- clave: evita “desfase” */
    box-sizing: border-box;
}

.chat-image {
    max-width: 70%;
    margin: 4px auto; /* Esto la centra horizontalmente */
    border-radius: 10px;
    display: block;
}

/* Para imágenes verticales (más altas que anchas) */
.chat-image.vertical {
  max-height: 360px;
  max-width: 80%;
}

.message-avatar img, .message-avatarC img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.message-avatar img, .avatar-fallback {
    width: 18px !important;
    height: 18px !important;
    font-size: 8px; /* Tamaño de letra reducido si es fallback */
    line-height: 8px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }

.avatar-fallback {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ccc;
    color: #fff;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.json-message-container {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    border-radius: 12px;
    background-color: #f7f7f7;
    width: 90%;
    max-width: 90%;
    box-sizing: border-box;
    min-width: 270px;
    margin: 5px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);  
}

.json-message-container h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
    color: #005a7e;
}

/* 🔹 Contenedor de los botones en una sola fila */
.json-button-wrapper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;                
    justify-content: center;
}

/* Botón principal JSON (estilo original conservado, ancho igualado) */
.json-button {
    display: block;
    width: 75%;
    max-width: 300px;
    padding: 10px 16px;
    margin: 5px auto;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 15px;
    background-color: #1ca08f;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.json-button:hover {
    background-color: #147f70;
    transform: scale(1.05);
}

.json-list-item {
    display: block;
    width: 75%;
    max-width: 335px;
    padding: 5px 16px;
    margin: 3px auto;
    font-size: 15px;
    font-weight: 500;
    border: 1.5px solid #1ca08f;
    border-radius: 24px;
    background-color: #ffffff;
    color: #1ca08f;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Hover effect */
.json-button:hover, .json-list-item:hover {
    background-color: #182789;
}

/* === Estilos para mensajes de audio === */
.audio-player {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #fff;
    border: 2px solid #1ca08f;
    padding: 5px 10px;
    border-radius: 15px;
    max-width: 60%;
    margin-top: 3px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
    margin-left: auto;
    margin-right: auto; /* <-- centrado horizontal */
    border-top-width: 1px;
    border-bottom-width: 1px;
}

.audio-play-btn {
    background-color: #1ca08f;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.audio-play-btn:hover {
    background-color: #138f7b;
}

.audio-progress {
    display: flex;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #e0e0e0;
    accent-color: #1ca08f;
}

.audio-duration {
    font-size: 12px;
    color: #333;
    min-width: 40px;
    text-align: left;
}

.audio-toggle {
    background-color: #1ca08f;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    width: 32px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.audio-toggle i {
    font-size: 16px;
}

@media screen and (max-width: 480px) {   
    #chat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 10vh !important;
        padding: 0 5px;
        box-sizing: border-box;
        overflow: hidden;
        gap: 3px;
    }

    .chat-header-left {
        display: flex;
        flex-direction: column;
        justify-content: center;
        line-height: 1.1em;
        font-size: 13px;
        max-width: 60%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .chat-message.client, .chat-message.admin {
        width: 100%;
        justify-content: center;
        max-width: 100%;    /* agregado al ultimo*/
    }

    .img-bienvenida {
        width: 15vw !important;
    }

    #client-name-display {
        font-weight: bold;
        font-size: 14px;
        line-height: 1em;
        margin-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-header-right {
        display: flex;
        flex-shrink: 0;
        gap: 4px;
        align-items: center;
    }

    .chat-header-right button {
        font-size: 12px;
        padding: 4px 6px;
        height: 28px;
        white-space: nowrap;
    }

    .message-bubble {
        width: 100% !important;
        max-width: 100%;
    }

    .chat-input input[type="text"] {
        width: 70%;
        font-size: 14px;
    }

    .message-bubble img {
        max-width: 95%;
        height: auto;
        display: block;
        margin: 6px auto;
        border-radius: 10px;
    }
    
    #send-message-btn {
        width: 20%;
        max-width: 50px;
    }

    .ventana-fija {
        width: 95vw;
        height: auto;
        padding: 10px;
    }
}

@media (max-width: 800px) {
    .json-main-button {
        font-size: 14px;
        padding: 5px 10px;
        width: 85%;
    }

    .json-button, .json-list-item {
      width: 90%;
      font-size: 14px;
      padding: 4px 10px;
    }
    
    .ventana-fija {
        width: 90vw;
        height: auto;
        padding: 10px;
    }
}

@media screen and (max-width: 768px) {
    #chat-header, #chat-input {
        padding: 10px;
    }
}

.reply-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}

.reply-button {
    background-color: #ffffff;
    border: 2px solid #1ca08f;
    color: #1ca08f;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px auto;
    width: 70%;
    max-width: 320px;
    display: block;
    text-align: center;
    box-sizing: border-box;
}

.reply-button:hover {
    background-color: #168977;
}

.popup-despedida {
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    margin: 10px auto;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.popup-despedida h3 {
    color: #0b8457;
    margin-bottom: 8px;
}

.btn-aceptar {
    display: block;
    margin: 16px auto 4px auto; /* centrado horizontal */
    padding: 10px 20px;
    background-color: #2196F3; /* Azul vibrante */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.btn-aceptar:hover {
    background-color: #1976D2;
    transform: scale(1.05);
}

.btn-aceptar:active {
    transform: scale(0.98);
}

.socials-container{
  display: flex;
  gap: 20px;
}

.socials-container a{
    background-color: white;
    padding: 1em;
    border-radius: 50%;
    height: 64px;
    width: 64px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.socials-container a svg{
    height: 32px;
}

.socials-container a::before{
    content: attr(data-social);
    position: absolute;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 100px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
    transform: translateY(-30px) rotate(25deg);
    opacity: 0;
    transition: 200ms cubic-bezier(.42,0,.44,1.68);
}

.socials-container a:hover{
    background-color: var(--accent-color);
    fill: white;
}

.socials-container a::after{
    content: '';
    position: absolute;
    height: 0;
    width: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--accent-color);
    transform: translateY(0) rotate(25deg);
    opacity: 0;
    transition: 200ms cubic-bezier(.42,0,.44,1.68);
}

.json-toggle {
    max-width: 80%; /* ajusta al tamaño que se vea más coherente */
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
}

.json-section {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.socials-container a:hover::before{
    transform: translateY(-65px) rotate(0);
    opacity: 1;
}

.socials-container a:hover::after{
    transform: translateY(-42px) rotate(0);
    opacity: 1;
}

#zoom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
}

#zoom-image {
    max-width: 95%;
    max-height: 85%;
    border-radius: 10px;
    box-shadow: 0 0 15px #000;
}

#zoom-container img {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    border-radius: 10px;
    cursor: default;
}

.zoom-hidden {
    display: none;
}

#zoom-container {
  display: none;
}

#zoom-container.active {
  display: flex;
}

.zoom-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 10000;
}

#zoom-container.active .zoom-hint {
    opacity: 1;
}

.chat-date-divider {
    text-align: center;
    margin: 10px auto;
    padding: 5px;
    background-color: #e4e4e4;
    color: #333;
    font-size: 14px;
    border-radius: 20px;
    width: fit-content;
}

.combo-redes-con-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.menu-container {
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.menu-container .json-section {
    max-width: 400px;
    width: 100%;
}

.system-message {
    text-align: center;
    color: #b00;
    background: #fff0f0;
    border: 1px solid #e0c0c0;
    padding: 8px 12px;
    margin: 10px auto;
    max-width: 90%;
    border-radius: 8px;
    font-weight: bold;
}

.chat-alert.disconnect-alert {
    background-color: #ffe6e6;
    border-left: 5px solid #ff4d4d;
    padding: 15px;
    margin: 20px 0;
    font-size: 1rem;
    color: #b30000;
    border-radius: 8px;
    text-align: center;
}

.alerta-desconexion {
    background-color: #ffe0e0;
    color: #b30000;
    padding: 20px;
    margin: 20px;
    font-size: 18px;
    border-left: 6px solid red;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.desconexion-alerta {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #f44336;
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    z-index: 9999;
    font-size: 18px;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    animation: aparecer 0.3s ease-in-out;
}

@keyframes aparecer {
    from { opacity: 0; transform: scale(0.8) translate(-50%, -50%); }
    to { opacity: 1; transform: scale(1) translate(-50%, -50%); }
}

.fila-bienvenida {
    display: flex;
    gap: 10px;
    margin: 5px 0;
    align-items: flex-start;
}

.img-bienvenida {
    max-width: 90px;
    height: auto;
    border-radius: 8px;
}

.texto-bienvenida {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    text-align: justify;
}

.comment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 30, 0.7); /* fondo semitransparente */
    backdrop-filter: blur(4px); /* difumina el fondo */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.comment-content {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
  z-index: 1000;
}

.comment-content input, .comment-content textarea {
    width: 100%;
    padding: 10px;    
    padding-right: 0px;
    padding-left: 5px;
    border: 1px solid #bbb;    
    margin-top: 5px;
    margin-bottom: 5px;
    border-radius: 5px;
    font-size: 14px;

}

.comment-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.comment-buttons button {
    flex: 1;
    margin: 0 5px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #0263e0;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.comment-buttons button:hover {
    background-color: #024eb1;
}

.hidden {
  display: none !important; /* Oculta cualquier elemento */
}

.show {
  display: flex; /* Muestra un elemento*/
}

.show-block {
  display: block !important;    /* Elemento visible como bloque */
}

.show-flex {
  display: flex !important; /* Elemento visible como flex */
}

.show-inline {
    display: inline-block !important; /* Elemento visible como inline-block */
}

.flex-center { 
    display: flex; justify-content: center; align-items: center; 
}

.loader {
    width: 30px;
    height: 30px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1ca08f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto;
}

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

#comentario-enviando {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  position: absolute;
  inset: 0;
}

#comentario-enviando p {
  font-size: 1.2em;
  font-weight: 500;
  margin-bottom: 15px;
}

.popup-confirmacion {
    background-color: #1ca08f;
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
}

.sending-box {
    background: white;
    padding: 25px 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.25);
    text-align: center;
}

.sending-box p {
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: 500;
}

.status-success {
    color: green;
    font-weight: bold;
    margin-top: 8px;
}

.status-error {
    color: red;
    font-weight: bold;
    margin-top: 8px;
}

.reconnect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.reconnect-box {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.reconnect-status {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #333;
}

.reconnect-actions button {
    padding: 10px 15px;
    margin: 5px;
    font-size: 0.95rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#btn-reconectar {
    background-color: #2c8c2c;
    color: white;
}

#btn-reset-chat {
    background-color: #a32e2e;
    color: white;
}


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

.combo-auto-reply a[href^="tel:"] {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.combo-auto-reply a[href^="tel:"]:hover {
    text-decoration: underline;
}

.tooltip {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.tooltip .tooltiptext {
    background-color: black;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    font-size: 12px;
    position: absolute;
    z-index: 1;
    top: 105px;
    left: 65px;
    align-items: center;
    width: 60%;
    margin-bottom: 5px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
}

.speak-btn {
    background-color: #1ca08f;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.speak-btn:hover {
    background-color: #138f7b;
}

.speak-player {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #fff;
    border: 2px solid #1ca08f;
    padding: 5px 10px;
    border-radius: 15px;
    max-width: 30px;
    margin-top: 3px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
    margin-left: auto;
    margin-right: auto; /* <-- centrado horizontal */
    border-top-width: 1px;
    border-bottom-width: 1px;
}

/* solo para pruebas */
.test-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #222;
    color: white;
    padding: 15px;
    border-radius: 10px;
    z-index: 9999;
    box-shadow: 0 0 10px black;
}

.test-panel button {
    display: block;
    margin: 5px 0;
    width: 100%;
  }

@keyframes aparecerBurbuja {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0);}
}

.loader-container {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white; /* o rgba(255,255,255,0.9) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#loader-container .loader2 {
    margin-bottom: 20px;
}

#loader-container .loader-text {
    font-size: 1.2rem;
    color: #007bff;
    font-weight: bold;
    text-align: center;
}

.loader2 {
    width: 70px;
    height: 70px;
    position: relative;
}

.loader2:before {
    content: "";
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 6px solid #007bff;
    position: absolute;
    top: 0;
    left: 0;
    animation: pulse 1s ease-in-out infinite;
}

.loader2:after {
    content: "";
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 6px solid transparent;
    border-top-color: #007bff;
    position: absolute;
    top: 0;
    left: 0;
    animation: spin 2s linear infinite;
}

.loader-text {
    font-size: 24px;
    margin-top: 20px;
    color: #007bff;
    font-family: Arial, sans-serif;
    text-align: center;
    text-transform:capitalize;
}

@keyframes pulse {
    0% {transform: scale(0.6); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(0.6); opacity: 1;}
}

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

.content {
    display: none;
}

.loaded .loader-container {
    display: none;
}

.loaded .content {
    display: block;
}

#login-screen.hidden {
    display: none !important;
}

.message-bubble.json-menu {
    max-width: 90%;
    background-color: #e1f5fe;
    padding: 10px;
    border-radius: 12px;
    margin: 8px auto;
    overflow-x: hidden;
    word-wrap: break-word;
    font-family: inherit;
}

.json-title {
    font-size: 1rem;
    margin-bottom: 5px;
}

.json-list-item.es-encuesta {
    border: 2px solid #1ca08f;
    border-radius: 20px;
    padding: 6px 10px;
    margin: 6px auto;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    color: #1ca08f;
    font-size: 14px;
    text-align: center;
    width: 70%;
    max-width: 350px;
}

.json-list-item.es-encuesta:hover {
    background-color: #1ca08f;
    color: #ffffff;
    transform: scale(1.04);
}

.reconnect-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: "Segoe UI", sans-serif;
    font-size: 1.2rem;
    color: #333;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ccc;
    border-top: 6px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.hidden {
    display: none !important;
}
.show-flex {
    display: flex !important;
}

/* Fondo oscuro semitransparente */
.encuesta-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Caja blanca centrada */
.encuesta-modal-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 90%;
}

/* Texto del mensaje */
.encuesta-modal-box p {
    font-size: 16px;
    margin-bottom: 15px;
}

/* Botón */
.encuesta-modal-box button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background-color: #1976d2;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.encuesta-modal-box button:hover {
    background-color: #115293;
}


#reconnecting-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);  /* fondo semitransparente elegante */
    z-index: 9999;                  /* por encima de todo */
    display: flex;
    align-items: center;
    justify-content: center;        /* centra contenido vertical y horizontalmente */
    flex-direction: column;         /* coloca spinner y texto en columna */
}
#reconnecting-screen .spinner {
    width: 50px; height: 50px;
    border: 6px solid #ccc;
    border-top-color: #3498db;      /* color del borde superior */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}
#reconnecting-screen p {
    color: #fff;
    font-size: 1.1em;
    margin: 0;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.hidden {
    display: none;
}
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.modal-buttons {
    margin-top: 1.5rem;
}
.modal-buttons button {
    margin: 0 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}
.btn-confirmar {
    background-color: #822b45;
    color: white;
}
.btn-cancelar {
    background-color: #f5bebe;
    color: #4a2a2a;
}