/* Contenedor Principal */
#jcmr-chat-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 999999;
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* 1. Ajuste de la Burbuja para que las imágenes se encimen */
#jcmr-chat-bubble {
    position: relative; /* CLAVE: para que las imágenes absolute se guíen por este div */
    width: 80px;  /* Asegurate que coincida con el tamaño de tu imagen */
    height: 80px;
    display: flex;
    align-items: center;
	box-shadow: none !important;
    justify-content: center;
    overflow: visible; /* Cambiado de hidden para que la sombra y el scale se vean bien */
    cursor: pointer;
    animation: jcmr-float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

#jcmr-chat-bubble:hover {
    transform: scale(1.1); /* Efecto de agrandar al pasar el mouse */
}

/* 2. Estilo de las imágenes para que ocupen el mismo lugar */
.jcmr-chat-icon-img {
    position: absolute; /* CLAVE: saca la imagen del flujo normal y las encima */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease; /* Suaviza el fundido */
}

/* Animación de flotación */
@keyframes jcmr-float {
    0% {
        transform: translateY(0px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
    50% {
        transform: translateY(-10px); /* Sube 10px */
        box-shadow: 0 25px 15px rgba(0,0,0,0.1); /* Sombra más suave al subir */
    }
    100% {
        transform: translateY(0px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
}

#jcmr-chat-bubble .jcmr-icon {
    font-size: 30px;
    color: white;
}

/* Ventana de Chat */
#jcmr-chat-window {
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
}

/* Cabecera */
#jcmr-chat-header {
    padding: 5px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}
#jcmr-chat-header span {
    white-space: nowrap;
    font-weight: 600;
}

#jcmr-close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
	padding: 5px;
}

/* Área de Mensajes */
#jcmr-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9f9f9;
}

/* Estilo de los Globos de Texto */
.jcmr-msg {
    padding: 10px 14px;
    border-radius: 15px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
}

.jcmr-msg-user {
    background: #e2e8f0;
    align-self: flex-end;
    color: #1a202c;
    border-bottom-right-radius: 2px;
}

.jcmr-msg-bot {
    background: #2563eb; /* Se puede cambiar dinámicamente */
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

/* Formularios e Inputs */
#jcmr-chat-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
}

#jcmr-welcome-form, #jcmr-message-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#jcmr-message-form {
    flex-direction: row;
}

#jcmr-chat-input-area input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

#jcmr-chat-input-area button {
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
/* Esto es solo por si querés que los mensajes en el admin no ocupen 1000 líneas */
.wp-list-table td {
    vertical-align: middle;
}

/* Estilo para los links dentro del chat */
.jcmr-msg-bot a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    position: relative;
    display: inline-flex;
    background: #ff57ca;
    padding: 2px 3px;
    border-radius: 15px;
}

/* Animación simple para el "Escribiendo..." */
.jcmr-typing {
    font-style: italic;
    opacity: 0.7;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: .4; }
    50% { opacity: 1; }
    100% { opacity: .4; }
}

/* Espaciado entre burbujas para que el efecto de párrafos se note */
.jcmr-msg {
    margin-bottom: 8px;
    line-height: 1.4;
}


/* 3. La de hover empieza invisible */
.jcmr-icon-hover {
    opacity: 0;
}

/* 4. Al hacer hover, una aparece y la otra se va */
#jcmr-chat-bubble:hover .jcmr-icon-default {
    opacity: 0;
}

#jcmr-chat-bubble:hover .jcmr-icon-hover {
    opacity: 1;
}

/* Mantenemos la animación de flotación que ya teníamos */
@keyframes jcmr-float {
    0%, 100% { transform: translateY(0px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
    50% { transform: translateY(-10px); box-shadow: 0 25px 15px rgba(0,0,0,0.1); }
}