/* Contenedor del chatbot */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    display: none;
    z-index: 9999;
}

    /* Contenedor general del chat */
    #chatbot-container > div {
        background-color: #f5f5f5;
        border-radius: 10px;
        box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
    }

/* Encabezado */
#chatbot-header {
    background-color: #0078d7;
    color: white;
    border-radius: 5px 5px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
}

/* Botón cerrar */
#close-chatbot {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

    #close-chatbot:hover {
        color: #ccc;
    }

/* Avatar */
#chatbot-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 10px 0 5px 0;
    cursor: pointer;
}

/* Título */
#chatbot-title {
    font-size: 18px;
    margin: 0;
}

/* Descripción */
#chatbot-description {
    font-size: 14px;
    text-align: center;
    margin: 0;
}

/* Contenedor de mensajes */
#chatbot-messages {
    padding: 10px;
    height: 360px;
    overflow-y: auto;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
}

/* Mensajes del cliente */
.message.user {
    background-color: #0078d7;
    color: white;
    padding: 10px;
    border-radius: 10px;
    margin: 5px 8px; /* Margen horizontal reducido */
    width: calc(100% - 16px); /* Ancho total menos los márgenes */
    text-align: left; /* Cambiado de right a left para consistencia */
}

/* Mensajes del bot */
.message.bot {
    background-color: #f0f0f0;
    color: black;
    padding: 10px;
    border-radius: 10px;
    margin: 5px 8px; /* Margen horizontal reducido */
    width: calc(100% - 16px); /* Ancho total menos los márgenes */
    white-space: pre-line;
}

    /* Estilos para las negritas en mensajes del bot */
    .message.bot strong {
        display: block; /* Hace que cada negrita ocupe su propia línea */
        margin: 5px 0; /* Añade espacio arriba y abajo de las negritas */
        font-weight: bold;
    }

/* Pie del chat */
#chatbot-footer {
    display: flex;
    padding: 10px;
    background-color: #f9f9f9;
}

/* Campo de entrada */
#chatbot-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Botón enviar */
#chatbot-send {
    margin-left: 5px;
    background-color: #0078d7;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

#reset-chatbot {
    position: absolute;
    top: 10px;
    right: 40px; /* Posicionado a la izquierda del botón cerrar */
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

    #reset-chatbot:hover {
        color: #ccc;
    }

/* Indicador de escritura */
.typing-indicator {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-radius: 10px;
    margin: 5px 0;
    width: fit-content;
    max-width: 90%;
    align-self: flex-start;
}

    .typing-indicator .dots {
        display: flex;
        gap: 4px;
    }

        .typing-indicator .dots span {
            width: 8px;
            height: 8px;
            background-color: #666;
            border-radius: 50%;
            animation: typing 1s infinite ease-in-out;
        }

            .typing-indicator .dots span:nth-child(1) {
                animation-delay: 0.2s;
            }

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

            .typing-indicator .dots span:nth-child(3) {
                animation-delay: 0.6s;
            }

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Estilos para el botón flotante y sus elementos */
.chatbot-float-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

#chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border: none;
    background-color: transparent;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

    #chatbot-toggle:hover {
        transform: scale(1.05);
    }

    #chatbot-toggle img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

/* Badge con número */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff0000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Tooltip del mensaje */
.chatbot-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background-color: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    white-space: nowrap;
}

    .chatbot-tooltip::after {
        content: '';
        position: absolute;
        bottom: -5px;
        right: 25px;
        width: 10px;
        height: 10px;
        background-color: white;
        transform: rotate(45deg);
    }

/* Eliminar los estilos anteriores de .chatbot-form y agregar estos nuevos */
.chatbot-form-inline {
    padding: 20px;
    background-color: white;
    height: 360px; /* Misma altura que el contenedor de mensajes */
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-content {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

    .form-group input {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        outline: none;
        font-size: 14px;
    }

        .form-group input:focus {
            border-color: #0078d7;
            box-shadow: 0 0 0 2px rgba(0, 120, 215, 0.1);
        }



/* Estilo base común para ambos botones */
.submit-btn, #chatbot-send {
    background-color: #4A90E2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

    .submit-btn:hover, #chatbot-send:hover {
        background-color: #357ABD;
    }

    /* Estilos específicos para el estado de loading del botón submit */
    .submit-btn.loading {
        background-color: #357ABD;
        cursor: not-allowed;
        padding-left: 35px;
    }

        .submit-btn.loading::before {
            content: '';
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 15px;
            height: 15px;
            border: 2px solid transparent;
            border-top-color: #ffffff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

    /* Estilos para estado disabled */
    .submit-btn:disabled, #chatbot-send:disabled {
        background-color: #B3B3B3;
        cursor: not-allowed;
    }

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Ajustes adicionales para mantener la alineación en el formulario */
#initial-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    margin-bottom: 10px;
}

/* Asegurar que los inputs tengan el mismo estilo */
#user-name, #user-email {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

    #user-name:focus, #user-email:focus {
        outline: none;
        border-color: #4A90E2;
    }