/* =============================================
   ESTILOS BASE DEL CHATBOT
   ============================================= */

/* Contenedor principal del chat (el ícono y la caja) */
#gcp-chatbot-float-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: Arial, sans-serif;
}

/* Ícono Flotante */
#gcp-chat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073e6; /* Azul de marca */
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gcp-chat-icon:hover {
    transform: scale(1.05);
}

/* Animación del ícono al estar abierto */
#gcp-chat-icon.open {
    transform: rotate(360deg);
    background-color: #f7564d; /* Cambia a un color de 'cierre' */
}

/* Contenedor principal de la caja de chat */
#gcp-chat-box {
    display: none; /* Inicialmente oculto */
    flex-direction: column;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    position: absolute;
    bottom: 75px;
    right: 0;
    overflow: hidden;
}

/* =============================================
   HEADER (Encabezado)
   ============================================= */

#gcp-chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #0073e6; /* Color primario */
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gcp-logo-header {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.gcp-chat-title {
    font-size: 16px;
    font-weight: bold;
    flex-grow: 1;
}

#gcp-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

/* =============================================
   MESSAGES (Mensajes)
   ============================================= */

#gcp-chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f7f7f7;
    display: flex;
    flex-direction: column;
}

/* Estilo base para el mensaje */
.gcp-message {
    display: flex;
    margin-bottom: 15px;
    max-width: 85%;
}

/* Contenido del mensaje (el globo de diálogo) */
.gcp-content {
    padding: 10px 15px;
    border-radius: 20px;
    line-height: 1.4;
    font-size: 14px;
    white-space: pre-wrap; /* Mantiene saltos de línea y formato */
}

/* Mensajes de la IA (Modelo) */
.gcp-model-message {
    align-self: flex-start;
}

.gcp-model-message .gcp-avatar {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.gcp-model-message .gcp-content {
    background-color: #e5e5e5;
    border-top-left-radius: 5px;
}

/* Mensajes del Usuario */
.gcp-user-message {
    align-self: flex-end;
    margin-left: auto; /* Empuja a la derecha */
}

.gcp-user-message .gcp-content {
    background-color: #0073e6;
    color: white;
    border-top-right-radius: 5px;
}

/* =============================================
   INPUT Y BOTÓN DE ENVÍO
   ============================================= */

#gcp-chat-input-area {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
}

#gcp-chat-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 14px;
}

#gcp-send-btn {
    background-color: #0073e6;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gcp-send-btn:hover:not(:disabled) {
    background-color: #005bb5;
}

#gcp-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#gcp-send-btn svg {
    width: 20px;
    height: 20px;
}

/* =============================================
   INDICADOR DE CARGA (LOADING)
   ============================================= */

.gcp-loading-dots {
    display: flex;
    align-items: center;
    height: 14px; /* Para alinear con el texto */
}

.gcp-loading-dots span {
    font-size: 20px;
    line-height: 0;
    margin-right: 2px;
    animation: loading-dot-fade 1.2s infinite;
}

.gcp-loading-dots span:nth-child(2) {
    animation-delay: 0.4s;
}

.gcp-loading-dots span:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes loading-dot-fade {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}