/* Chat Realtime - Estilos */

/* Importar DM Sans desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

.chat-rt-container {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #24232c;
    border-radius: 8px;
    background: #24232c;
    overflow: hidden;
    font-family: 'DM Sans', sans-serif;
}

/* Estados */
.chat-rt-estado {
    min-height: 400px;
}

/* Mensaje de Estado (Prechat) */
.chat-rt-mensaje-estado {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
    color: #fff;
    padding: 20px;
    background: #24232c;
}

.chat-rt-mensaje-estado p {
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
}

/* CHAT ACTIVO */
.chat-rt-chat {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-rt-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #24232c;
}

/* Mensajes individuales */
.chat-message {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #4c4b53;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-family: 'DM Sans', sans-serif;
}

/* Mensajes del admin - ROJO */
.chat-message.is-admin {
    background: #F00023;
    box-shadow: 0 2px 4px rgba(240, 0, 35, 0.3);
}

/* Mensajes del moderador - VERDE */
.chat-message.is-moderator {
    background: #009343;
    box-shadow: 0 2px 4px rgba(0, 147, 67, 0.3);
}

/* TODOS los nombres de usuario: blancos en negrita */
.chat-message-author {
    font-weight: 700;
    font-size: 14px;
    display: inline;
    margin-right: 8px;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
}

.chat-message-author::after {
    content: ":";
}

.chat-message-text {
    font-size: 14px;
    color: #fff;
    word-wrap: break-word;
    line-height: 1.4;
    display: inline;
    font-family: 'DM Sans', sans-serif;
}

/* Input del chat */
.chat-rt-input-container {
    display: flex;
    padding: 12px;
    border-top: 1px solid #4c4b53;
    background: #24232c;
    gap: 8px;
    flex-direction: column;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #4c4b53;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: #4c4b53;
    color: #fff;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#chat-input:focus {
    outline: none;
    border-color: #009343;
}

#chat-input.error {
    border-color: #F00023;
}

/* BOTÓN ENVIAR - ESTILO WHATSAPP */
#chat-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    background: #009343;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 147, 67, 0.3);
}

#chat-send svg {
    width: 20px;
    height: 20px;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

#chat-send:hover {
    background: #007a38;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 147, 67, 0.4);
}

#chat-send:hover svg {
    transform: rotate(15deg);
}

#chat-send:active {
    transform: scale(0.95);
}

#chat-send:disabled {
    background: #4c4b53;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

#chat-send:disabled:hover {
    transform: none;
}

#chat-send:disabled svg {
    transform: none;
}

.chat-error-message {
    color: #fff;
    font-size: 13px;
    padding: 4px 8px;
    background: #F00023;
    border-radius: 4px;
    display: none;
    font-family: 'DM Sans', sans-serif;
}

/* Scrollbar personalizado */
.chat-rt-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-rt-messages::-webkit-scrollbar-track {
    background: #24232c;
}

.chat-rt-messages::-webkit-scrollbar-thumb {
    background: #4c4b53;
    border-radius: 4px;
}

.chat-rt-messages::-webkit-scrollbar-thumb:hover {
    background: #5c5b63;
}

/* Mensaje de carga */
.loading-messages {
    text-align: center;
    color: #fff;
    padding: 40px 20px;
    font-style: italic;
    font-family: 'DM Sans', sans-serif;
}

/* PREGUNTA ACTIVA */
.pregunta-container {
    padding: 30px;
    background: #24232c;
    font-family: 'DM Sans', sans-serif;
}

.pregunta-header {
    text-align: center;
    margin-bottom: 30px;
}

/* BARRA DE PROGRESO */
.pregunta-contador {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.pregunta-barra-container {
    width: 100%;
    height: 8px;
    background: #4c4b53;
    border-radius: 4px;
    overflow: hidden;
}

.pregunta-barra-progreso {
    height: 100%;
    background: linear-gradient(90deg, #F00023 0%, #ffc107 50%, #009343 100%);
    transition: width 2.5s linear;
    width: 100%;
}

/* TÍTULO PREGUNTA */
#pregunta-titulo {
    font-size: 18px;
    color: #fff;
    margin: 0;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
}

/* RESPUESTAS APILADAS */
.pregunta-respuestas {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* RESPUESTAS */
.respuesta-opcion {
    padding: 15px;
    background: #4c4b53;
    border: 2px solid #4c4b53;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'DM Sans', sans-serif;
}

.respuesta-opcion:hover {
    background: #5c5b63;
    border-color: #009343;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 147, 67, 0.3);
}

.respuesta-opcion.selected {
    background: #009343;
    border-color: #007a38;
    color: #fff;
    font-weight: 600;
}

.pregunta-acciones {
    text-align: center;
    margin-top: 30px;
}

/* BOTÓN CONFIRMAR */
#btn-confirmar-respuesta {
    padding: 12px 32px;
    background: #009343;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 147, 67, 0.4);
    font-family: 'DM Sans', sans-serif;
}

#btn-confirmar-respuesta:hover {
    background: #007a38;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 147, 67, 0.5);
}

#btn-confirmar-respuesta:disabled {
    background: #4c4b53;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pregunta-esperando {
    text-align: center;
    padding: 40px 20px;
}

.pregunta-esperando h3 {
    font-size: 22px;
    color: #fff;
    margin: 0 0 10px 0;
    font-family: 'DM Sans', sans-serif;
}

.pregunta-esperando p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-family: 'DM Sans', sans-serif;
}

/* MODALES */
.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.chat-modal-content {
    position: relative;
    background: #24232c;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    text-align: center;
    z-index: 10001;
}

.chat-modal-content h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
}

.chat-modal-content p {
    margin: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'DM Sans', sans-serif;
}

/* Modal de éxito (respuesta correcta) */
.chat-modal-success h3 {
    color: #009343;
}

.chat-modal-success {
    border-top: 4px solid #009343;
}

/* Modal de error (respuesta incorrecta) */
.chat-modal-error h3 {
    color: #F00023;
}

.chat-modal-error {
    border-top: 4px solid #F00023;
}